All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 01/16] net/bond: Delete driver and module versions
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

The in-kernel code has already unique version, which is based
on Linus's tag, update the bond driver to be consistent with that
version.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/bonding/bond_main.c    | 4 +---
 drivers/net/bonding/bonding_priv.h | 4 ++--
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 48d5ec770b94..a808cb8d1aec 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -4321,7 +4321,6 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
 				     struct ethtool_drvinfo *drvinfo)
 {
 	strlcpy(drvinfo->driver, DRV_NAME, sizeof(drvinfo->driver));
-	strlcpy(drvinfo->version, DRV_VERSION, sizeof(drvinfo->version));
 	snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d",
 		 BOND_ABI_VERSION);
 }
@@ -5015,6 +5014,5 @@ static void __exit bonding_exit(void)
 module_init(bonding_init);
 module_exit(bonding_exit);
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);
-MODULE_DESCRIPTION(DRV_DESCRIPTION ", v" DRV_VERSION);
+MODULE_DESCRIPTION(DRV_DESCRIPTION);
 MODULE_AUTHOR("Thomas Davis, tadavis@lbl.gov and many others");
diff --git a/drivers/net/bonding/bonding_priv.h b/drivers/net/bonding/bonding_priv.h
index 5a4d81a9437c..b80dd8499c85 100644
--- a/drivers/net/bonding/bonding_priv.h
+++ b/drivers/net/bonding/bonding_priv.h
@@ -14,12 +14,12 @@

 #ifndef _BONDING_PRIV_H
 #define _BONDING_PRIV_H
+#include <linux/vermagic.h>

-#define DRV_VERSION	"3.7.1"
 #define DRV_RELDATE	"April 27, 2011"
 #define DRV_NAME	"bonding"
 #define DRV_DESCRIPTION	"Ethernet Channel Bonding Driver"

-#define bond_version DRV_DESCRIPTION ": v" DRV_VERSION " (" DRV_RELDATE ")\n"
+#define bond_version DRV_DESCRIPTION ": v" UTS_RELEASE " (" DRV_RELDATE ")\n"

 #endif
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 02/16] net/dummy: Ditch driver and module versions
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Delete constant driver and module versions in favor standard
global version which is unique to whole kernel.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/dummy.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/dummy.c b/drivers/net/dummy.c
index 3031a5fc5427..bab3a9bb5e6f 100644
--- a/drivers/net/dummy.c
+++ b/drivers/net/dummy.c
@@ -42,7 +42,6 @@
 #include <linux/u64_stats_sync.h>

 #define DRV_NAME	"dummy"
-#define DRV_VERSION	"1.0"

 static int numdummies = 1;

@@ -104,7 +103,6 @@ static void dummy_get_drvinfo(struct net_device *dev,
 			      struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 }

 static const struct ethtool_ops dummy_ethtool_ops = {
@@ -212,4 +210,3 @@ module_init(dummy_init_module);
 module_exit(dummy_cleanup_module);
 MODULE_LICENSE("GPL");
 MODULE_ALIAS_RTNL_LINK(DRV_NAME);
-MODULE_VERSION(DRV_VERSION);
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 04/16] net/adaptec: Clean driver versions
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Delete useless driver version in favor of default ones.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/adaptec/starfire.c | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/drivers/net/ethernet/adaptec/starfire.c b/drivers/net/ethernet/adaptec/starfire.c
index 165d18405b0c..9e162cce6724 100644
--- a/drivers/net/ethernet/adaptec/starfire.c
+++ b/drivers/net/ethernet/adaptec/starfire.c
@@ -27,7 +27,6 @@
 */

 #define DRV_NAME	"starfire"
-#define DRV_VERSION	"2.1"
 #define DRV_RELDATE	"July  6, 2008"

 #include <linux/interrupt.h>
@@ -47,6 +46,7 @@
 #include <asm/processor.h>		/* Processor type for cache alignment. */
 #include <linux/uaccess.h>
 #include <asm/io.h>
+#include <linux/vermagic.h>

 /*
  * The current frame processor firmware fails to checksum a fragment
@@ -166,14 +166,14 @@ static int rx_copybreak /* = 0 */;
 #define FIRMWARE_TX	"adaptec/starfire_tx.bin"

 /* These identify the driver base version and may not be removed. */
-static const char version[] =
-KERN_INFO "starfire.c:v1.03 7/26/2000  Written by Donald Becker <becker@scyld.com>\n"
-" (unofficial 2.2/2.4 kernel port, version " DRV_VERSION ", " DRV_RELDATE ")\n";
+static const char version[] = KERN_INFO
+	"starfire.c:v1.03 7/26/2000  Written by Donald Becker <becker@scyld.com>\n"
+	" (unofficial 2.2/2.4 kernel port, version " UTS_RELEASE
+	", " DRV_RELDATE ")\n";

 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
 MODULE_DESCRIPTION("Adaptec Starfire Ethernet driver");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);
 MODULE_FIRMWARE(FIRMWARE_RX);
 MODULE_FIRMWARE(FIRMWARE_TX);

@@ -1853,7 +1853,6 @@ static void get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
 	struct netdev_private *np = netdev_priv(dev);
 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	strlcpy(info->bus_info, pci_name(np->pci_dev), sizeof(info->bus_info));
 }

--
2.24.1


^ permalink raw reply related

* [PATCH net-next 05/16] net/aeroflex: Clean ethtool_info struct assignments
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

If FW version is not available, it is enough to leave that field as
empty, there is no need to write N/A.

The driver version is replaced in favor of generally available
in-tree variant.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/aeroflex/greth.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/aeroflex/greth.c b/drivers/net/ethernet/aeroflex/greth.c
index 2a9f8643629c..bf546118dbc6 100644
--- a/drivers/net/ethernet/aeroflex/greth.c
+++ b/drivers/net/ethernet/aeroflex/greth.c
@@ -1114,9 +1114,7 @@ static void greth_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *in

 	strlcpy(info->driver, dev_driver_string(greth->dev),
 		sizeof(info->driver));
-	strlcpy(info->version, "revision: 1.0", sizeof(info->version));
 	strlcpy(info->bus_info, greth->dev->bus->name, sizeof(info->bus_info));
-	strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
 }

 static void greth_get_regs(struct net_device *dev, struct ethtool_regs *regs, void *p)
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 06/16] net/agere: Delete unneeded driver version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

There is no need in driver version for in-tree kernel code.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/agere/et131x.c | 1 -
 drivers/net/ethernet/agere/et131x.h | 1 -
 2 files changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/agere/et131x.c b/drivers/net/ethernet/agere/et131x.c
index cb6a761d5c11..1b19385ad8a9 100644
--- a/drivers/net/ethernet/agere/et131x.c
+++ b/drivers/net/ethernet/agere/et131x.c
@@ -2958,7 +2958,6 @@ static void et131x_get_drvinfo(struct net_device *netdev,
 	struct et131x_adapter *adapter = netdev_priv(netdev);

 	strlcpy(info->driver, DRIVER_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRIVER_VERSION, sizeof(info->version));
 	strlcpy(info->bus_info, pci_name(adapter->pdev),
 		sizeof(info->bus_info));
 }
diff --git a/drivers/net/ethernet/agere/et131x.h b/drivers/net/ethernet/agere/et131x.h
index be9a11c02526..d0e922584d8a 100644
--- a/drivers/net/ethernet/agere/et131x.h
+++ b/drivers/net/ethernet/agere/et131x.h
@@ -46,7 +46,6 @@
  */

 #define DRIVER_NAME "et131x"
-#define DRIVER_VERSION "v2.0"

 /* EEPROM registers */

--
2.24.1


^ permalink raw reply related

* [PATCH net-next 07/16] net/alacritech: Delete driver version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Use standard variant of the driver version.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/alacritech/slicoss.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/net/ethernet/alacritech/slicoss.c b/drivers/net/ethernet/alacritech/slicoss.c
index 9daef4c8feef..6234fcd844ee 100644
--- a/drivers/net/ethernet/alacritech/slicoss.c
+++ b/drivers/net/ethernet/alacritech/slicoss.c
@@ -26,7 +26,6 @@
 #include "slic.h"

 #define DRV_NAME			"slicoss"
-#define DRV_VERSION			"1.0"

 static const struct pci_device_id slic_id_tbl[] = {
 	{ PCI_DEVICE(PCI_VENDOR_ID_ALACRITECH,
@@ -1533,7 +1532,6 @@ static void slic_get_drvinfo(struct net_device *dev,
 	struct slic_device *sdev = netdev_priv(dev);

 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	strlcpy(info->bus_info, pci_name(sdev->pdev), sizeof(info->bus_info));
 }

@@ -1852,4 +1850,3 @@ module_pci_driver(slic_driver);
 MODULE_DESCRIPTION("Alacritech non-accelerated SLIC driver");
 MODULE_AUTHOR("Lino Sanfilippo <LinoSanfilippo@gmx.de>");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 08/16] net/allwinner: Remove driver version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

There is no need in custom driver version for in-tree code.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/allwinner/sun4i-emac.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/net/ethernet/allwinner/sun4i-emac.c b/drivers/net/ethernet/allwinner/sun4i-emac.c
index 22cadfbeedfb..18d3b4340bd4 100644
--- a/drivers/net/ethernet/allwinner/sun4i-emac.c
+++ b/drivers/net/ethernet/allwinner/sun4i-emac.c
@@ -33,7 +33,6 @@
 #include "sun4i-emac.h"

 #define DRV_NAME		"sun4i-emac"
-#define DRV_VERSION		"1.02"

 #define EMAC_MAX_FRAME_LEN	0x0600

@@ -212,7 +211,6 @@ static void emac_get_drvinfo(struct net_device *dev,
 			      struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	strlcpy(info->bus_info, dev_name(&dev->dev), sizeof(info->bus_info));
 }

--
2.24.1


^ permalink raw reply related

* [PATCH net-next 09/16] net/alteon: Properly report FW version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

The acenic driver assigns FW version in driver version field,
as part of cleanup driver version, set FW version properly.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/alteon/acenic.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/net/ethernet/alteon/acenic.c b/drivers/net/ethernet/alteon/acenic.c
index f366faf88eee..5d192d551623 100644
--- a/drivers/net/ethernet/alteon/acenic.c
+++ b/drivers/net/ethernet/alteon/acenic.c
@@ -2699,9 +2699,8 @@ static void ace_get_drvinfo(struct net_device *dev,
 	struct ace_private *ap = netdev_priv(dev);

 	strlcpy(info->driver, "acenic", sizeof(info->driver));
-	snprintf(info->version, sizeof(info->version), "%i.%i.%i",
-		 ap->firmware_major, ap->firmware_minor,
-		 ap->firmware_fix);
+	snprintf(info->fw_version, sizeof(info->version), "%i.%i.%i",
+		 ap->firmware_major, ap->firmware_minor, ap->firmware_fix);

 	if (ap->pdev)
 		strlcpy(info->bus_info, pci_name(ap->pdev),
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 10/16] net/althera: Delete hardcoded driver version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Convert to use default version provided by ethtool.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/altera/altera_tse_ethtool.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/net/ethernet/altera/altera_tse_ethtool.c b/drivers/net/ethernet/altera/altera_tse_ethtool.c
index 23823464f2e7..4299f1301149 100644
--- a/drivers/net/ethernet/altera/altera_tse_ethtool.c
+++ b/drivers/net/ethernet/altera/altera_tse_ethtool.c
@@ -67,7 +67,6 @@ static void tse_get_drvinfo(struct net_device *dev,
 	u32 rev = ioread32(&priv->mac_dev->megacore_revision);

 	strcpy(info->driver, "altera_tse");
-	strcpy(info->version, "v8.0");
 	snprintf(info->fw_version, ETHTOOL_FWVERS_LEN, "v%d.%d",
 		 rev & 0xFFFF, (rev & 0xFFFF0000) >> 16);
 	sprintf(info->bus_info, "platform");
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 11/16] net/amazon: Ensure that driver version is aligned to the linux kernel
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>


Upstream drivers are managed inside global repository and released all
together, this ensure that driver version is the same as linux kernel,
so update amazon drivers to properly reflect it.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/amazon/ena/ena_ethtool.c |  1 -
 drivers/net/ethernet/amazon/ena/ena_netdev.c  | 17 ++---------------
 drivers/net/ethernet/amazon/ena/ena_netdev.h  | 11 -----------
 3 files changed, 2 insertions(+), 27 deletions(-)

diff --git a/drivers/net/ethernet/amazon/ena/ena_ethtool.c b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
index ced1d577b62a..19262f37db84 100644
--- a/drivers/net/ethernet/amazon/ena/ena_ethtool.c
+++ b/drivers/net/ethernet/amazon/ena/ena_ethtool.c
@@ -404,7 +404,6 @@ static void ena_get_drvinfo(struct net_device *dev,
 	struct ena_adapter *adapter = netdev_priv(dev);

 	strlcpy(info->driver, DRV_MODULE_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_MODULE_VERSION, sizeof(info->version));
 	strlcpy(info->bus_info, pci_name(adapter->pdev),
 		sizeof(info->bus_info));
 }
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.c b/drivers/net/ethernet/amazon/ena/ena_netdev.c
index 0b2fd96b93d7..4faf81c456d8 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.c
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.c
@@ -49,12 +49,9 @@
 #include <linux/bpf_trace.h>
 #include "ena_pci_id_tbl.h"

-static char version[] = DEVICE_NAME " v" DRV_MODULE_VERSION "\n";
-
 MODULE_AUTHOR("Amazon.com, Inc. or its affiliates");
 MODULE_DESCRIPTION(DEVICE_NAME);
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_MODULE_VERSION);

 /* Time in jiffies before concluding the transmitter is hung. */
 #define TX_TIMEOUT  (5 * HZ)
@@ -3093,11 +3090,7 @@ static void ena_config_host_info(struct ena_com_dev *ena_dev,
 	host_info->os_dist = 0;
 	strncpy(host_info->os_dist_str, utsname()->release,
 		sizeof(host_info->os_dist_str) - 1);
-	host_info->driver_version =
-		(DRV_MODULE_VER_MAJOR) |
-		(DRV_MODULE_VER_MINOR << ENA_ADMIN_HOST_INFO_MINOR_SHIFT) |
-		(DRV_MODULE_VER_SUBMINOR << ENA_ADMIN_HOST_INFO_SUB_MINOR_SHIFT) |
-		("K"[0] << ENA_ADMIN_HOST_INFO_MODULE_TYPE_SHIFT);
+	host_info->driver_version = LINUX_VERSION_CODE;
 	host_info->num_cpus = num_online_cpus();

 	host_info->driver_supported_features =
@@ -3476,9 +3469,7 @@ static int ena_restore_device(struct ena_adapter *adapter)
 		netif_carrier_on(adapter->netdev);

 	mod_timer(&adapter->timer_service, round_jiffies(jiffies + HZ));
-	dev_err(&pdev->dev,
-		"Device reset completed successfully, Driver info: %s\n",
-		version);
+	dev_err(&pdev->dev, "Device reset completed successfully\n");

 	return rc;
 err_disable_msix:
@@ -4116,8 +4107,6 @@ static int ena_probe(struct pci_dev *pdev, const struct pci_device_id *ent)

 	dev_dbg(&pdev->dev, "%s\n", __func__);

-	dev_info_once(&pdev->dev, "%s", version);
-
 	rc = pci_enable_device_mem(pdev);
 	if (rc) {
 		dev_err(&pdev->dev, "pci_enable_device_mem() failed!\n");
@@ -4429,8 +4418,6 @@ static struct pci_driver ena_pci_driver = {

 static int __init ena_init(void)
 {
-	pr_info("%s", version);
-
 	ena_wq = create_singlethread_workqueue(DRV_MODULE_NAME);
 	if (!ena_wq) {
 		pr_err("Failed to create workqueue\n");
diff --git a/drivers/net/ethernet/amazon/ena/ena_netdev.h b/drivers/net/ethernet/amazon/ena/ena_netdev.h
index 8795e0b1dc3c..74c7f10b60dd 100644
--- a/drivers/net/ethernet/amazon/ena/ena_netdev.h
+++ b/drivers/net/ethernet/amazon/ena/ena_netdev.h
@@ -45,18 +45,7 @@
 #include "ena_com.h"
 #include "ena_eth_com.h"

-#define DRV_MODULE_VER_MAJOR	2
-#define DRV_MODULE_VER_MINOR	1
-#define DRV_MODULE_VER_SUBMINOR 0
-
 #define DRV_MODULE_NAME		"ena"
-#ifndef DRV_MODULE_VERSION
-#define DRV_MODULE_VERSION \
-	__stringify(DRV_MODULE_VER_MAJOR) "."	\
-	__stringify(DRV_MODULE_VER_MINOR) "."	\
-	__stringify(DRV_MODULE_VER_SUBMINOR) "K"
-#endif
-
 #define DEVICE_NAME	"Elastic Network Adapter (ENA)"

 /* 1 for AENQ + ADMIN */
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 12/16] net/amd: Remove useless driver version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Convert AMD drivers to respect universal linux kernel version.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/amd/amd8111e.c          |  5 +----
 drivers/net/ethernet/amd/au1000_eth.c        |  5 -----
 drivers/net/ethernet/amd/nmclan_cs.c         |  9 +++------
 drivers/net/ethernet/amd/pcnet32.c           |  7 -------
 drivers/net/ethernet/amd/sunlance.c          | 10 ----------
 drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c |  1 -
 drivers/net/ethernet/amd/xgbe/xgbe-main.c    |  1 -
 drivers/net/ethernet/amd/xgbe/xgbe.h         |  1 -
 8 files changed, 4 insertions(+), 35 deletions(-)

diff --git a/drivers/net/ethernet/amd/amd8111e.c b/drivers/net/ethernet/amd/amd8111e.c
index 0f3b743425e8..7a1286f8e983 100644
--- a/drivers/net/ethernet/amd/amd8111e.c
+++ b/drivers/net/ethernet/amd/amd8111e.c
@@ -84,9 +84,8 @@ Revision History:

 #include "amd8111e.h"
 #define MODULE_NAME	"amd8111e"
-#define MODULE_VERS	"3.0.7"
 MODULE_AUTHOR("Advanced Micro Devices, Inc.");
-MODULE_DESCRIPTION ("AMD8111 based 10/100 Ethernet Controller. Driver Version "MODULE_VERS);
+MODULE_DESCRIPTION("AMD8111 based 10/100 Ethernet Controller.");
 MODULE_LICENSE("GPL");
 module_param_array(speed_duplex, int, NULL, 0);
 MODULE_PARM_DESC(speed_duplex, "Set device speed and duplex modes, 0: Auto Negotiate, 1: 10Mbps Half Duplex, 2: 10Mbps Full Duplex, 3: 100Mbps Half Duplex, 4: 100Mbps Full Duplex");
@@ -1366,7 +1365,6 @@ static void amd8111e_get_drvinfo(struct net_device *dev,
 	struct amd8111e_priv *lp = netdev_priv(dev);
 	struct pci_dev *pci_dev = lp->pci_dev;
 	strlcpy(info->driver, MODULE_NAME, sizeof(info->driver));
-	strlcpy(info->version, MODULE_VERS, sizeof(info->version));
 	snprintf(info->fw_version, sizeof(info->fw_version),
 		"%u", chip_version);
 	strlcpy(info->bus_info, pci_name(pci_dev), sizeof(info->bus_info));
@@ -1875,7 +1873,6 @@ static int amd8111e_probe_one(struct pci_dev *pdev,

 	/*  display driver and device information */
     	chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28;
-	dev_info(&pdev->dev, "AMD-8111e Driver Version: %s\n", MODULE_VERS);
 	dev_info(&pdev->dev, "[ Rev %x ] PCI 10/100BaseT Ethernet %pM\n",
 		 chip_version, dev->dev_addr);
 	if (lp->ext_phy_id)
diff --git a/drivers/net/ethernet/amd/au1000_eth.c b/drivers/net/ethernet/amd/au1000_eth.c
index 089a4fbc61a0..9f6e3cc2ce80 100644
--- a/drivers/net/ethernet/amd/au1000_eth.c
+++ b/drivers/net/ethernet/amd/au1000_eth.c
@@ -63,14 +63,12 @@ static int au1000_debug = 3;
 				NETIF_MSG_LINK)

 #define DRV_NAME	"au1000_eth"
-#define DRV_VERSION	"1.7"
 #define DRV_AUTHOR	"Pete Popov <ppopov@embeddedalley.com>"
 #define DRV_DESC	"Au1xxx on-chip Ethernet driver"

 MODULE_AUTHOR(DRV_AUTHOR);
 MODULE_DESCRIPTION(DRV_DESC);
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);

 /* AU1000 MAC registers and bits */
 #define MAC_CONTROL		0x0
@@ -656,7 +654,6 @@ au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 	struct au1000_private *aup = netdev_priv(dev);

 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	snprintf(info->bus_info, sizeof(info->bus_info), "%s %d", DRV_NAME,
 		 aup->mac_id);
 }
@@ -1290,8 +1287,6 @@ static int au1000_probe(struct platform_device *pdev)
 	netdev_info(dev, "Au1xx0 Ethernet found at 0x%lx, irq %d\n",
 			(unsigned long)base->start, irq);

-	pr_info_once("%s version %s %s\n", DRV_NAME, DRV_VERSION, DRV_AUTHOR);
-
 	return 0;

 err_out:
diff --git a/drivers/net/ethernet/amd/nmclan_cs.c b/drivers/net/ethernet/amd/nmclan_cs.c
index 023aecf6ab30..11c0b13edd30 100644
--- a/drivers/net/ethernet/amd/nmclan_cs.c
+++ b/drivers/net/ethernet/amd/nmclan_cs.c
@@ -114,8 +114,6 @@ Log: nmclan_cs.c,v
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

 #define DRV_NAME	"nmclan_cs"
-#define DRV_VERSION	"0.16"
-

 /* ----------------------------------------------------------------------------
 Conditional Compilation Options
@@ -367,7 +365,7 @@ typedef struct _mace_private {

     char tx_free_frames; /* Number of free transmit frame buffers */
     char tx_irq_disabled; /* MACE TX interrupt disabled */
-
+
     spinlock_t bank_lock; /* Must be held if you step off bank 0 */
 } mace_private;

@@ -444,7 +442,7 @@ static int nmclan_probe(struct pcmcia_device *link)
     lp = netdev_priv(dev);
     lp->p_dev = link;
     link->priv = dev;
-
+
     spin_lock_init(&lp->bank_lock);
     link->resource[0]->end = 32;
     link->resource[0]->flags |= IO_DATA_PATH_WIDTH_AUTO;
@@ -817,7 +815,6 @@ static void netdev_get_drvinfo(struct net_device *dev,
 			       struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	snprintf(info->bus_info, sizeof(info->bus_info),
 		"PCMCIA 0x%lx", dev->base_addr);
 }
@@ -1110,7 +1107,7 @@ static int mace_rx(struct net_device *dev, unsigned char RxCnt)
 	if (pkt_len & 1)
 	    *(skb_tail_pointer(skb) - 1) = inb(ioaddr + AM2150_RCV);
 	skb->protocol = eth_type_trans(skb, dev);
-
+
 	netif_rx(skb); /* Send the packet to the upper (protocol) layers. */

 	dev->stats.rx_packets++;
diff --git a/drivers/net/ethernet/amd/pcnet32.c b/drivers/net/ethernet/amd/pcnet32.c
index dc7d88227e76..07e8211eea51 100644
--- a/drivers/net/ethernet/amd/pcnet32.c
+++ b/drivers/net/ethernet/amd/pcnet32.c
@@ -24,13 +24,9 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

 #define DRV_NAME	"pcnet32"
-#define DRV_VERSION	"1.35"
 #define DRV_RELDATE	"21.Apr.2008"
 #define PFX		DRV_NAME ": "

-static const char *const version =
-    DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " tsbogend@alpha.franken.de\n";
-
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
@@ -809,7 +805,6 @@ static void pcnet32_get_drvinfo(struct net_device *dev,
 	struct pcnet32_private *lp = netdev_priv(dev);

 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	if (lp->pci_dev)
 		strlcpy(info->bus_info, pci_name(lp->pci_dev),
 			sizeof(info->bus_info));
@@ -3006,8 +3001,6 @@ MODULE_LICENSE("GPL");

 static int __init pcnet32_init_module(void)
 {
-	pr_info("%s", version);
-
 	pcnet32_debug = netif_msg_init(debug, PCNET32_MSG_DEFAULT);

 	if ((tx_start_pt >= 0) && (tx_start_pt <= 3))
diff --git a/drivers/net/ethernet/amd/sunlance.c b/drivers/net/ethernet/amd/sunlance.c
index b00e00881253..a21b2e60157e 100644
--- a/drivers/net/ethernet/amd/sunlance.c
+++ b/drivers/net/ethernet/amd/sunlance.c
@@ -105,14 +105,9 @@ static char lancestr[] = "LANCE";
 #include <asm/irq.h>

 #define DRV_NAME	"sunlance"
-#define DRV_VERSION	"2.02"
 #define DRV_RELDATE	"8/24/03"
 #define DRV_AUTHOR	"Miguel de Icaza (miguel@nuclecu.unam.mx)"

-static char version[] =
-	DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " " DRV_AUTHOR "\n";
-
-MODULE_VERSION(DRV_VERSION);
 MODULE_AUTHOR(DRV_AUTHOR);
 MODULE_DESCRIPTION("Sun Lance ethernet driver");
 MODULE_LICENSE("GPL");
@@ -1282,7 +1277,6 @@ static void lance_free_hwresources(struct lance_private *lp)
 static void sparc_lance_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, "sunlance", sizeof(info->driver));
-	strlcpy(info->version, "2.02", sizeof(info->version));
 }

 static const struct ethtool_ops sparc_lance_ethtool_ops = {
@@ -1305,7 +1299,6 @@ static int sparc_lance_probe_one(struct platform_device *op,
 				 struct platform_device *lebuffer)
 {
 	struct device_node *dp = op->dev.of_node;
-	static unsigned version_printed;
 	struct lance_private *lp;
 	struct net_device *dev;
 	int    i;
@@ -1316,9 +1309,6 @@ static int sparc_lance_probe_one(struct platform_device *op,

 	lp = netdev_priv(dev);

-	if (sparc_lance_debug && version_printed++ == 0)
-		printk (KERN_INFO "%s", version);
-
 	spin_lock_init(&lp->lock);

 	/* Copy the IDPROM ethernet address to the device structure, later we
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
index 8083173f1a8f..b23c8ee24ee3 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c
@@ -405,7 +405,6 @@ static void xgbe_get_drvinfo(struct net_device *netdev,
 	struct xgbe_hw_features *hw_feat = &pdata->hw_feat;

 	strlcpy(drvinfo->driver, XGBE_DRV_NAME, sizeof(drvinfo->driver));
-	strlcpy(drvinfo->version, XGBE_DRV_VERSION, sizeof(drvinfo->version));
 	strlcpy(drvinfo->bus_info, dev_name(pdata->dev),
 		sizeof(drvinfo->bus_info));
 	snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version), "%d.%d.%d",
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe-main.c b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
index 7ce9c69e9c44..2a70714a791d 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe-main.c
+++ b/drivers/net/ethernet/amd/xgbe/xgbe-main.c
@@ -127,7 +127,6 @@

 MODULE_AUTHOR("Tom Lendacky <thomas.lendacky@amd.com>");
 MODULE_LICENSE("Dual BSD/GPL");
-MODULE_VERSION(XGBE_DRV_VERSION);
 MODULE_DESCRIPTION(XGBE_DRV_DESC);

 static int debug = -1;
diff --git a/drivers/net/ethernet/amd/xgbe/xgbe.h b/drivers/net/ethernet/amd/xgbe/xgbe.h
index 47bcbcf58048..5897e46faca5 100644
--- a/drivers/net/ethernet/amd/xgbe/xgbe.h
+++ b/drivers/net/ethernet/amd/xgbe/xgbe.h
@@ -135,7 +135,6 @@
 #include <linux/list.h>

 #define XGBE_DRV_NAME		"amd-xgbe"
-#define XGBE_DRV_VERSION	"1.0.3"
 #define XGBE_DRV_DESC		"AMD 10 Gigabit Ethernet Driver"

 /* Descriptor related defines */
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 03/16] net/3com: Delete driver and module versions from 3com drivers
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

There is no need to mislead users by providing different versions for
driver, ethtool and modules. Delete driver assignments and let use
the default one.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/3com/3c509.c    | 7 +------
 drivers/net/ethernet/3com/3c515.c    | 6 ++----
 drivers/net/ethernet/3com/3c589_cs.c | 2 --
 drivers/net/ethernet/3com/typhoon.c  | 1 -
 4 files changed, 3 insertions(+), 13 deletions(-)

diff --git a/drivers/net/ethernet/3com/3c509.c b/drivers/net/ethernet/3com/3c509.c
index 8cafd06ff0c4..f1fc37c1c544 100644
--- a/drivers/net/ethernet/3com/3c509.c
+++ b/drivers/net/ethernet/3com/3c509.c
@@ -60,7 +60,6 @@
 */

 #define DRV_NAME	"3c509"
-#define DRV_VERSION	"1.20"
 #define DRV_RELDATE	"04Feb2008"

 /* A few values that may be tweaked. */
@@ -87,13 +86,12 @@
 #include <linux/device.h>
 #include <linux/eisa.h>
 #include <linux/bitops.h>
+#include <linux/vermagic.h>

 #include <linux/uaccess.h>
 #include <asm/io.h>
 #include <asm/irq.h>

-static char version[] = DRV_NAME ".c:" DRV_VERSION " " DRV_RELDATE " becker@scyld.com\n";
-
 #ifdef EL3_DEBUG
 static int el3_debug = EL3_DEBUG;
 #else
@@ -547,8 +545,6 @@ static int el3_common_init(struct net_device *dev)
 	       dev->name, dev->base_addr, if_names[(dev->if_port & 0x03)],
 	       dev->dev_addr, dev->irq);

-	if (el3_debug > 0)
-		pr_info("%s", version);
 	return 0;

 }
@@ -1143,7 +1139,6 @@ el3_netdev_set_ecmd(struct net_device *dev,
 static void el3_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 }

 static int el3_get_link_ksettings(struct net_device *dev,
diff --git a/drivers/net/ethernet/3com/3c515.c b/drivers/net/ethernet/3com/3c515.c
index 1e233e2f0a5a..b55fa8cb12e3 100644
--- a/drivers/net/ethernet/3com/3c515.c
+++ b/drivers/net/ethernet/3com/3c515.c
@@ -22,12 +22,12 @@

 */

+#include <linux/vermagic.h>
 #define DRV_NAME		"3c515"
-#define DRV_VERSION		"0.99t-ac"
 #define DRV_RELDATE		"28-Oct-2002"

 static char *version =
-DRV_NAME ".c:v" DRV_VERSION " " DRV_RELDATE " becker@scyld.com and others\n";
+DRV_NAME ".c:v" UTS_RELEASE " " DRV_RELDATE " becker@scyld.com and others\n";

 #define CORKSCREW 1

@@ -84,7 +84,6 @@ static int max_interrupt_work = 20;
 MODULE_AUTHOR("Donald Becker <becker@scyld.com>");
 MODULE_DESCRIPTION("3Com 3c515 Corkscrew driver");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);

 /* "Knobs" for adjusting internal parameters. */
 /* Put out somewhat more debugging messages. (0 - no msg, 1 minimal msgs). */
@@ -1540,7 +1539,6 @@ static void netdev_get_drvinfo(struct net_device *dev,
 			       struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	snprintf(info->bus_info, sizeof(info->bus_info), "ISA 0x%lx",
 		 dev->base_addr);
 }
diff --git a/drivers/net/ethernet/3com/3c589_cs.c b/drivers/net/ethernet/3com/3c589_cs.c
index d47cde6c5f08..09816e84314d 100644
--- a/drivers/net/ethernet/3com/3c589_cs.c
+++ b/drivers/net/ethernet/3com/3c589_cs.c
@@ -23,7 +23,6 @@
 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

 #define DRV_NAME	"3c589_cs"
-#define DRV_VERSION	"1.162-ac"

 #include <linux/module.h>
 #include <linux/kernel.h>
@@ -482,7 +481,6 @@ static void netdev_get_drvinfo(struct net_device *dev,
 			       struct ethtool_drvinfo *info)
 {
 	strlcpy(info->driver, DRV_NAME, sizeof(info->driver));
-	strlcpy(info->version, DRV_VERSION, sizeof(info->version));
 	snprintf(info->bus_info, sizeof(info->bus_info),
 		"PCMCIA 0x%lx", dev->base_addr);
 }
diff --git a/drivers/net/ethernet/3com/typhoon.c b/drivers/net/ethernet/3com/typhoon.c
index 14fce6658106..4383ee615793 100644
--- a/drivers/net/ethernet/3com/typhoon.c
+++ b/drivers/net/ethernet/3com/typhoon.c
@@ -127,7 +127,6 @@ static const int multicast_filter_limit = 32;
 #include "typhoon.h"

 MODULE_AUTHOR("David Dillow <dave@thedillows.org>");
-MODULE_VERSION("1.0");
 MODULE_LICENSE("GPL");
 MODULE_FIRMWARE(FIRMWARE_NAME);
 MODULE_DESCRIPTION("3Com Typhoon Family (3C990, 3CR990, and variants)");
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 14/16] net/aquantia: Delete module version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

There is no need to keep module and driver versions in in-tree
kernel code.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/aquantia/atlantic/aq_cfg.h     |  4 ----
 drivers/net/ethernet/aquantia/atlantic/aq_common.h  |  1 -
 drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c |  1 -
 drivers/net/ethernet/aquantia/atlantic/aq_main.c    |  1 -
 drivers/net/ethernet/aquantia/atlantic/ver.h        | 12 ------------
 5 files changed, 19 deletions(-)
 delete mode 100644 drivers/net/ethernet/aquantia/atlantic/ver.h

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h
index f0c41f7408e5..7560f5506e55 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_cfg.h
@@ -9,8 +9,6 @@
 #ifndef AQ_CFG_H
 #define AQ_CFG_H

-#include <generated/utsrelease.h>
-
 #define AQ_CFG_VECS_DEF   8U
 #define AQ_CFG_TCS_DEF    1U

@@ -85,7 +83,5 @@
 #define AQ_CFG_DRV_AUTHOR      "aQuantia"
 #define AQ_CFG_DRV_DESC        "aQuantia Corporation(R) Network Driver"
 #define AQ_CFG_DRV_NAME        "atlantic"
-#define AQ_CFG_DRV_VERSION	UTS_RELEASE \
-				AQ_CFG_DRV_VERSION_SUFFIX

 #endif /* AQ_CFG_H */
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_common.h b/drivers/net/ethernet/aquantia/atlantic/aq_common.h
index 42ea8d8daa46..c8c402b013bb 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_common.h
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_common.h
@@ -12,7 +12,6 @@
 #include <linux/etherdevice.h>
 #include <linux/pci.h>
 #include <linux/if_vlan.h>
-#include "ver.h"
 #include "aq_cfg.h"
 #include "aq_utils.h"

diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
index a1f99bef4a68..5d043ea52551 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_ethtool.c
@@ -132,7 +132,6 @@ static void aq_ethtool_get_drvinfo(struct net_device *ndev,
 	regs_count = aq_nic_get_regs_count(aq_nic);

 	strlcat(drvinfo->driver, AQ_CFG_DRV_NAME, sizeof(drvinfo->driver));
-	strlcat(drvinfo->version, AQ_CFG_DRV_VERSION, sizeof(drvinfo->version));

 	snprintf(drvinfo->fw_version, sizeof(drvinfo->fw_version),
 		 "%u.%u.%u", firmware_version >> 24,
diff --git a/drivers/net/ethernet/aquantia/atlantic/aq_main.c b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
index 538f460a3da7..9fcab646cbd5 100644
--- a/drivers/net/ethernet/aquantia/atlantic/aq_main.c
+++ b/drivers/net/ethernet/aquantia/atlantic/aq_main.c
@@ -19,7 +19,6 @@
 #include <linux/udp.h>

 MODULE_LICENSE("GPL v2");
-MODULE_VERSION(AQ_CFG_DRV_VERSION);
 MODULE_AUTHOR(AQ_CFG_DRV_AUTHOR);
 MODULE_DESCRIPTION(AQ_CFG_DRV_DESC);

diff --git a/drivers/net/ethernet/aquantia/atlantic/ver.h b/drivers/net/ethernet/aquantia/atlantic/ver.h
deleted file mode 100644
index 597654b51e01..000000000000
--- a/drivers/net/ethernet/aquantia/atlantic/ver.h
+++ /dev/null
@@ -1,12 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * aQuantia Corporation Network Driver
- * Copyright (C) 2014-2017 aQuantia Corporation. All rights reserved
- */
-
-#ifndef VER_H
-#define VER_H
-
-#define AQ_CFG_DRV_VERSION_SUFFIX "-kern"
-
-#endif /* VER_H */
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 15/16] net/arc: Delete driver version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Drop constant driver version in favour of global linux kernel.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/arc/emac.h          | 1 -
 drivers/net/ethernet/arc/emac_arc.c      | 2 --
 drivers/net/ethernet/arc/emac_main.c     | 1 -
 drivers/net/ethernet/arc/emac_rockchip.c | 2 --
 4 files changed, 6 deletions(-)

diff --git a/drivers/net/ethernet/arc/emac.h b/drivers/net/ethernet/arc/emac.h
index d9efbc8d783b..d820ae03a966 100644
--- a/drivers/net/ethernet/arc/emac.h
+++ b/drivers/net/ethernet/arc/emac.h
@@ -130,7 +130,6 @@ struct arc_emac_mdio_bus_data {
  */
 struct arc_emac_priv {
 	const char *drv_name;
-	const char *drv_version;
 	void (*set_mac_speed)(void *priv, unsigned int speed);

 	/* Devices */
diff --git a/drivers/net/ethernet/arc/emac_arc.c b/drivers/net/ethernet/arc/emac_arc.c
index 539166112993..1c7736b7eaf7 100644
--- a/drivers/net/ethernet/arc/emac_arc.c
+++ b/drivers/net/ethernet/arc/emac_arc.c
@@ -15,7 +15,6 @@
 #include "emac.h"

 #define DRV_NAME    "emac_arc"
-#define DRV_VERSION "1.0"

 static int emac_arc_probe(struct platform_device *pdev)
 {
@@ -36,7 +35,6 @@ static int emac_arc_probe(struct platform_device *pdev)

 	priv = netdev_priv(ndev);
 	priv->drv_name = DRV_NAME;
-	priv->drv_version = DRV_VERSION;

 	err = of_get_phy_mode(dev->of_node, &interface);
 	if (err) {
diff --git a/drivers/net/ethernet/arc/emac_main.c b/drivers/net/ethernet/arc/emac_main.c
index 17bda4e8cc45..38cd968b6a3b 100644
--- a/drivers/net/ethernet/arc/emac_main.c
+++ b/drivers/net/ethernet/arc/emac_main.c
@@ -92,7 +92,6 @@ static void arc_emac_get_drvinfo(struct net_device *ndev,
 	struct arc_emac_priv *priv = netdev_priv(ndev);

 	strlcpy(info->driver, priv->drv_name, sizeof(info->driver));
-	strlcpy(info->version, priv->drv_version, sizeof(info->version));
 }

 static const struct ethtool_ops arc_emac_ethtool_ops = {
diff --git a/drivers/net/ethernet/arc/emac_rockchip.c b/drivers/net/ethernet/arc/emac_rockchip.c
index aae231c5224f..48ecdf15eddc 100644
--- a/drivers/net/ethernet/arc/emac_rockchip.c
+++ b/drivers/net/ethernet/arc/emac_rockchip.c
@@ -16,7 +16,6 @@
 #include "emac.h"

 #define DRV_NAME        "rockchip_emac"
-#define DRV_VERSION     "1.1"

 struct emac_rockchip_soc_data {
 	unsigned int grf_offset;
@@ -112,7 +111,6 @@ static int emac_rockchip_probe(struct platform_device *pdev)

 	priv = netdev_priv(ndev);
 	priv->emac.drv_name = DRV_NAME;
-	priv->emac.drv_version = DRV_VERSION;
 	priv->emac.set_mac_speed = emac_rockchip_set_mac_speed;

 	err = of_get_phy_mode(dev->of_node, &interface);
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 16/16] net/atheros: Clean atheros code from driver version
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Use linux kernel version for ethtool and module versions.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/atheros/atl1c/atl1c.h         |  1 -
 drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c |  2 --
 drivers/net/ethernet/atheros/atl1c/atl1c_main.c    |  5 -----
 drivers/net/ethernet/atheros/atl1e/atl1e.h         |  1 -
 drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c |  2 --
 drivers/net/ethernet/atheros/atl1e/atl1e_main.c    |  4 ----
 drivers/net/ethernet/atheros/atlx/atl1.c           |  6 ------
 drivers/net/ethernet/atheros/atlx/atl2.c           | 10 ----------
 8 files changed, 31 deletions(-)

diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c.h b/drivers/net/ethernet/atheros/atl1c/atl1c.h
index 60b2febd7315..a0562a90fb6d 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c.h
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c.h
@@ -583,7 +583,6 @@ struct atl1c_adapter {
 		readl(((a)->hw_addr + reg) + ((offset) << 2)))

 extern char atl1c_driver_name[];
-extern char atl1c_driver_version[];

 void atl1c_reinit_locked(struct atl1c_adapter *adapter);
 s32 atl1c_reset_hw(struct atl1c_hw *hw);
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c b/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c
index b5a70a36fa04..e2eb7b8c63a0 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_ethtool.c
@@ -221,8 +221,6 @@ static void atl1c_get_drvinfo(struct net_device *netdev,
 	struct atl1c_adapter *adapter = netdev_priv(netdev);

 	strlcpy(drvinfo->driver,  atl1c_driver_name, sizeof(drvinfo->driver));
-	strlcpy(drvinfo->version, atl1c_driver_version,
-		sizeof(drvinfo->version));
 	strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
 		sizeof(drvinfo->bus_info));
 }
diff --git a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
index 0d67b951c0b2..00bd7bd55794 100644
--- a/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
+++ b/drivers/net/ethernet/atheros/atl1c/atl1c_main.c
@@ -8,9 +8,7 @@

 #include "atl1c.h"

-#define ATL1C_DRV_VERSION "1.0.1.1-NAPI"
 char atl1c_driver_name[] = "atl1c";
-char atl1c_driver_version[] = ATL1C_DRV_VERSION;

 /*
  * atl1c_pci_tbl - PCI Device ID Table
@@ -37,7 +35,6 @@ MODULE_AUTHOR("Jie Yang");
 MODULE_AUTHOR("Qualcomm Atheros Inc., <nic-devel@qualcomm.com>");
 MODULE_DESCRIPTION("Qualcomm Atheros 100/1000M Ethernet Network Driver");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(ATL1C_DRV_VERSION);

 static int atl1c_stop_mac(struct atl1c_hw *hw);
 static void atl1c_disable_l0s_l1(struct atl1c_hw *hw);
@@ -2642,8 +2639,6 @@ static int atl1c_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 		goto err_register;
 	}

-	if (netif_msg_probe(adapter))
-		dev_info(&pdev->dev, "version %s\n", ATL1C_DRV_VERSION);
 	cards_found++;
 	return 0;

diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e.h b/drivers/net/ethernet/atheros/atl1e/atl1e.h
index e9893da50995..9fcad783c939 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e.h
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e.h
@@ -482,7 +482,6 @@ struct atl1e_adapter {
 		readl(((a)->hw_addr + reg) + ((offset) << 2)))

 extern char atl1e_driver_name[];
-extern char atl1e_driver_version[];

 void atl1e_check_options(struct atl1e_adapter *adapter);
 int atl1e_up(struct atl1e_adapter *adapter);
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c b/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c
index c6b9e7ea8e38..0cbde352d1ba 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_ethtool.c
@@ -307,8 +307,6 @@ static void atl1e_get_drvinfo(struct net_device *netdev,
 	struct atl1e_adapter *adapter = netdev_priv(netdev);

 	strlcpy(drvinfo->driver,  atl1e_driver_name, sizeof(drvinfo->driver));
-	strlcpy(drvinfo->version, atl1e_driver_version,
-		sizeof(drvinfo->version));
 	strlcpy(drvinfo->fw_version, "L1e", sizeof(drvinfo->fw_version));
 	strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
 		sizeof(drvinfo->bus_info));
diff --git a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
index e0d89942d537..223ef846123e 100644
--- a/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
+++ b/drivers/net/ethernet/atheros/atl1e/atl1e_main.c
@@ -8,10 +8,7 @@

 #include "atl1e.h"

-#define DRV_VERSION "1.0.0.7-NAPI"
-
 char atl1e_driver_name[] = "ATL1E";
-char atl1e_driver_version[] = DRV_VERSION;
 #define PCI_DEVICE_ID_ATTANSIC_L1E      0x1026
 /*
  * atl1e_pci_tbl - PCI Device ID Table
@@ -33,7 +30,6 @@ MODULE_DEVICE_TABLE(pci, atl1e_pci_tbl);
 MODULE_AUTHOR("Atheros Corporation, <xiong.huang@atheros.com>, Jie Yang <jie.yang@atheros.com>");
 MODULE_DESCRIPTION("Atheros 1000M Ethernet Network Driver");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(DRV_VERSION);

 static void atl1e_setup_mac_ctrl(struct atl1e_adapter *adapter);

diff --git a/drivers/net/ethernet/atheros/atlx/atl1.c b/drivers/net/ethernet/atheros/atlx/atl1.c
index b498fd6a47d0..271e7034fa70 100644
--- a/drivers/net/ethernet/atheros/atlx/atl1.c
+++ b/drivers/net/ethernet/atheros/atlx/atl1.c
@@ -65,12 +65,10 @@

 #include "atl1.h"

-#define ATLX_DRIVER_VERSION "2.1.3"
 MODULE_AUTHOR("Xiong Huang <xiong.huang@atheros.com>, "
 	      "Chris Snook <csnook@redhat.com>, "
 	      "Jay Cliburn <jcliburn@gmail.com>");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(ATLX_DRIVER_VERSION);

 /* Temporary hack for merging atl1 and atl2 */
 #include "atlx.c"
@@ -2965,8 +2963,6 @@ static int atl1_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
 	/* get device revision number */
 	adapter->hw.dev_rev = ioread16(adapter->hw.hw_addr +
 		(REG_MASTER_CTRL + 2));
-	if (netif_msg_probe(adapter))
-		dev_info(&pdev->dev, "version %s\n", ATLX_DRIVER_VERSION);

 	/* set default ring resource counts */
 	adapter->rfd_ring.count = adapter->rrd_ring.count = ATL1_DEFAULT_RFD;
@@ -3344,8 +3340,6 @@ static void atl1_get_drvinfo(struct net_device *netdev,
 	struct atl1_adapter *adapter = netdev_priv(netdev);

 	strlcpy(drvinfo->driver, ATLX_DRIVER_NAME, sizeof(drvinfo->driver));
-	strlcpy(drvinfo->version, ATLX_DRIVER_VERSION,
-		sizeof(drvinfo->version));
 	strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
 		sizeof(drvinfo->bus_info));
 }
diff --git a/drivers/net/ethernet/atheros/atlx/atl2.c b/drivers/net/ethernet/atheros/atlx/atl2.c
index b81a4e0c5b57..7c52b92b599d 100644
--- a/drivers/net/ethernet/atheros/atlx/atl2.c
+++ b/drivers/net/ethernet/atheros/atlx/atl2.c
@@ -36,18 +36,13 @@

 #include "atl2.h"

-#define ATL2_DRV_VERSION "2.2.3"
-
 static const char atl2_driver_name[] = "atl2";
 static const char atl2_driver_string[] = "Atheros(R) L2 Ethernet Driver";
-static const char atl2_copyright[] = "Copyright (c) 2007 Atheros Corporation.";
-static const char atl2_driver_version[] = ATL2_DRV_VERSION;
 static const struct ethtool_ops atl2_ethtool_ops;

 MODULE_AUTHOR("Atheros Corporation <xiong.huang@atheros.com>, Chris Snook <csnook@redhat.com>");
 MODULE_DESCRIPTION("Atheros Fast Ethernet Network Driver");
 MODULE_LICENSE("GPL");
-MODULE_VERSION(ATL2_DRV_VERSION);

 /*
  * atl2_pci_tbl - PCI Device ID Table
@@ -1688,9 +1683,6 @@ static struct pci_driver atl2_driver = {
  */
 static int __init atl2_init_module(void)
 {
-	printk(KERN_INFO "%s - version %s\n", atl2_driver_string,
-		atl2_driver_version);
-	printk(KERN_INFO "%s\n", atl2_copyright);
 	return pci_register_driver(&atl2_driver);
 }
 module_init(atl2_init_module);
@@ -2011,8 +2003,6 @@ static void atl2_get_drvinfo(struct net_device *netdev,
 	struct atl2_adapter *adapter = netdev_priv(netdev);

 	strlcpy(drvinfo->driver,  atl2_driver_name, sizeof(drvinfo->driver));
-	strlcpy(drvinfo->version, atl2_driver_version,
-		sizeof(drvinfo->version));
 	strlcpy(drvinfo->fw_version, "L2", sizeof(drvinfo->fw_version));
 	strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
 		sizeof(drvinfo->bus_info));
--
2.24.1


^ permalink raw reply related

* [PATCH net-next 13/16] net/apm: Remove useless driver version and properly mark lack of FW
From: Leon Romanovsky @ 2020-02-20 14:58 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: Leon Romanovsky, linux-netdev
In-Reply-To: <20200220145855.255704-1-leon@kernel.org>

From: Leon Romanovsky <leonro@mellanox.com>

Delete module version in favor of global and unique linux kernel.

Signed-off-by: Leon Romanovsky <leonro@mellanox.com>
---
 drivers/net/ethernet/apm/xgene-v2/ethtool.c         | 2 --
 drivers/net/ethernet/apm/xgene-v2/main.c            | 1 -
 drivers/net/ethernet/apm/xgene-v2/main.h            | 1 -
 drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c | 2 --
 drivers/net/ethernet/apm/xgene/xgene_enet_main.c    | 1 -
 drivers/net/ethernet/apm/xgene/xgene_enet_main.h    | 1 -
 6 files changed, 8 deletions(-)

diff --git a/drivers/net/ethernet/apm/xgene-v2/ethtool.c b/drivers/net/ethernet/apm/xgene-v2/ethtool.c
index a58250c1b57a..b78d1a99fe81 100644
--- a/drivers/net/ethernet/apm/xgene-v2/ethtool.c
+++ b/drivers/net/ethernet/apm/xgene-v2/ethtool.c
@@ -89,8 +89,6 @@ static void xge_get_drvinfo(struct net_device *ndev,
 	struct platform_device *pdev = pdata->pdev;

 	strcpy(info->driver, "xgene-enet-v2");
-	strcpy(info->version, XGENE_ENET_V2_VERSION);
-	snprintf(info->fw_version, ETHTOOL_FWVERS_LEN, "N/A");
 	sprintf(info->bus_info, "%s", pdev->name);
 }

diff --git a/drivers/net/ethernet/apm/xgene-v2/main.c b/drivers/net/ethernet/apm/xgene-v2/main.c
index c48f60996761..860c18fb7aae 100644
--- a/drivers/net/ethernet/apm/xgene-v2/main.c
+++ b/drivers/net/ethernet/apm/xgene-v2/main.c
@@ -741,5 +741,4 @@ module_platform_driver(xge_driver);

 MODULE_DESCRIPTION("APM X-Gene SoC Ethernet v2 driver");
 MODULE_AUTHOR("Iyappan Subramanian <isubramanian@apm.com>");
-MODULE_VERSION(XGENE_ENET_V2_VERSION);
 MODULE_LICENSE("GPL");
diff --git a/drivers/net/ethernet/apm/xgene-v2/main.h b/drivers/net/ethernet/apm/xgene-v2/main.h
index d41439d2709d..b3985a7be59d 100644
--- a/drivers/net/ethernet/apm/xgene-v2/main.h
+++ b/drivers/net/ethernet/apm/xgene-v2/main.h
@@ -28,7 +28,6 @@
 #include "ring.h"
 #include "ethtool.h"

-#define XGENE_ENET_V2_VERSION	"v1.0"
 #define XGENE_ENET_STD_MTU	1536
 #define XGENE_ENET_MIN_FRAME	60
 #define IRQ_ID_SIZE             16
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
index 246dec27140d..ada70425b48c 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_ethtool.c
@@ -103,8 +103,6 @@ static void xgene_get_drvinfo(struct net_device *ndev,
 	struct platform_device *pdev = pdata->pdev;

 	strcpy(info->driver, "xgene_enet");
-	strcpy(info->version, XGENE_DRV_VERSION);
-	snprintf(info->fw_version, ETHTOOL_FWVERS_LEN, "N/A");
 	sprintf(info->bus_info, "%s", pdev->name);
 }

diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
index 6aee2f0fc0db..5f1fc6582d74 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.c
@@ -2179,7 +2179,6 @@ static struct platform_driver xgene_enet_driver = {
 module_platform_driver(xgene_enet_driver);

 MODULE_DESCRIPTION("APM X-Gene SoC Ethernet driver");
-MODULE_VERSION(XGENE_DRV_VERSION);
 MODULE_AUTHOR("Iyappan Subramanian <isubramanian@apm.com>");
 MODULE_AUTHOR("Keyur Chudgar <kchudgar@apm.com>");
 MODULE_LICENSE("GPL");
diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
index 18f4923b1723..d35a338120cf 100644
--- a/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
+++ b/drivers/net/ethernet/apm/xgene/xgene_enet_main.h
@@ -28,7 +28,6 @@
 #include "xgene_enet_ring2.h"
 #include "../../../phy/mdio-xgene.h"

-#define XGENE_DRV_VERSION	"v1.0"
 #define ETHER_MIN_PACKET	64
 #define ETHER_STD_PACKET	1518
 #define XGENE_ENET_STD_MTU	1536
--
2.24.1


^ permalink raw reply related

* [zeus][PATCH 0/3] Make lcov work with gcc-9 (backport)
From: Viktor Rosendahl @ 2020-02-20 14:59 UTC (permalink / raw)
  To: openembedded-devel

Hi all,

These are the patches that makes lcov work with gcc-9 that were merged into
master recently. The commits in master are:

416c4f7d5 perl: Add libperlio-gzip-perl and libjson-perl
64441dc46 lcov: Add support for intermediate JSON format
7002e7dd3 lcov: Add missing missing RDEPEND and enable nativesdk

They have the same content as the ones in master, except
that the third patch adds one additional missing RDEPEND, which was alreay
fixed in master.

best regards,

Viktor

Viktor Rosendahl (3):
  perl: Add libperlio-gzip-perl and libjson-perl
  lcov: Add support for intermediate JSON format
  lcov: Add missing missing RDEPEND and enable nativesdk

 .../perl/libjson-perl_4.02000.bb              |  22 +
 .../perl/libperlio-gzip-perl_0.20.bb          |  30 +
 ...Add-intermediate-text-format-support.patch | 898 ++++++++++++++++++
 ...Add-intermediate-JSON-format-support.patch | 247 +++++
 meta-oe/recipes-support/lcov/lcov_1.14.bb     |  12 +-
 5 files changed, 1208 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-devtools/perl/libjson-perl_4.02000.bb
 create mode 100644 meta-oe/recipes-devtools/perl/libperlio-gzip-perl_0.20.bb
 create mode 100644 meta-oe/recipes-support/lcov/files/0001-geninfo-Add-intermediate-text-format-support.patch
 create mode 100644 meta-oe/recipes-support/lcov/files/0002-geninfo-Add-intermediate-JSON-format-support.patch

-- 
2.17.1



^ permalink raw reply

* Re: [PATCH] selftest/lkdtm: Don't pollute 'git status'
From: Christophe Leroy @ 2020-02-20 14:58 UTC (permalink / raw)
  To: Kees Cook, Shuah Khan; +Cc: linux-mm, linuxppc-dev, linux-kernel
In-Reply-To: <668b6ff463849ceee01f726fbf3e7110687575ec.1580976576.git.christophe.leroy@c-s.fr>

ping

On 02/06/2020 08:11 AM, Christophe Leroy wrote:
> Commit 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets")
> added generation of lkdtm test scripts.
> 
> Ignore those generated scripts when performing 'git status'
> 
> Fixes: 46d1a0f03d66 ("selftests/lkdtm: Add tests for LKDTM targets")
> Signed-off-by: Christophe Leroy <christophe.leroy@c-s.fr>

Without this, 'git status' now reports the following crap and real 
problems are drowned in the middle, that's annoying.

On branch saf3000-5.6
Untracked files:
   (use "git add <file>..." to include in what will be committed)
	tools/testing/selftests/lkdtm/ACCESS_NULL.sh
	tools/testing/selftests/lkdtm/ACCESS_USERSPACE.sh
	tools/testing/selftests/lkdtm/ATOMIC_TIMING.sh
	tools/testing/selftests/lkdtm/BUG.sh
	tools/testing/selftests/lkdtm/CFI_FORWARD_PROTO.sh
	tools/testing/selftests/lkdtm/CORRUPT_LIST_ADD.sh
	tools/testing/selftests/lkdtm/CORRUPT_LIST_DEL.sh
	tools/testing/selftests/lkdtm/CORRUPT_STACK.sh
	tools/testing/selftests/lkdtm/CORRUPT_STACK_STRONG.sh
	tools/testing/selftests/lkdtm/CORRUPT_USER_DS.sh
	tools/testing/selftests/lkdtm/DOUBLE_FAULT.sh
	tools/testing/selftests/lkdtm/EXCEPTION.sh
	tools/testing/selftests/lkdtm/EXEC_DATA.sh
	tools/testing/selftests/lkdtm/EXEC_KMALLOC.sh
	tools/testing/selftests/lkdtm/EXEC_NULL.sh
	tools/testing/selftests/lkdtm/EXEC_RODATA.sh
	tools/testing/selftests/lkdtm/EXEC_STACK.sh
	tools/testing/selftests/lkdtm/EXEC_USERSPACE.sh
	tools/testing/selftests/lkdtm/EXEC_VMALLOC.sh
	tools/testing/selftests/lkdtm/EXHAUST_STACK.sh
	tools/testing/selftests/lkdtm/HARDLOCKUP.sh
	tools/testing/selftests/lkdtm/HUNG_TASK.sh
	tools/testing/selftests/lkdtm/LOOP.sh
	tools/testing/selftests/lkdtm/OVERWRITE_ALLOCATION.sh
	tools/testing/selftests/lkdtm/PANIC.sh
	tools/testing/selftests/lkdtm/READ_AFTER_FREE.sh
	tools/testing/selftests/lkdtm/READ_BUDDY_AFTER_FREE.sh
	tools/testing/selftests/lkdtm/REFCOUNT_ADD_NOT_ZERO_OVERFLOW.sh
	tools/testing/selftests/lkdtm/REFCOUNT_ADD_NOT_ZERO_SATURATED.sh
	tools/testing/selftests/lkdtm/REFCOUNT_ADD_OVERFLOW.sh
	tools/testing/selftests/lkdtm/REFCOUNT_ADD_SATURATED.sh
	tools/testing/selftests/lkdtm/REFCOUNT_ADD_ZERO.sh
	tools/testing/selftests/lkdtm/REFCOUNT_DEC_AND_TEST_NEGATIVE.sh
	tools/testing/selftests/lkdtm/REFCOUNT_DEC_AND_TEST_SATURATED.sh
	tools/testing/selftests/lkdtm/REFCOUNT_DEC_NEGATIVE.sh
	tools/testing/selftests/lkdtm/REFCOUNT_DEC_SATURATED.sh
	tools/testing/selftests/lkdtm/REFCOUNT_DEC_ZERO.sh
	tools/testing/selftests/lkdtm/REFCOUNT_INC_NOT_ZERO_OVERFLOW.sh
	tools/testing/selftests/lkdtm/REFCOUNT_INC_NOT_ZERO_SATURATED.sh
	tools/testing/selftests/lkdtm/REFCOUNT_INC_OVERFLOW.sh
	tools/testing/selftests/lkdtm/REFCOUNT_INC_SATURATED.sh
	tools/testing/selftests/lkdtm/REFCOUNT_INC_ZERO.sh
	tools/testing/selftests/lkdtm/REFCOUNT_SUB_AND_TEST_NEGATIVE.sh
	tools/testing/selftests/lkdtm/REFCOUNT_SUB_AND_TEST_SATURATED.sh
	tools/testing/selftests/lkdtm/REFCOUNT_TIMING.sh
	tools/testing/selftests/lkdtm/SLAB_FREE_CROSS.sh
	tools/testing/selftests/lkdtm/SLAB_FREE_DOUBLE.sh
	tools/testing/selftests/lkdtm/SLAB_FREE_PAGE.sh
	tools/testing/selftests/lkdtm/SOFTLOCKUP.sh
	tools/testing/selftests/lkdtm/SPINLOCKUP.sh
	tools/testing/selftests/lkdtm/STACKLEAK_ERASING.sh
	tools/testing/selftests/lkdtm/STACK_GUARD_PAGE_LEADING.sh
	tools/testing/selftests/lkdtm/STACK_GUARD_PAGE_TRAILING.sh
	tools/testing/selftests/lkdtm/UNALIGNED_LOAD_STORE_WRITE.sh
	tools/testing/selftests/lkdtm/UNSET_SMEP.sh
	tools/testing/selftests/lkdtm/USERCOPY_HEAP_SIZE_FROM.sh
	tools/testing/selftests/lkdtm/USERCOPY_HEAP_SIZE_TO.sh
	tools/testing/selftests/lkdtm/USERCOPY_HEAP_WHITELIST_FROM.sh
	tools/testing/selftests/lkdtm/USERCOPY_HEAP_WHITELIST_TO.sh
	tools/testing/selftests/lkdtm/USERCOPY_KERNEL.sh
	tools/testing/selftests/lkdtm/USERCOPY_KERNEL_DS.sh
	tools/testing/selftests/lkdtm/USERCOPY_STACK_BEYOND.sh
	tools/testing/selftests/lkdtm/USERCOPY_STACK_FRAME_FROM.sh
	tools/testing/selftests/lkdtm/USERCOPY_STACK_FRAME_TO.sh
	tools/testing/selftests/lkdtm/WARNING.sh
	tools/testing/selftests/lkdtm/WARNING_MESSAGE.sh
	tools/testing/selftests/lkdtm/WRITE_AFTER_FREE.sh
	tools/testing/selftests/lkdtm/WRITE_BUDDY_AFTER_FREE.sh
	tools/testing/selftests/lkdtm/WRITE_KERN.sh
	tools/testing/selftests/lkdtm/WRITE_RO.sh
	tools/testing/selftests/lkdtm/WRITE_RO_AFTER_INIT.sh

nothing added to commit but untracked files present (use "git add" to track)


Thanks
Christophe


> ---
>   .gitignore | 4 ++++
>   1 file changed, 4 insertions(+)
> 
> diff --git a/.gitignore b/.gitignore
> index b849a72d69d5..bb05dce58f8e 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -100,6 +100,10 @@ modules.order
>   /include/ksym/
>   /arch/*/include/generated/
>   
> +# Generated lkdtm tests
> +/tools/testing/selftests/lkdtm/*.sh
> +!/tools/testing/selftests/lkdtm/run.sh
> +
>   # stgit generated dirs
>   patches-*
>   
> 

^ permalink raw reply

* [zeus][PATCH 1/3] perl: Add libperlio-gzip-perl and libjson-perl
From: Viktor Rosendahl @ 2020-02-20 14:59 UTC (permalink / raw)
  To: openembedded-devel
In-Reply-To: <20200220145958.38718-1-viktor.rosendahl@bmw.de>

From: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>

We need to add these perl modules in order to make lcov compatible
with gcc9.

Signed-off-by: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
---
 .../perl/libjson-perl_4.02000.bb              | 22 ++++++++++++++
 .../perl/libperlio-gzip-perl_0.20.bb          | 30 +++++++++++++++++++
 2 files changed, 52 insertions(+)
 create mode 100644 meta-oe/recipes-devtools/perl/libjson-perl_4.02000.bb
 create mode 100644 meta-oe/recipes-devtools/perl/libperlio-gzip-perl_0.20.bb

diff --git a/meta-oe/recipes-devtools/perl/libjson-perl_4.02000.bb b/meta-oe/recipes-devtools/perl/libjson-perl_4.02000.bb
new file mode 100644
index 000000000..4e5a8a6ff
--- /dev/null
+++ b/meta-oe/recipes-devtools/perl/libjson-perl_4.02000.bb
@@ -0,0 +1,22 @@
+SUMMARY = "Perl module to decode/encode json files"
+DESCRIPTION = "This package contains the JSON.pm module with friends. \
+The module implements JSON encode/decode."
+
+HOMEPAGE = "https://metacpan.org/pod/JSON"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=1171;endline=1176;md5=3be2cb8159d094768e67386c453e8bbe"
+
+DEPENDS += "perl"
+
+SRC_URI = "git://github.com/makamaka/JSON.git;protocol=https"
+
+SRCREV = "42a6324df654e92419512cee80c0b49155d9e56d"
+
+S = "${WORKDIR}/git"
+
+inherit cpan
+
+RDEPENDS_${PN} += "perl"
+
+BBCLASSEXTEND = "native nativesdk"
diff --git a/meta-oe/recipes-devtools/perl/libperlio-gzip-perl_0.20.bb b/meta-oe/recipes-devtools/perl/libperlio-gzip-perl_0.20.bb
new file mode 100644
index 000000000..ffe7a7d99
--- /dev/null
+++ b/meta-oe/recipes-devtools/perl/libperlio-gzip-perl_0.20.bb
@@ -0,0 +1,30 @@
+SUMMARY = "Perl module to manipulate and access gzip files"
+DESCRIPTION = "This package contains the gzip.pm module with friends. \
+The module implements perlio layer for gzip."
+
+HOMEPAGE = "https://metacpan.org/pod/PerlIO::gzip"
+SECTION = "libs"
+LICENSE = "Artistic-1.0 | GPL-1.0+"
+LIC_FILES_CHKSUM = "file://README;beginline=55;endline=61;md5=bc3da2dec1fbea59ac91172c5e0eb837"
+
+DEPENDS += "perl"
+
+SRC_URI = "https://cpan.metacpan.org/authors/id/N/NW/NWCLARK/PerlIO-gzip-${PV}.tar.gz"
+
+SRC_URI[md5sum] = "0393eae5d0b23df6cf40ed44af7d711c"
+SRC_URI[sha256sum] = "4848679a3f201e3f3b0c5f6f9526e602af52923ffa471a2a3657db786bd3bdc5"
+
+S = "${WORKDIR}/PerlIO-gzip-${PV}"
+
+EXTRA_CPANFLAGS = "EXPATLIBPATH=${STAGING_LIBDIR} EXPATINCPATH=${STAGING_INCDIR}"
+
+inherit cpan
+
+do_compile() {
+	export LIBC="$(find ${STAGING_DIR_TARGET}/${base_libdir}/ -name 'libc-*.so')"
+	cpan_do_compile
+}
+
+RDEPENDS_${PN} += "perl perl-module-perlio"
+
+BBCLASSEXTEND = "native nativesdk"
-- 
2.17.1



^ permalink raw reply related

* [zeus][PATCH 3/3] lcov: Add missing missing RDEPEND and enable nativesdk
From: Viktor Rosendahl @ 2020-02-20 14:59 UTC (permalink / raw)
  To: openembedded-devel
In-Reply-To: <20200220145958.38718-1-viktor.rosendahl@bmw.de>

From: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>

It seems like geninfo is depending on perl-module-digest-md5 and
gcov-symlinks, so they should be added here. Also, lcov is useful in SDKs,
so let's enable the building of native and nativesdk packages.

Signed-off-by: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
---
 meta-oe/recipes-support/lcov/lcov_1.14.bb | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/meta-oe/recipes-support/lcov/lcov_1.14.bb b/meta-oe/recipes-support/lcov/lcov_1.14.bb
index ac0505829..14718184b 100755
--- a/meta-oe/recipes-support/lcov/lcov_1.14.bb
+++ b/meta-oe/recipes-support/lcov/lcov_1.14.bb
@@ -10,11 +10,13 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
 RDEPENDS_${PN} += " \
     gcov \
+    gcov-symlinks \
     libjson-perl \
     libperlio-gzip-perl \
     perl \
     perl-module-filehandle \
     perl-module-getopt-std \
+    perl-module-digest-md5 \
     perl-module-digest-sha \
     perl-module-constant \
     perl-module-cwd \
@@ -57,3 +59,4 @@ do_install() {
     oe_runmake install PREFIX=${D}${prefix} CFG_DIR=${D}${sysconfdir}
 }
 
+BBCLASSEXTEND = "native nativesdk"
-- 
2.17.1



^ permalink raw reply related

* [zeus][PATCH 2/3] lcov: Add support for intermediate JSON format
From: Viktor Rosendahl @ 2020-02-20 14:59 UTC (permalink / raw)
  To: openembedded-devel
In-Reply-To: <20200220145958.38718-1-viktor.rosendahl@bmw.de>

From: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>

gcc-9 uses this intermediate JSON format, so we will need these two patches
to make lcov work again.

Signed-off-by: Viktor Rosendahl <Viktor.Rosendahl@bmw.de>
---
 ...Add-intermediate-text-format-support.patch | 898 ++++++++++++++++++
 ...Add-intermediate-JSON-format-support.patch | 247 +++++
 meta-oe/recipes-support/lcov/lcov_1.14.bb     |   9 +-
 3 files changed, 1153 insertions(+), 1 deletion(-)
 create mode 100644 meta-oe/recipes-support/lcov/files/0001-geninfo-Add-intermediate-text-format-support.patch
 create mode 100644 meta-oe/recipes-support/lcov/files/0002-geninfo-Add-intermediate-JSON-format-support.patch

diff --git a/meta-oe/recipes-support/lcov/files/0001-geninfo-Add-intermediate-text-format-support.patch b/meta-oe/recipes-support/lcov/files/0001-geninfo-Add-intermediate-text-format-support.patch
new file mode 100644
index 000000000..9ac0770f9
--- /dev/null
+++ b/meta-oe/recipes-support/lcov/files/0001-geninfo-Add-intermediate-text-format-support.patch
@@ -0,0 +1,898 @@
+From ec3e1f411c332cbc2f2bc7ab7e2175ebf918b37a Mon Sep 17 00:00:00 2001
+From: Peter Oberparleiter <oberpar@linux.ibm.com>
+Date: Fri, 24 May 2019 16:56:52 +0200
+Subject: [PATCH 1/2] geninfo: Add intermediate text format support
+
+This change adds support for parsing the output of gcov's intermediate
+text file format as implemented by GCC versions 5 to 8.  The use of the
+gcov intermediate format should increase processing speed. It also
+provides branch coverage data when using the --initial command line
+option.
+
+Users can control whether geninfo uses the intermediate format via the
+geninfo_intermediate configuration file option. Valid values are:
+
+     0: Use normal text format
+     1: Use intermediate format
+  auto: Use intermediate format if available. This is the default.
+
+Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
+---
+ bin/geninfo  | 567 ++++++++++++++++++++++++++++++++++++++++++++-------
+ lcovrc       |   3 +
+ man/lcovrc.5 |  24 +++
+ 3 files changed, 521 insertions(+), 73 deletions(-)
+
+Upstream-Status: Backport
+Download URL: https://github.com/linux-test-project/lcov/commit/ebfeb3e179e450c69c3532f98cd5ea1fbf6ccba7
+
+diff --git a/bin/geninfo b/bin/geninfo
+index f41eaec..0276666 100755
+--- a/bin/geninfo
++++ b/bin/geninfo
+@@ -54,6 +54,8 @@ use warnings;
+ use File::Basename; 
+ use File::Spec::Functions qw /abs2rel catdir file_name_is_absolute splitdir
+ 			      splitpath catpath/;
++use File::Temp qw(tempfile tempdir);
++use File::Copy qw(copy);
+ use Getopt::Long;
+ use Digest::MD5 qw(md5_base64);
+ use Cwd qw/abs_path/;
+@@ -163,13 +165,13 @@ sub solve_relative_path($$);
+ sub read_gcov_header($);
+ sub read_gcov_file($);
+ sub info(@);
++sub process_intermediate($$$);
+ sub map_llvm_version($);
+ sub version_to_str($);
+ sub get_gcov_version();
+ sub system_no_output($@);
+ sub read_config($);
+ sub apply_config($);
+-sub get_exclusion_data($);
+ sub apply_exclusion_data($$);
+ sub process_graphfile($$);
+ sub filter_fn_name($);
+@@ -264,6 +266,8 @@ our $gcno_split_crc;
+ our $func_coverage = 1;
+ our $br_coverage = 0;
+ our $rc_auto_base = 1;
++our $rc_intermediate = "auto";
++our $intermediate;
+ our $excl_line = "LCOV_EXCL_LINE";
+ our $excl_br_line = "LCOV_EXCL_BR_LINE";
+ 
+@@ -331,6 +335,7 @@ if ($config || %opt_rc)
+ 		"geninfo_compat"		=> \$opt_compat,
+ 		"geninfo_adjust_src_path"	=> \$rc_adjust_src_path,
+ 		"geninfo_auto_base"		=> \$rc_auto_base,
++		"geninfo_intermediate"		=> \$rc_intermediate,
+ 		"lcov_function_coverage"	=> \$func_coverage,
+ 		"lcov_branch_coverage"		=> \$br_coverage,
+ 		"lcov_excl_line"		=> \$excl_line,
+@@ -460,15 +465,38 @@ if (system_no_output(3, $gcov_tool, "--help") == -1)
+ }
+ 
+ ($gcov_version, $gcov_version_string) = get_gcov_version();
++$gcov_caps = get_gcov_capabilities();
++
++# Determine intermediate mode
++if ($rc_intermediate eq "0") {
++	$intermediate = 0;
++} elsif ($rc_intermediate eq "1") {
++	$intermediate = 1;
++} elsif (lc($rc_intermediate) eq "auto") {
++	# Use intermediate format if supported by gcov
++	$intermediate = $gcov_caps->{'intermediate-format'} ? 1 : 0;
++} else {
++	die("ERROR: invalid value for geninfo_intermediate: ".
++	    "'$rc_intermediate'\n");
++}
++
++if ($intermediate) {
++	info("Using intermediate gcov format\n");
++	if ($opt_derive_func_data) {
++		warn("WARNING: --derive-func-data is not compatible with ".
++		     "intermediate format - ignoring\n");
++		$opt_derive_func_data = 0;
++	}
++}
+ 
+ # Determine gcov options
+-$gcov_caps = get_gcov_capabilities();
+ push(@gcov_options, "-b") if ($gcov_caps->{'branch-probabilities'} &&
+ 			      ($br_coverage || $func_coverage));
+ push(@gcov_options, "-c") if ($gcov_caps->{'branch-counts'} &&
+ 			      $br_coverage);
+ push(@gcov_options, "-a") if ($gcov_caps->{'all-blocks'} &&
+-			      $opt_gcov_all_blocks && $br_coverage);
++			      $opt_gcov_all_blocks && $br_coverage &&
++			      !$intermediate);
+ if ($gcov_caps->{'hash-filenames'})
+ {
+ 	push(@gcov_options, "-x");
+@@ -599,7 +627,7 @@ foreach my $entry (@data_directory) {
+ 	gen_info($entry);
+ }
+ 
+-if ($initial && $br_coverage) {
++if ($initial && $br_coverage && !$intermediate) {
+ 	warn("Note: --initial does not generate branch coverage ".
+ 	     "data\n");
+ }
+@@ -768,6 +796,7 @@ sub gen_info($)
+ 	my $prefix;
+ 	my $type;
+ 	my $ext;
++	my $tempdir;
+ 
+ 	if ($initial) {
+ 		$type = "graph";
+@@ -798,16 +827,22 @@ sub gen_info($)
+ 		$prefix = "";
+ 	}
+ 
++	$tempdir = tempdir(CLEANUP => 1);
++
+ 	# Process all files in list
+ 	foreach $file (@file_list) {
+ 		# Process file
+-		if ($initial) {
++		if ($intermediate) {
++			process_intermediate($file, $prefix, $tempdir);
++		} elsif ($initial) {
+ 			process_graphfile($file, $prefix);
+ 		} else {
+ 			process_dafile($file, $prefix);
+ 		}
+ 	}
+ 
++	unlink($tempdir);
++
+ 	# Report whether files were excluded.
+ 	if (%excluded_files) {
+ 		info("Excluded data for %d files due to include/exclude options\n",
+@@ -1058,10 +1093,12 @@ sub process_dafile($$)
+ 
+ 	# Try to find base directory automatically if requested by user
+ 	if ($rc_auto_base) {
+-		$base_dir = find_base_from_graph($base_dir, $instr, $graph);
++		$base_dir = find_base_from_source($base_dir,
++			[ keys(%{$instr}), keys(%{$graph}) ]);
+ 	}
+ 
+-	($instr, $graph) = adjust_graph_filenames($base_dir, $instr, $graph);
++	adjust_source_filenames($instr, $base_dir);
++	adjust_source_filenames($graph, $base_dir);
+ 
+ 	# Set $object_dir to real location of object files. This may differ
+ 	# from $da_dir if the graph file is just a link to the "real" object
+@@ -2017,6 +2054,299 @@ sub read_gcov_file($)
+ }
+ 
+ 
++#
++# read_intermediate_text(gcov_filename, data)
++#
++# Read gcov intermediate text format in GCOV_FILENAME and add the resulting
++# data to DATA in the following format:
++#
++# data:      source_filename -> file_data
++# file_data: concatenated lines of intermediate text data
++#
++
++sub read_intermediate_text($$)
++{
++	my ($gcov_filename, $data) = @_;
++	my $fd;
++	my $filename;
++
++	open($fd, "<", $gcov_filename) or
++		die("ERROR: Could not read $gcov_filename: $!\n");
++	while (my $line = <$fd>) {
++		if ($line =~ /^file:(.*)$/) {
++			$filename = $1;
++			chomp($filename);
++		} elsif (defined($filename)) {
++			$data->{$filename} .= $line;
++		}
++	}
++	close($fd);
++}
++
++
++#
++# intermediate_text_to_info(fd, data, srcdata)
++#
++# Write DATA in info format to file descriptor FD.
++#
++# data:      filename -> file_data:
++# file_data: concatenated lines of intermediate text data
++#
++# srcdata:   filename -> [ excl, brexcl, checksums ]
++# excl:      lineno -> 1 for all lines for which to exclude all data
++# brexcl:    lineno -> 1 for all lines for which to exclude branch data
++# checksums: lineno -> source code checksum
++#
++# Note: To simplify processing, gcov data is not combined here, that is counts
++#       that appear multiple times for the same lines/branches are not added.
++#       This is done by lcov/genhtml when reading the data files.
++#
++
++sub intermediate_text_to_info($$$)
++{
++	my ($fd, $data, $srcdata) = @_;
++	my $branch_num = 0;
++	my $c;
++
++	return if (!%{$data});
++
++	print($fd "TN:$test_name\n");
++	for my $filename (keys(%{$data})) {
++		my ($excl, $brexcl, $checksums);
++
++		if (defined($srcdata->{$filename})) {
++			($excl, $brexcl, $checksums) = @{$srcdata->{$filename}};
++		}
++
++		print($fd "SF:$filename\n");
++		for my $line (split(/\n/, $data->{$filename})) {
++			if ($line =~ /^lcount:(\d+),(\d+),?/) {
++				# lcount:<line>,<count>
++				# lcount:<line>,<count>,<has_unexecuted_blocks>
++				if ($checksum && exists($checksums->{$1})) {
++					$c = ",".$checksums->{$1};
++				} else {
++					$c = "";
++				}
++				print($fd "DA:$1,$2$c\n") if (!$excl->{$1});
++
++				# Intermediate text format does not provide
++				# branch numbers, and the same branch may appear
++				# multiple times on the same line (e.g. in
++				# template instances). Synthesize a branch
++				# number based on the assumptions:
++				# a) the order of branches is fixed across
++				#    instances
++				# b) an instance starts with an lcount line
++				$branch_num = 0;
++			} elsif ($line =~ /^function:(\d+),(\d+),([^,]+)$/) {
++				next if (!$func_coverage || $excl->{$1});
++
++				# function:<line>,<count>,<name>
++				print($fd "FN:$1,$3\n");
++				print($fd "FNDA:$2,$3\n");
++			} elsif ($line =~ /^function:(\d+),\d+,(\d+),([^,]+)$/) {
++				next if (!$func_coverage || $excl->{$1});
++
++				# function:<start_line>,<end_line>,<count>,
++				#          <name>
++				print($fd "FN:$1,$3\n");
++				print($fd "FNDA:$2,$3\n");
++			} elsif ($line =~ /^branch:(\d+),(taken|nottaken|notexec)/) {
++				next if (!$br_coverage || $excl->{$1} ||
++					 $brexcl->{$1});
++
++				# branch:<line>,taken|nottaken|notexec
++				if ($2 eq "taken") {
++					$c = 1;
++				} elsif ($2 eq "nottaken") {
++					$c = 0;
++				} else {
++					$c = "-";
++				}
++				print($fd "BRDA:$1,0,$branch_num,$c\n");
++				$branch_num++;
++			}
++		}
++		print($fd "end_of_record\n");
++	}
++}
++
++
++sub get_output_fd($$)
++{
++	my ($outfile, $file) = @_;
++	my $fd;
++
++	if (!defined($outfile)) {
++		open($fd, ">", "$file.info") or
++			die("ERROR: Cannot create file $file.info: $!\n");
++	} elsif ($outfile eq "-") {
++		open($fd, ">&STDOUT") or
++			die("ERROR: Cannot duplicate stdout: $!\n");
++	} else {
++		open($fd, ">>", $outfile) or
++			die("ERROR: Cannot write to file $outfile: $!\n");
++	}
++
++	return $fd;
++}
++
++
++#
++# print_gcov_warnings(stderr_file, is_graph, map)
++#
++# Print GCOV warnings in file STDERR_FILE to STDERR. If IS_GRAPH is non-zero,
++# suppress warnings about missing as these are expected. Replace keys found
++# in MAP with their values.
++#
++
++sub print_gcov_warnings($$$)
++{
++	my ($stderr_file, $is_graph, $map) = @_;
++	my $fd;
++
++	if (!open($fd, "<", $stderr_file)) {
++		warn("WARNING: Could not open GCOV stderr file ".
++		     "$stderr_file: $!\n");
++		return;
++	}
++	while (my $line = <$fd>) {
++		next if ($is_graph && $line =~ /cannot open data file/);
++
++		for my $key (keys(%{$map})) {
++			$line =~ s/\Q$key\E/$map->{$key}/g;
++		}
++
++		print(STDERR $line);
++	}
++	close($fd);
++}
++
++
++#
++# process_intermediate(file, dir, tempdir)
++#
++# Create output for a single file (either a data file or a graph file) using
++# gcov's intermediate option.
++#
++
++sub process_intermediate($$$)
++{
++	my ($file, $dir, $tempdir) = @_;
++	my ($fdir, $fbase, $fext);
++	my $data_file;
++	my $errmsg;
++	my %data;
++	my $fd;
++	my $base;
++	my $srcdata;
++	my $is_graph = 0;
++	my ($out, $err, $rc);
++
++	info("Processing %s\n", abs2rel($file, $dir));
++
++	$file = solve_relative_path($cwd, $file);
++	($fdir, $fbase, $fext) = split_filename($file);
++
++	$is_graph = 1 if (".$fext" eq $graph_file_extension);
++
++	if ($is_graph) {
++		# Process graph file - copy to temp directory to prevent
++		# accidental processing of associated data file
++		$data_file = "$tempdir/$fbase$graph_file_extension";
++		if (!copy($file, $data_file)) {
++			$errmsg = "ERROR: Could not copy file $file";
++			goto err;
++		}
++	} else {
++		# Process data file in place
++		$data_file = $file;
++	}
++
++	# Change directory
++	if (!chdir($tempdir)) {
++		$errmsg = "Could not change to directory $tempdir: $!";
++		goto err;
++	}
++
++	# Run gcov on data file
++	($out, $err, $rc) = system_no_output(1 + 2 + 4, $gcov_tool,
++					     $data_file, @gcov_options, "-i");
++	defined($out) && unlink($out);
++	if (defined($err)) {
++		print_gcov_warnings($err, $is_graph, {
++			$data_file => $file,
++		});
++		unlink($err);
++	}
++	if ($rc) {
++		$errmsg = "GCOV failed for $file";
++		goto err;
++	}
++
++	if ($is_graph) {
++		# Remove graph file copy
++		unlink($data_file);
++	}
++
++	# Parse resulting file(s)
++	for my $gcov_filename (glob("*.gcov")) {
++		read_intermediate_text($gcov_filename, \%data);
++		unlink($gcov_filename);
++	}
++
++	if (!%data) {
++		warn("WARNING: GCOV did not produce any data for $file\n");
++		return;
++	}
++
++	# Determine base directory
++	if (defined($base_directory)) {
++		$base = $base_directory;
++	} else {
++		$base = $fdir;
++
++		if (is_compat($COMPAT_MODE_LIBTOOL)) {
++			# Avoid files from .libs dirs
++			$base =~ s/\.libs$//;
++		}
++
++		# Try to find base directory automatically if requested by user
++		if ($rc_auto_base) {
++			$base = find_base_from_source($base, [ keys(%data) ]);
++		}
++	}
++
++	# Apply base file name to relative source files
++	adjust_source_filenames(\%data, $base);
++
++	# Remove excluded source files
++	filter_source_files(\%data);
++
++	# Get data on exclusion markers and checksums if requested
++	if (!$no_markers || $checksum) {
++		$srcdata = get_all_source_data(keys(%data));
++	}
++
++	# Generate output
++	$fd = get_output_fd($output_filename, $file);
++	intermediate_text_to_info($fd, \%data, $srcdata);
++	close($fd);
++
++	chdir($cwd);
++
++	return;
++
++err:
++	if ($ignore[$ERROR_GCOV]) {
++		warn("WARNING: $errmsg!\n");
++	} else {
++		die("ERROR: $errmsg!\n")
++	}
++}
++
++
+ # Map LLVM versions to the version of GCC gcov which they emulate.
+ 
+ sub map_llvm_version($)
+@@ -2151,8 +2481,12 @@ sub int_handler()
+ #
+ #   MODE & 1: suppress STDOUT
+ #   MODE & 2: suppress STDERR
++#   MODE & 4: redirect to temporary files instead of suppressing
+ #
+-# Return 0 on success, non-zero otherwise.
++# Return (stdout, stderr, rc):
++#    stdout: path to tempfile containing stdout or undef
++#    stderr: path to tempfile containing stderr or undef
++#    0 on success, non-zero otherwise
+ #
+ 
+ sub system_no_output($@)
+@@ -2161,14 +2495,31 @@ sub system_no_output($@)
+ 	my $result;
+ 	local *OLD_STDERR;
+ 	local *OLD_STDOUT;
++	my $stdout_file;
++	my $stderr_file;
++	my $fd;
+ 
+ 	# Save old stdout and stderr handles
+ 	($mode & 1) && open(OLD_STDOUT, ">>&", "STDOUT");
+ 	($mode & 2) && open(OLD_STDERR, ">>&", "STDERR");
+ 
+-	# Redirect to /dev/null
+-	($mode & 1) && open(STDOUT, ">", "/dev/null");
+-	($mode & 2) && open(STDERR, ">", "/dev/null");
++	if ($mode & 4) {
++		# Redirect to temporary files
++		if ($mode & 1) {
++			($fd, $stdout_file) = tempfile(UNLINK => 1);
++			open(STDOUT, ">", $stdout_file) || warn("$!\n");
++			close($fd);
++		}
++		if ($mode & 2) {
++			($fd, $stderr_file) = tempfile(UNLINK => 1);
++			open(STDERR, ">", $stderr_file) || warn("$!\n");
++			close($fd);
++		}
++	} else {
++		# Redirect to /dev/null
++		($mode & 1) && open(STDOUT, ">", "/dev/null");
++		($mode & 2) && open(STDERR, ">", "/dev/null");
++	}
+  
+ 	debug("system(".join(' ', @_).")\n");
+ 	system(@_);
+@@ -2181,8 +2532,18 @@ sub system_no_output($@)
+ 	# Restore old handles
+ 	($mode & 1) && open(STDOUT, ">>&", "OLD_STDOUT");
+ 	($mode & 2) && open(STDERR, ">>&", "OLD_STDERR");
++
++	# Remove empty output files
++	if (defined($stdout_file) && -z $stdout_file) {
++		unlink($stdout_file);
++		$stdout_file = undef;
++	}
++	if (defined($stderr_file) && -z $stderr_file) {
++		unlink($stderr_file);
++		$stderr_file = undef;
++	}
+  
+-	return $result;
++	return ($stdout_file, $stderr_file, $result);
+ }
+ 
+ 
+@@ -2260,23 +2621,28 @@ sub apply_config($)
+ 
+ 
+ #
+-# get_exclusion_data(filename)
++# get_source_data(filename)
+ #
+-# Scan specified source code file for exclusion markers and return
+-#   linenumber -> 1
+-# for all lines which should be excluded.
++# Scan specified source code file for exclusion markers and checksums. Return
++#   ( excl, brexcl, checksums ) where
++#   excl:      lineno -> 1 for all lines for which to exclude all data
++#   brexcl:    lineno -> 1 for all lines for which to exclude branch data
++#   checksums: lineno -> source code checksum
+ #
+ 
+-sub get_exclusion_data($)
++sub get_source_data($)
+ {
+ 	my ($filename) = @_;
+ 	my %list;
+ 	my $flag = 0;
++	my %brdata;
++	my $brflag = 0;
++	my %checksums;
+ 	local *HANDLE;
+ 
+ 	if (!open(HANDLE, "<", $filename)) {
+ 		warn("WARNING: could not open $filename\n");
+-		return undef;
++		return;
+ 	}
+ 	while (<HANDLE>) {
+ 		if (/$EXCL_STOP/) {
+@@ -2287,14 +2653,62 @@ sub get_exclusion_data($)
+ 		if (/$excl_line/ || $flag) {
+ 			$list{$.} = 1;
+ 		}
++		if (/$EXCL_BR_STOP/) {
++			$brflag = 0;
++		} elsif (/$EXCL_BR_START/) {
++			$brflag = 1;
++		}
++		if (/$excl_br_line/ || $brflag) {
++			$brdata{$.} = 1;
++		}
++		if ($checksum) {
++			chomp();
++			$checksums{$.} = md5_base64($_);
++		}
+ 	}
+ 	close(HANDLE);
+ 
+-	if ($flag) {
++	if ($flag || $brflag) {
+ 		warn("WARNING: unterminated exclusion section in $filename\n");
+ 	}
+ 
+-	return \%list;
++	return (\%list, \%brdata, \%checksums);
++}
++
++
++#
++# get_all_source_data(filenames)
++#
++# Scan specified source code files for exclusion markers and return
++#   filename -> [ excl, brexcl, checksums ]
++#   excl:      lineno -> 1 for all lines for which to exclude all data
++#   brexcl:    lineno -> 1 for all lines for which to exclude branch data
++#   checksums: lineno -> source code checksum
++#
++
++sub get_all_source_data(@)
++{
++	my @filenames = @_;
++	my %data;
++	my $failed = 0;
++
++	for my $filename (@filenames) {
++		my @d;
++		next if (exists($data{$filename}));
++
++		@d = get_source_data($filename);
++		if (@d) {
++			$data{$filename} = [ @d ];
++		} else {
++			$failed = 1;
++		}
++	}
++
++	if ($failed) {
++		warn("WARNING: some exclusion markers may be ignored\n");
++	}
++
++	return \%data;
+ }
+ 
+ 
+@@ -2318,35 +2732,17 @@ sub apply_exclusion_data($$)
+ {
+ 	my ($instr, $graph) = @_;
+ 	my $filename;
+-	my %excl_data;
+-	my $excl_read_failed = 0;
++	my $excl_data;
+ 
+-	# Collect exclusion marker data
+-	foreach $filename (sort_uniq_lex(keys(%{$graph}), keys(%{$instr}))) {
+-		my $excl = get_exclusion_data($filename);
+-
+-		# Skip and note if file could not be read
+-		if (!defined($excl)) {
+-			$excl_read_failed = 1;
+-			next;
+-		}
+-
+-		# Add to collection if there are markers
+-		$excl_data{$filename} = $excl if (keys(%{$excl}) > 0);
+-	}
+-
+-	# Warn if not all source files could be read
+-	if ($excl_read_failed) {
+-		warn("WARNING: some exclusion markers may be ignored\n");
+-	}
++	($excl_data) = get_all_source_data(keys(%{$graph}), keys(%{$instr}));
+ 
+ 	# Skip if no markers were found
+-	return ($instr, $graph) if (keys(%excl_data) == 0);
++	return ($instr, $graph) if (!%$excl_data);
+ 
+ 	# Apply exclusion marker data to graph
+-	foreach $filename (keys(%excl_data)) {
++	foreach $filename (keys(%$excl_data)) {
+ 		my $function_data = $graph->{$filename};
+-		my $excl = $excl_data{$filename};
++		my $excl = $excl_data->{$filename}->[0];
+ 		my $function;
+ 
+ 		next if (!defined($function_data));
+@@ -2384,9 +2780,9 @@ sub apply_exclusion_data($$)
+ 	}
+ 
+ 	# Apply exclusion marker data to instr
+-	foreach $filename (keys(%excl_data)) {
++	foreach $filename (keys(%$excl_data)) {
+ 		my $line_data = $instr->{$filename};
+-		my $excl = $excl_data{$filename};
++		my $excl = $excl_data->{$filename}->[0];
+ 		my $line;
+ 		my @new_data;
+ 
+@@ -2468,10 +2864,12 @@ sub process_graphfile($$)
+ 
+ 	# Try to find base directory automatically if requested by user
+ 	if ($rc_auto_base) {
+-		$base_dir = find_base_from_graph($base_dir, $instr, $graph);
++		$base_dir = find_base_from_source($base_dir,
++			[ keys(%{$instr}), keys(%{$graph}) ]);
+ 	}
+ 
+-	($instr, $graph) = adjust_graph_filenames($base_dir, $instr, $graph);
++	adjust_source_filenames($instr, $base_dir);
++	adjust_source_filenames($graph, $base_dir);
+ 
+ 	if (!$no_markers) {
+ 		# Apply exclusion marker data to graph file data
+@@ -2767,11 +3165,11 @@ sub parent_dir($)
+ }
+ 
+ #
+-# find_base_from_graph(base_dir, instr, graph)
++# find_base_from_source(base_dir, source_files)
+ #
+-# Try to determine the base directory of the graph file specified by INSTR
+-# and GRAPH. The base directory is the base for all relative filenames in
+-# the graph file. It is defined by the current working directory at time
++# Try to determine the base directory of the object file built from
++# SOURCE_FILES. The base directory is the base for all relative filenames in
++# the gcov data. It is defined by the current working directory at time
+ # of compiling the source file.
+ #
+ # This function implements a heuristic which relies on the following
+@@ -2781,16 +3179,16 @@ sub parent_dir($)
+ # - files by the same name are not present in multiple parent directories
+ #
+ 
+-sub find_base_from_graph($$$)
++sub find_base_from_source($$)
+ {
+-	my ($base_dir, $instr, $graph) = @_;
++	my ($base_dir, $source_files) = @_;
+ 	my $old_base;
+ 	my $best_miss;
+ 	my $best_base;
+ 	my %rel_files;
+ 
+ 	# Determine list of relative paths
+-	foreach my $filename (keys(%{$instr}), keys(%{$graph})) {
++	foreach my $filename (@$source_files) {
+ 		next if (file_name_is_absolute($filename));
+ 
+ 		$rel_files{$filename} = 1;
+@@ -2829,17 +3227,17 @@ sub find_base_from_graph($$$)
+ }
+ 
+ #
+-# adjust_graph_filenames(base_dir, instr, graph)
++# adjust_source_filenames(hash, base_dir)
+ #
+-# Make relative paths in INSTR and GRAPH absolute and apply
+-# geninfo_adjust_src_path setting to graph file data.
++# Transform all keys of HASH to absolute form and apply requested
++# transformations.
+ #
+ 
+-sub adjust_graph_filenames($$$)
++sub adjust_source_filenames($$$)
+ {
+-	my ($base_dir, $instr, $graph) = @_;
++	my ($hash, $base_dir) = @_;
+ 
+-	foreach my $filename (keys(%{$instr})) {
++	foreach my $filename (keys(%{$hash})) {
+ 		my $old_filename = $filename;
+ 
+ 		# Convert to absolute canonical form
+@@ -2851,28 +3249,50 @@ sub adjust_graph_filenames($$$)
+ 		}
+ 
+ 		if ($filename ne $old_filename) {
+-			$instr->{$filename} = delete($instr->{$old_filename});
++			$hash->{$filename} = delete($hash->{$old_filename});
+ 		}
+ 	}
++}
+ 
+-	foreach my $filename (keys(%{$graph})) {
+-		my $old_filename = $filename;
+ 
+-		# Make absolute
+-		# Convert to absolute canonical form
+-		$filename = solve_relative_path($base_dir, $filename);
++#
++# filter_source_files(hash)
++#
++# Remove unwanted source file data from HASH.
++#
+ 
+-		# Apply adjustment
+-		if (defined($adjust_src_pattern)) {
+-			$filename =~ s/$adjust_src_pattern/$adjust_src_replace/g;
++sub filter_source_files($)
++{
++	my ($hash) = @_;
++
++	foreach my $filename (keys(%{$hash})) {
++		# Skip external files if requested
++		goto del if (!$opt_external && is_external($filename));
++
++		# Apply include patterns
++		if (@include_patterns) {
++			my $keep;
++
++			foreach my $pattern (@include_patterns) {
++				if ($filename =~ (/^$pattern$/)) {
++					$keep = 1;
++					last;
++				}
++			}
++			goto del if (!$keep);
+ 		}
+ 
+-		if ($filename ne $old_filename) {
+-			$graph->{$filename} = delete($graph->{$old_filename});
++		# Apply exclude patterns
++		foreach my $pattern (@exclude_patterns) {
++			goto del if ($filename =~ (/^$pattern$/));
+ 		}
+-	}
++		next;
+ 
+-	return ($instr, $graph);
++del:
++		# Remove file data
++		delete($hash->{$filename});
++		$excluded_files{$filename} = 1;
++	}
+ }
+ 
+ #
+@@ -3784,6 +4204,7 @@ sub get_gcov_capabilities()
+ 		'c' => 'branch-counts',
+ 		'f' => 'function-summaries',
+ 		'h' => 'help',
++		'i' => 'intermediate-format',
+ 		'l' => 'long-file-names',
+ 		'n' => 'no-output',
+ 		'o' => 'object-directory',
+diff --git a/lcovrc b/lcovrc
+index 40f364f..bd4bc3b 100644
+--- a/lcovrc
++++ b/lcovrc
+@@ -134,6 +134,9 @@ genhtml_desc_html=0
+ # when collecting coverage data.
+ geninfo_auto_base = 1
+ 
++# Use gcov intermediate format? Valid values are 0, 1, auto
++geninfo_intermediate = auto
++
+ # Directory containing gcov kernel files
+ # lcov_gcov_dir = /proc/gcov
+ 
+diff --git a/man/lcovrc.5 b/man/lcovrc.5
+index f20d273..bf0ce7a 100644
+--- a/man/lcovrc.5
++++ b/man/lcovrc.5
+@@ -223,6 +223,11 @@ geninfo_compat_libtool = 0
+ geninfo_auto_base = 1
+ .br
+ 
++# Use gcov intermediate format? Valid values are 0, 1, auto
++.br
++geninfo_intermediate = auto
++.br
++
+ # Directory containing gcov kernel files
+ .br
+ lcov_gcov_dir = /proc/gcov
+@@ -789,6 +794,25 @@ located, and in addition, is different between files of the same project.
+ Default is 1.
+ .PP
+ 
++.BR geninfo_intermediate " ="
++.IR 0 | 1 | auto
++.IP
++Specify whether to use gcov intermediate format
++.br
++
++Use this option to control whether geninfo should use the gcov intermediate
++format while collecting coverage data. The use of the gcov intermediate format
++should increase processing speed. It also provides branch coverage data when
++using the \-\-initial command line option.
++.br
++
++Valid values are 0 for off, 1 for on, and "auto" to let geninfo automatically
++use immediate format when supported by gcov.
++.br
++
++Default is "auto".
++.PP
++
+ .BR lcov_gcov_dir " ="
+ .I path_to_kernel_coverage_data
+ .IP
+-- 
+2.17.1
+
diff --git a/meta-oe/recipes-support/lcov/files/0002-geninfo-Add-intermediate-JSON-format-support.patch b/meta-oe/recipes-support/lcov/files/0002-geninfo-Add-intermediate-JSON-format-support.patch
new file mode 100644
index 000000000..7b180635c
--- /dev/null
+++ b/meta-oe/recipes-support/lcov/files/0002-geninfo-Add-intermediate-JSON-format-support.patch
@@ -0,0 +1,247 @@
+From e13b2b6f8443da660cafa0679c3b16240843ce9f Mon Sep 17 00:00:00 2001
+From: Peter Oberparleiter <oberpar@linux.ibm.com>
+Date: Fri, 24 May 2019 17:16:56 +0200
+Subject: [PATCH 2/2] geninfo: Add intermediate JSON format support
+
+This change adds support for parsing the output of gcov's intermediate
+JSON file format as implemented by GCC version 9.
+
+Note: The way that the intermediate file format support is implemented
+in geninfo removes the need to parse .gcno files directly. Since geninfo
+does not include support for parsing GCC 9 .gcno files, using the
+intermediate format is the only option for geninfo to collect coverage
+data generated by GCC version 9.
+
+Signed-off-by: Peter Oberparleiter <oberpar@linux.ibm.com>
+---
+ bin/geninfo | 162 +++++++++++++++++++++++++++++++++++++++++++++++++++-
+ 1 file changed, 160 insertions(+), 2 deletions(-)
+
+Upstream-Status: Backport
+Download URL: https://github.com/linux-test-project/lcov/commit/75fbae1cfc5027f818a0bb865bf6f96fab3202da
+
+diff --git a/bin/geninfo b/bin/geninfo
+index 0276666..cceb782 100755
+--- a/bin/geninfo
++++ b/bin/geninfo
+@@ -59,6 +59,9 @@ use File::Copy qw(copy);
+ use Getopt::Long;
+ use Digest::MD5 qw(md5_base64);
+ use Cwd qw/abs_path/;
++use PerlIO::gzip;
++use JSON qw(decode_json);
++
+ if( $^O eq "msys" )
+ {
+ 	require File::Spec::Win32;
+@@ -474,7 +477,8 @@ if ($rc_intermediate eq "0") {
+ 	$intermediate = 1;
+ } elsif (lc($rc_intermediate) eq "auto") {
+ 	# Use intermediate format if supported by gcov
+-	$intermediate = $gcov_caps->{'intermediate-format'} ? 1 : 0;
++	$intermediate = ($gcov_caps->{'intermediate-format'} ||
++			 $gcov_caps->{'json-format'}) ? 1 : 0;
+ } else {
+ 	die("ERROR: invalid value for geninfo_intermediate: ".
+ 	    "'$rc_intermediate'\n");
+@@ -2084,6 +2088,48 @@ sub read_intermediate_text($$)
+ }
+ 
+ 
++#
++# read_intermediate_json(gcov_filename, data, basedir_ref)
++#
++# Read gcov intermediate JSON format in GCOV_FILENAME and add the resulting
++# data to DATA in the following format:
++#
++# data:      source_filename -> file_data
++# file_data: GCOV JSON data for file
++#
++# Also store the value for current_working_directory to BASEDIR_REF.
++#
++
++sub read_intermediate_json($$$)
++{
++	my ($gcov_filename, $data, $basedir_ref) = @_;
++	my $fd;
++	my $text;
++	my $json;
++
++	open($fd, "<:gzip", $gcov_filename) or
++		die("ERROR: Could not read $gcov_filename: $!\n");
++	local $/;
++	$text = <$fd>;
++	close($fd);
++
++	$json = decode_json($text);
++	if (!defined($json) || !exists($json->{"files"}) ||
++	    ref($json->{"files"} ne "ARRAY")) {
++		die("ERROR: Unrecognized JSON output format in ".
++		    "$gcov_filename\n");
++	}
++
++	$$basedir_ref = $json->{"current_working_directory"};
++
++	for my $file (@{$json->{"files"}}) {
++		my $filename = $file->{"file"};
++
++		$data->{$filename} = $file;
++	}
++}
++
++
+ #
+ # intermediate_text_to_info(fd, data, srcdata)
+ #
+@@ -2173,6 +2219,104 @@ sub intermediate_text_to_info($$$)
+ }
+ 
+ 
++#
++# intermediate_json_to_info(fd, data, srcdata)
++#
++# Write DATA in info format to file descriptor FD.
++#
++# data:      filename -> file_data:
++# file_data: GCOV JSON data for file
++#
++# srcdata:   filename -> [ excl, brexcl, checksums ]
++# excl:      lineno -> 1 for all lines for which to exclude all data
++# brexcl:    lineno -> 1 for all lines for which to exclude branch data
++# checksums: lineno -> source code checksum
++#
++# Note: To simplify processing, gcov data is not combined here, that is counts
++#       that appear multiple times for the same lines/branches are not added.
++#       This is done by lcov/genhtml when reading the data files.
++#
++
++sub intermediate_json_to_info($$$)
++{
++	my ($fd, $data, $srcdata) = @_;
++	my $branch_num = 0;
++
++	return if (!%{$data});
++
++	print($fd "TN:$test_name\n");
++	for my $filename (keys(%{$data})) {
++		my ($excl, $brexcl, $checksums);
++		my $file_data = $data->{$filename};
++
++		if (defined($srcdata->{$filename})) {
++			($excl, $brexcl, $checksums) = @{$srcdata->{$filename}};
++		}
++
++		print($fd "SF:$filename\n");
++
++		# Function data
++		if ($func_coverage) {
++			for my $d (@{$file_data->{"functions"}}) {
++				my $line = $d->{"start_line"};
++				my $count = $d->{"execution_count"};
++				my $name = $d->{"name"};
++
++				next if (!defined($line) || !defined($count) ||
++					 !defined($name) || $excl->{$line});
++
++				print($fd "FN:$line,$name\n");
++				print($fd "FNDA:$count,$name\n");
++			}
++		}
++
++		# Line data
++		for my $d (@{$file_data->{"lines"}}) {
++			my $line = $d->{"line_number"};
++			my $count = $d->{"count"};
++			my $c;
++			my $branches = $d->{"branches"};
++			my $unexec = $d->{"unexecuted_block"};
++
++			next if (!defined($line) || !defined($count) ||
++				 $excl->{$line});
++
++			if (defined($unexec) && $unexec && $count == 0) {
++				$unexec = 1;
++			} else {
++				$unexec = 0;
++			}
++
++			if ($checksum && exists($checksums->{$line})) {
++				$c = ",".$checksums->{$line};
++			} else {
++				$c = "";
++			}
++			print($fd "DA:$line,$count$c\n");
++
++			$branch_num = 0;
++			# Branch data
++			if ($br_coverage && !$brexcl->{$line}) {
++				for my $b (@$branches) {
++					my $brcount = $b->{"count"};
++
++					if (!defined($brcount) || $unexec) {
++						$brcount = "-";
++					}
++					print($fd "BRDA:$line,0,$branch_num,".
++					      "$brcount\n");
++
++					$branch_num++;
++				}
++			}
++
++		}
++
++		print($fd "end_of_record\n");
++	}
++}
++
++
+ sub get_output_fd($$)
+ {
+ 	my ($outfile, $file) = @_;
+@@ -2243,6 +2387,8 @@ sub process_intermediate($$$)
+ 	my $srcdata;
+ 	my $is_graph = 0;
+ 	my ($out, $err, $rc);
++	my $json_basedir;
++	my $json_format;
+ 
+ 	info("Processing %s\n", abs2rel($file, $dir));
+ 
+@@ -2296,6 +2442,12 @@ sub process_intermediate($$$)
+ 		unlink($gcov_filename);
+ 	}
+ 
++	for my $gcov_filename (glob("*.gcov.json.gz")) {
++		read_intermediate_json($gcov_filename, \%data, \$json_basedir);
++		unlink($gcov_filename);
++		$json_format = 1;
++	}
++
+ 	if (!%data) {
+ 		warn("WARNING: GCOV did not produce any data for $file\n");
+ 		return;
+@@ -2304,6 +2456,8 @@ sub process_intermediate($$$)
+ 	# Determine base directory
+ 	if (defined($base_directory)) {
+ 		$base = $base_directory;
++	} elsif (defined($json_basedir)) {
++		$base = $json_basedir;
+ 	} else {
+ 		$base = $fdir;
+ 
+@@ -2331,7 +2485,11 @@ sub process_intermediate($$$)
+ 
+ 	# Generate output
+ 	$fd = get_output_fd($output_filename, $file);
+-	intermediate_text_to_info($fd, \%data, $srcdata);
++	if ($json_format) {
++		intermediate_json_to_info($fd, \%data, $srcdata);
++	} else {
++		intermediate_text_to_info($fd, \%data, $srcdata);
++	}
+ 	close($fd);
+ 
+ 	chdir($cwd);
+-- 
+2.17.1
+
diff --git a/meta-oe/recipes-support/lcov/lcov_1.14.bb b/meta-oe/recipes-support/lcov/lcov_1.14.bb
index fd02f4a76..ac0505829 100755
--- a/meta-oe/recipes-support/lcov/lcov_1.14.bb
+++ b/meta-oe/recipes-support/lcov/lcov_1.14.bb
@@ -10,6 +10,8 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=751419260aa954499f7abaabaa882bbe"
 
 RDEPENDS_${PN} += " \
     gcov \
+    libjson-perl \
+    libperlio-gzip-perl \
     perl \
     perl-module-filehandle \
     perl-module-getopt-std \
@@ -18,6 +20,7 @@ RDEPENDS_${PN} += " \
     perl-module-cwd \
     perl-module-errno \
     perl-module-file-basename \
+    perl-module-file-copy \
     perl-module-file-find \
     perl-module-file-path \
     perl-module-file-spec \
@@ -41,7 +44,11 @@ RDEPENDS_${PN} += " \
     perl-module-tie-hash \
 "
 
-SRC_URI = "http://downloads.sourceforge.net/ltp/${BP}.tar.gz"
+SRC_URI = " \
+           http://downloads.sourceforge.net/ltp/${BP}.tar.gz \
+           file://0001-geninfo-Add-intermediate-text-format-support.patch \
+           file://0002-geninfo-Add-intermediate-JSON-format-support.patch \
+	   "
 
 SRC_URI[md5sum] = "0220d01753469f83921f8f41ae5054c1"
 SRC_URI[sha256sum] = "14995699187440e0ae4da57fe3a64adc0a3c5cf14feab971f8db38fb7d8f071a"
-- 
2.17.1



^ permalink raw reply related

* Re: [for-next][PATCH 12/26] Documentation: bootconfig: Add a doc for extended boot config
From: Markus Elfring @ 2020-02-20 15:00 UTC (permalink / raw)
  To: Masami Hiramatsu, Steven Rostedt, linux-doc, linux-fsdevel
  Cc: kernel-janitors, linux-kernel, Alexey Dobriyan, Andrew Morton,
	Arnaldo Carvalho de Melo, Frank Rowand, Greg Kroah-Hartman,
	Ingo Molnar, Jiri Olsa, Jonathan Corbet, Linus Torvalds,
	Namhyung Kim, Randy Dunlap, Rob Herring, Thomas Gleixner,
	Tim Bird, Tom Zanussi
In-Reply-To: <20200220221340.2b66fd2051a5da74775c474b@kernel.org>

>>> +Currently the maximum config size size is 32KB …
>>
>> Would you like to avoid a word duplication here?
>
> Oops, still exist.

Is there a need to separate the number from the following unit?


> Indeed, "node" is not well defined. What about this?
> ---
> Each key consists of words separated by dot, and value also consists of
> values separated by comma. Here, each word and each value is generally
> called a "node".

I have got still understanding difficulties with such an interpretation.

* Do other contributors find an other word also more appropriate for this use case?

* How will the influence evolve for naming these items?

* Is each element just a string (according to specific rules)?


>> Could an other wording be nicer than the abbreviation “a doc for … config”
>> in the commit subject?
>
> OK, I'll try next time.

Will words like “descriptions”and “configuration”be helpful?

Regards,
Markus

^ permalink raw reply

* [Cluster-devel] [PATCH v7 10/24] mm: Add readahead address space operation
From: Zi Yan @ 2020-02-20 15:00 UTC (permalink / raw)
  To: cluster-devel.redhat.com
In-Reply-To: <20200219210103.32400-11-willy@infradead.org>

On 19 Feb 2020, at 16:00, Matthew Wilcox wrote:

> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
>
> This replaces ->readpages with a saner interface:
>  - Return void instead of an ignored error code.
>  - Page cache is already populated with locked pages when ->readahead
>    is called.
>  - New arguments can be passed to the implementation without changing
>    all the filesystems that use a common helper function like
>    mpage_readahead().
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  Documentation/filesystems/locking.rst |  6 +++++-
>  Documentation/filesystems/vfs.rst     | 15 +++++++++++++++
>  include/linux/fs.h                    |  2 ++
>  include/linux/pagemap.h               | 18 ++++++++++++++++++
>  mm/readahead.c                        | 12 ++++++++++--
>  5 files changed, 50 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locking.rst
> index 5057e4d9dcd1..0af2e0e11461 100644
> --- a/Documentation/filesystems/locking.rst
> +++ b/Documentation/filesystems/locking.rst
> @@ -239,6 +239,7 @@ prototypes::
>  	int (*readpage)(struct file *, struct page *);
>  	int (*writepages)(struct address_space *, struct writeback_control *);
>  	int (*set_page_dirty)(struct page *page);
> +	void (*readahead)(struct readahead_control *);
>  	int (*readpages)(struct file *filp, struct address_space *mapping,
>  			struct list_head *pages, unsigned nr_pages);
>  	int (*write_begin)(struct file *, struct address_space *mapping,
> @@ -271,7 +272,8 @@ writepage:		yes, unlocks (see below)
>  readpage:		yes, unlocks
>  writepages:
>  set_page_dirty		no
> -readpages:
> +readahead:		yes, unlocks
> +readpages:		no
>  write_begin:		locks the page		 exclusive
>  write_end:		yes, unlocks		 exclusive
>  bmap:
> @@ -295,6 +297,8 @@ the request handler (/dev/loop).
>  ->readpage() unlocks the page, either synchronously or via I/O
>  completion.
>
> +->readahead() unlocks the pages that I/O is attempted on like ->readpage().
> +
>  ->readpages() populates the pagecache with the passed pages and starts
>  I/O against them.  They come unlocked upon I/O completion.
>
> diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst
> index 7d4d09dd5e6d..ed17771c212b 100644
> --- a/Documentation/filesystems/vfs.rst
> +++ b/Documentation/filesystems/vfs.rst
> @@ -706,6 +706,7 @@ cache in your filesystem.  The following members are defined:
>  		int (*readpage)(struct file *, struct page *);
>  		int (*writepages)(struct address_space *, struct writeback_control *);
>  		int (*set_page_dirty)(struct page *page);
> +		void (*readahead)(struct readahead_control *);
>  		int (*readpages)(struct file *filp, struct address_space *mapping,
>  				 struct list_head *pages, unsigned nr_pages);
>  		int (*write_begin)(struct file *, struct address_space *mapping,
> @@ -781,12 +782,26 @@ cache in your filesystem.  The following members are defined:
>  	If defined, it should set the PageDirty flag, and the
>  	PAGECACHE_TAG_DIRTY tag in the radix tree.
>
> +``readahead``
> +	Called by the VM to read pages associated with the address_space
> +	object.  The pages are consecutive in the page cache and are
> +	locked.  The implementation should decrement the page refcount
> +	after starting I/O on each page.  Usually the page will be
> +	unlocked by the I/O completion handler.  If the filesystem decides
> +	to stop attempting I/O before reaching the end of the readahead
> +	window, it can simply return.  The caller will decrement the page
> +	refcount and unlock the remaining pages for you.  Set PageUptodate
> +	if the I/O completes successfully.  Setting PageError on any page
> +	will be ignored; simply unlock the page if an I/O error occurs.
> +
>  ``readpages``
>  	called by the VM to read pages associated with the address_space
>  	object.  This is essentially just a vector version of readpage.
>  	Instead of just one page, several pages are requested.
>  	readpages is only used for read-ahead, so read errors are
>  	ignored.  If anything goes wrong, feel free to give up.
> +	This interface is deprecated and will be removed by the end of
> +	2020; implement readahead instead.
>
>  ``write_begin``
>  	Called by the generic buffered write code to ask the filesystem
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 3cd4fe6b845e..d4e2d2964346 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -292,6 +292,7 @@ enum positive_aop_returns {
>  struct page;
>  struct address_space;
>  struct writeback_control;
> +struct readahead_control;
>
>  /*
>   * Write life time hint values.
> @@ -375,6 +376,7 @@ struct address_space_operations {
>  	 */
>  	int (*readpages)(struct file *filp, struct address_space *mapping,
>  			struct list_head *pages, unsigned nr_pages);
> +	void (*readahead)(struct readahead_control *);
>
>  	int (*write_begin)(struct file *, struct address_space *mapping,
>  				loff_t pos, unsigned len, unsigned flags,
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 4989d330fada..b3008605fd1b 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -669,6 +669,24 @@ static inline struct page *readahead_page(struct readahead_control *rac)
>  	return page;
>  }
>
> +/* The byte offset into the file of this readahead block */
> +static inline loff_t readahead_pos(struct readahead_control *rac)
> +{
> +	return (loff_t)rac->_index * PAGE_SIZE;
> +}
> +
> +/* The number of bytes in this readahead block */
> +static inline loff_t readahead_length(struct readahead_control *rac)
> +{
> +	return (loff_t)rac->_nr_pages * PAGE_SIZE;
> +}
> +
> +/* The index of the first page in this readahead block */
> +static inline unsigned int readahead_index(struct readahead_control *rac)
> +{
> +	return rac->_index;
> +}

rac->_index is pgoff_t, so readahead_index() should return the same type, right?
BTW, pgoff_t is unsigned long.

> +
>  /* The number of pages in this readahead block */
>  static inline unsigned int readahead_count(struct readahead_control *rac)
>  {
> diff --git a/mm/readahead.c b/mm/readahead.c
> index aaa209559ba2..07cdfbf00f4b 100644
> --- a/mm/readahead.c
> +++ b/mm/readahead.c
> @@ -124,7 +124,14 @@ static void read_pages(struct readahead_control *rac, struct list_head *pages)
>
>  	blk_start_plug(&plug);
>
> -	if (aops->readpages) {
> +	if (aops->readahead) {
> +		aops->readahead(rac);
> +		/* Clean up the remaining pages */
> +		while ((page = readahead_page(rac))) {
> +			unlock_page(page);
> +			put_page(page);
> +		}
> +	} else if (aops->readpages) {
>  		aops->readpages(rac->file, rac->mapping, pages,
>  				readahead_count(rac));
>  		/* Clean up the remaining pages */
> @@ -234,7 +241,8 @@ void force_page_cache_readahead(struct address_space *mapping,
>  	struct file_ra_state *ra = &filp->f_ra;
>  	unsigned long max_pages;
>
> -	if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages))
> +	if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages &&
> +			!mapping->a_ops->readahead))
>  		return;
>
>  	/*
> -- 
> 2.25.0


--
Best Regards,
Yan Zi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 854 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/cluster-devel/attachments/20200220/9b1ffa43/attachment.sig>

^ permalink raw reply

* [Ocfs2-devel] [PATCH v7 10/24] mm: Add readahead address space operation
From: Zi Yan @ 2020-02-20 15:00 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-fsdevel, linux-mm, linux-kernel, linux-btrfs, linux-erofs,
	linux-ext4, linux-f2fs-devel, cluster-devel, ocfs2-devel,
	linux-xfs
In-Reply-To: <20200219210103.32400-11-willy@infradead.org>

On 19 Feb 2020, at 16:00, Matthew Wilcox wrote:

> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
>
> This replaces ->readpages with a saner interface:
>  - Return void instead of an ignored error code.
>  - Page cache is already populated with locked pages when ->readahead
>    is called.
>  - New arguments can be passed to the implementation without changing
>    all the filesystems that use a common helper function like
>    mpage_readahead().
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  Documentation/filesystems/locking.rst |  6 +++++-
>  Documentation/filesystems/vfs.rst     | 15 +++++++++++++++
>  include/linux/fs.h                    |  2 ++
>  include/linux/pagemap.h               | 18 ++++++++++++++++++
>  mm/readahead.c                        | 12 ++++++++++--
>  5 files changed, 50 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locking.rst
> index 5057e4d9dcd1..0af2e0e11461 100644
> --- a/Documentation/filesystems/locking.rst
> +++ b/Documentation/filesystems/locking.rst
> @@ -239,6 +239,7 @@ prototypes::
>  	int (*readpage)(struct file *, struct page *);
>  	int (*writepages)(struct address_space *, struct writeback_control *);
>  	int (*set_page_dirty)(struct page *page);
> +	void (*readahead)(struct readahead_control *);
>  	int (*readpages)(struct file *filp, struct address_space *mapping,
>  			struct list_head *pages, unsigned nr_pages);
>  	int (*write_begin)(struct file *, struct address_space *mapping,
> @@ -271,7 +272,8 @@ writepage:		yes, unlocks (see below)
>  readpage:		yes, unlocks
>  writepages:
>  set_page_dirty		no
> -readpages:
> +readahead:		yes, unlocks
> +readpages:		no
>  write_begin:		locks the page		 exclusive
>  write_end:		yes, unlocks		 exclusive
>  bmap:
> @@ -295,6 +297,8 @@ the request handler (/dev/loop).
>  ->readpage() unlocks the page, either synchronously or via I/O
>  completion.
>
> +->readahead() unlocks the pages that I/O is attempted on like ->readpage().
> +
>  ->readpages() populates the pagecache with the passed pages and starts
>  I/O against them.  They come unlocked upon I/O completion.
>
> diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst
> index 7d4d09dd5e6d..ed17771c212b 100644
> --- a/Documentation/filesystems/vfs.rst
> +++ b/Documentation/filesystems/vfs.rst
> @@ -706,6 +706,7 @@ cache in your filesystem.  The following members are defined:
>  		int (*readpage)(struct file *, struct page *);
>  		int (*writepages)(struct address_space *, struct writeback_control *);
>  		int (*set_page_dirty)(struct page *page);
> +		void (*readahead)(struct readahead_control *);
>  		int (*readpages)(struct file *filp, struct address_space *mapping,
>  				 struct list_head *pages, unsigned nr_pages);
>  		int (*write_begin)(struct file *, struct address_space *mapping,
> @@ -781,12 +782,26 @@ cache in your filesystem.  The following members are defined:
>  	If defined, it should set the PageDirty flag, and the
>  	PAGECACHE_TAG_DIRTY tag in the radix tree.
>
> +``readahead``
> +	Called by the VM to read pages associated with the address_space
> +	object.  The pages are consecutive in the page cache and are
> +	locked.  The implementation should decrement the page refcount
> +	after starting I/O on each page.  Usually the page will be
> +	unlocked by the I/O completion handler.  If the filesystem decides
> +	to stop attempting I/O before reaching the end of the readahead
> +	window, it can simply return.  The caller will decrement the page
> +	refcount and unlock the remaining pages for you.  Set PageUptodate
> +	if the I/O completes successfully.  Setting PageError on any page
> +	will be ignored; simply unlock the page if an I/O error occurs.
> +
>  ``readpages``
>  	called by the VM to read pages associated with the address_space
>  	object.  This is essentially just a vector version of readpage.
>  	Instead of just one page, several pages are requested.
>  	readpages is only used for read-ahead, so read errors are
>  	ignored.  If anything goes wrong, feel free to give up.
> +	This interface is deprecated and will be removed by the end of
> +	2020; implement readahead instead.
>
>  ``write_begin``
>  	Called by the generic buffered write code to ask the filesystem
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 3cd4fe6b845e..d4e2d2964346 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -292,6 +292,7 @@ enum positive_aop_returns {
>  struct page;
>  struct address_space;
>  struct writeback_control;
> +struct readahead_control;
>
>  /*
>   * Write life time hint values.
> @@ -375,6 +376,7 @@ struct address_space_operations {
>  	 */
>  	int (*readpages)(struct file *filp, struct address_space *mapping,
>  			struct list_head *pages, unsigned nr_pages);
> +	void (*readahead)(struct readahead_control *);
>
>  	int (*write_begin)(struct file *, struct address_space *mapping,
>  				loff_t pos, unsigned len, unsigned flags,
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 4989d330fada..b3008605fd1b 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -669,6 +669,24 @@ static inline struct page *readahead_page(struct readahead_control *rac)
>  	return page;
>  }
>
> +/* The byte offset into the file of this readahead block */
> +static inline loff_t readahead_pos(struct readahead_control *rac)
> +{
> +	return (loff_t)rac->_index * PAGE_SIZE;
> +}
> +
> +/* The number of bytes in this readahead block */
> +static inline loff_t readahead_length(struct readahead_control *rac)
> +{
> +	return (loff_t)rac->_nr_pages * PAGE_SIZE;
> +}
> +
> +/* The index of the first page in this readahead block */
> +static inline unsigned int readahead_index(struct readahead_control *rac)
> +{
> +	return rac->_index;
> +}

rac->_index is pgoff_t, so readahead_index() should return the same type, right?
BTW, pgoff_t is unsigned long.

> +
>  /* The number of pages in this readahead block */
>  static inline unsigned int readahead_count(struct readahead_control *rac)
>  {
> diff --git a/mm/readahead.c b/mm/readahead.c
> index aaa209559ba2..07cdfbf00f4b 100644
> --- a/mm/readahead.c
> +++ b/mm/readahead.c
> @@ -124,7 +124,14 @@ static void read_pages(struct readahead_control *rac, struct list_head *pages)
>
>  	blk_start_plug(&plug);
>
> -	if (aops->readpages) {
> +	if (aops->readahead) {
> +		aops->readahead(rac);
> +		/* Clean up the remaining pages */
> +		while ((page = readahead_page(rac))) {
> +			unlock_page(page);
> +			put_page(page);
> +		}
> +	} else if (aops->readpages) {
>  		aops->readpages(rac->file, rac->mapping, pages,
>  				readahead_count(rac));
>  		/* Clean up the remaining pages */
> @@ -234,7 +241,8 @@ void force_page_cache_readahead(struct address_space *mapping,
>  	struct file_ra_state *ra = &filp->f_ra;
>  	unsigned long max_pages;
>
> -	if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages))
> +	if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages &&
> +			!mapping->a_ops->readahead))
>  		return;
>
>  	/*
> -- 
> 2.25.0


--
Best Regards,
Yan Zi
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 854 bytes
Desc: OpenPGP digital signature
Url : http://oss.oracle.com/pipermail/ocfs2-devel/attachments/20200220/9b1ffa43/attachment-0001.bin 

^ permalink raw reply

* Re: [PATCH v7 10/24] mm: Add readahead address space operation
From: Zi Yan @ 2020-02-20 15:00 UTC (permalink / raw)
  To: Matthew Wilcox
  Cc: linux-fsdevel, linux-mm, linux-kernel, linux-btrfs, linux-erofs,
	linux-ext4, linux-f2fs-devel, cluster-devel, ocfs2-devel,
	linux-xfs
In-Reply-To: <20200219210103.32400-11-willy@infradead.org>

[-- Attachment #1: Type: text/plain, Size: 7352 bytes --]

On 19 Feb 2020, at 16:00, Matthew Wilcox wrote:

> From: "Matthew Wilcox (Oracle)" <willy@infradead.org>
>
> This replaces ->readpages with a saner interface:
>  - Return void instead of an ignored error code.
>  - Page cache is already populated with locked pages when ->readahead
>    is called.
>  - New arguments can be passed to the implementation without changing
>    all the filesystems that use a common helper function like
>    mpage_readahead().
>
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
> ---
>  Documentation/filesystems/locking.rst |  6 +++++-
>  Documentation/filesystems/vfs.rst     | 15 +++++++++++++++
>  include/linux/fs.h                    |  2 ++
>  include/linux/pagemap.h               | 18 ++++++++++++++++++
>  mm/readahead.c                        | 12 ++++++++++--
>  5 files changed, 50 insertions(+), 3 deletions(-)
>
> diff --git a/Documentation/filesystems/locking.rst b/Documentation/filesystems/locking.rst
> index 5057e4d9dcd1..0af2e0e11461 100644
> --- a/Documentation/filesystems/locking.rst
> +++ b/Documentation/filesystems/locking.rst
> @@ -239,6 +239,7 @@ prototypes::
>  	int (*readpage)(struct file *, struct page *);
>  	int (*writepages)(struct address_space *, struct writeback_control *);
>  	int (*set_page_dirty)(struct page *page);
> +	void (*readahead)(struct readahead_control *);
>  	int (*readpages)(struct file *filp, struct address_space *mapping,
>  			struct list_head *pages, unsigned nr_pages);
>  	int (*write_begin)(struct file *, struct address_space *mapping,
> @@ -271,7 +272,8 @@ writepage:		yes, unlocks (see below)
>  readpage:		yes, unlocks
>  writepages:
>  set_page_dirty		no
> -readpages:
> +readahead:		yes, unlocks
> +readpages:		no
>  write_begin:		locks the page		 exclusive
>  write_end:		yes, unlocks		 exclusive
>  bmap:
> @@ -295,6 +297,8 @@ the request handler (/dev/loop).
>  ->readpage() unlocks the page, either synchronously or via I/O
>  completion.
>
> +->readahead() unlocks the pages that I/O is attempted on like ->readpage().
> +
>  ->readpages() populates the pagecache with the passed pages and starts
>  I/O against them.  They come unlocked upon I/O completion.
>
> diff --git a/Documentation/filesystems/vfs.rst b/Documentation/filesystems/vfs.rst
> index 7d4d09dd5e6d..ed17771c212b 100644
> --- a/Documentation/filesystems/vfs.rst
> +++ b/Documentation/filesystems/vfs.rst
> @@ -706,6 +706,7 @@ cache in your filesystem.  The following members are defined:
>  		int (*readpage)(struct file *, struct page *);
>  		int (*writepages)(struct address_space *, struct writeback_control *);
>  		int (*set_page_dirty)(struct page *page);
> +		void (*readahead)(struct readahead_control *);
>  		int (*readpages)(struct file *filp, struct address_space *mapping,
>  				 struct list_head *pages, unsigned nr_pages);
>  		int (*write_begin)(struct file *, struct address_space *mapping,
> @@ -781,12 +782,26 @@ cache in your filesystem.  The following members are defined:
>  	If defined, it should set the PageDirty flag, and the
>  	PAGECACHE_TAG_DIRTY tag in the radix tree.
>
> +``readahead``
> +	Called by the VM to read pages associated with the address_space
> +	object.  The pages are consecutive in the page cache and are
> +	locked.  The implementation should decrement the page refcount
> +	after starting I/O on each page.  Usually the page will be
> +	unlocked by the I/O completion handler.  If the filesystem decides
> +	to stop attempting I/O before reaching the end of the readahead
> +	window, it can simply return.  The caller will decrement the page
> +	refcount and unlock the remaining pages for you.  Set PageUptodate
> +	if the I/O completes successfully.  Setting PageError on any page
> +	will be ignored; simply unlock the page if an I/O error occurs.
> +
>  ``readpages``
>  	called by the VM to read pages associated with the address_space
>  	object.  This is essentially just a vector version of readpage.
>  	Instead of just one page, several pages are requested.
>  	readpages is only used for read-ahead, so read errors are
>  	ignored.  If anything goes wrong, feel free to give up.
> +	This interface is deprecated and will be removed by the end of
> +	2020; implement readahead instead.
>
>  ``write_begin``
>  	Called by the generic buffered write code to ask the filesystem
> diff --git a/include/linux/fs.h b/include/linux/fs.h
> index 3cd4fe6b845e..d4e2d2964346 100644
> --- a/include/linux/fs.h
> +++ b/include/linux/fs.h
> @@ -292,6 +292,7 @@ enum positive_aop_returns {
>  struct page;
>  struct address_space;
>  struct writeback_control;
> +struct readahead_control;
>
>  /*
>   * Write life time hint values.
> @@ -375,6 +376,7 @@ struct address_space_operations {
>  	 */
>  	int (*readpages)(struct file *filp, struct address_space *mapping,
>  			struct list_head *pages, unsigned nr_pages);
> +	void (*readahead)(struct readahead_control *);
>
>  	int (*write_begin)(struct file *, struct address_space *mapping,
>  				loff_t pos, unsigned len, unsigned flags,
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 4989d330fada..b3008605fd1b 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -669,6 +669,24 @@ static inline struct page *readahead_page(struct readahead_control *rac)
>  	return page;
>  }
>
> +/* The byte offset into the file of this readahead block */
> +static inline loff_t readahead_pos(struct readahead_control *rac)
> +{
> +	return (loff_t)rac->_index * PAGE_SIZE;
> +}
> +
> +/* The number of bytes in this readahead block */
> +static inline loff_t readahead_length(struct readahead_control *rac)
> +{
> +	return (loff_t)rac->_nr_pages * PAGE_SIZE;
> +}
> +
> +/* The index of the first page in this readahead block */
> +static inline unsigned int readahead_index(struct readahead_control *rac)
> +{
> +	return rac->_index;
> +}

rac->_index is pgoff_t, so readahead_index() should return the same type, right?
BTW, pgoff_t is unsigned long.

> +
>  /* The number of pages in this readahead block */
>  static inline unsigned int readahead_count(struct readahead_control *rac)
>  {
> diff --git a/mm/readahead.c b/mm/readahead.c
> index aaa209559ba2..07cdfbf00f4b 100644
> --- a/mm/readahead.c
> +++ b/mm/readahead.c
> @@ -124,7 +124,14 @@ static void read_pages(struct readahead_control *rac, struct list_head *pages)
>
>  	blk_start_plug(&plug);
>
> -	if (aops->readpages) {
> +	if (aops->readahead) {
> +		aops->readahead(rac);
> +		/* Clean up the remaining pages */
> +		while ((page = readahead_page(rac))) {
> +			unlock_page(page);
> +			put_page(page);
> +		}
> +	} else if (aops->readpages) {
>  		aops->readpages(rac->file, rac->mapping, pages,
>  				readahead_count(rac));
>  		/* Clean up the remaining pages */
> @@ -234,7 +241,8 @@ void force_page_cache_readahead(struct address_space *mapping,
>  	struct file_ra_state *ra = &filp->f_ra;
>  	unsigned long max_pages;
>
> -	if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages))
> +	if (unlikely(!mapping->a_ops->readpage && !mapping->a_ops->readpages &&
> +			!mapping->a_ops->readahead))
>  		return;
>
>  	/*
> -- 
> 2.25.0


--
Best Regards,
Yan Zi

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 854 bytes --]

^ permalink raw reply


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.