Skip to contentSkip to conversation

drivers/net/wan/lapbether: Added needed_tailroom

PATCH New Sasha Levin 1 participant 10 messages Sep 7, 2020

Subsystems (4)
lore
Share & tools
lore
author maintainer
#7 lore raw

PATCH 8/10 net: usb: dm9601: Add USB ID of Keenetic Plus DSL

In reply to Sasha Levin

From: Kamil Lorenc <[email protected]>

[ Upstream commit a609d0259183a841621f252e067f40f8cc25d6f6 ]

Keenetic Plus DSL is a xDSL modem that uses dm9620 as its USB interface.

---
 drivers/net/usb/dm9601.c | 4 ++++
 1 file changed, 4 insertions(+)
drivers/net/usb/dm9601.c +4 -0
index 0b4bdd39106b0..fb18801d0fe7b 100644
@@ -624,6 +624,10 @@ static const struct usb_device_id products[] = {
 	 USB_DEVICE(0x0a46, 0x1269),	/* DM9621A USB to Fast Ethernet Adapter */
 	 .driver_info = (unsigned long)&dm9601_info,
 	},
+	{
+	 USB_DEVICE(0x0586, 0x3427),	/* ZyXEL Keenetic Plus DSL xDSL modem */
+	 .driver_info = (unsigned long)&dm9601_info,
+	},
 	{},			// END
 };
 
Signature · 1 line
2.25.1
author maintainer
#2 lore raw

PATCH 3/10 drivers/net/wan/lapbether: Set network_header before transmitting

In reply to Sasha Levin

From: Xie He <[email protected]>

[ Upstream commit 91244d108441013b7367b3b4dcc6869998676473 ]

Set the skb's network_header before it is passed to the underlying Ethernet device for transmission.

This patch fixes the following issue:

When we use this driver with AF_PACKET sockets, there would be error messages of:
protocol 0805 is buggy, dev (Ethernet interface name)
printed in the system "dmesg" log.

This is because skbs passed down to the Ethernet device for transmission don't have their network_header properly set, and the dev_queue_xmit_nit function in net/core/dev.c complains about this.

Reason of setting the network_header to this place (at the end of the Ethernet header, and at the beginning of the Ethernet payload):

Because when this driver receives an skb from the Ethernet device, the network_header is also set at this place.

---
 drivers/net/wan/lapbether.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/wan/lapbether.c +2 -0
index 5befc7f3f0e7a..c6db9a4e7c457 100644
@@ -213,6 +213,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb)
 
 	skb->dev = dev = lapbeth->ethdev;
 
+	skb_reset_network_header(skb);
+
 	dev_hard_header(skb, dev, ETH_P_DEC, bcast_addr, NULL, 0);
 
 	dev_queue_xmit(skb);
Signature · 1 line
2.25.1
author maintainer
#6 lore raw

PATCH 7/10 drivers/net/wan/hdlc_cisco: Add hard_header_len

In reply to Sasha Levin

From: Xie He <[email protected]>

[ Upstream commit 1a545ebe380bf4c1433e3c136e35a77764fda5ad ]

This driver didn't set hard_header_len. This patch sets hard_header_len for it according to its header_ops->create function.

This driver's header_ops->create function (cisco_hard_header) creates a header of (struct hdlc_header), so hard_header_len should be set to sizeof(struct hdlc_header).

---
 drivers/net/wan/hdlc_cisco.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wan/hdlc_cisco.c +1 -0
index 3f20808b5ff82..f8ed079d8bc3e 100644
@@ -377,6 +377,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)
 		memcpy(&state(hdlc)->settings, &new_settings, size);
 		spin_lock_init(&state(hdlc)->lock);
 		dev->header_ops = &cisco_header_ops;
+		dev->hard_header_len = sizeof(struct hdlc_header);
 		dev->type = ARPHRD_CISCO;
 		netif_dormant_on(dev);
 		return 0;
Signature · 1 line
2.25.1

Sasha Levin

author maintainer
#0 lore raw

PATCH 1/10 drivers/net/wan/lapbether: Added needed_tailroom

From: Xie He <[email protected]>

[ Upstream commit 1ee39c1448c4e0d480c5b390e2db1987561fb5c2 ]

The underlying Ethernet device may request necessary tailroom to be allocated by setting needed_tailroom. This driver should also set needed_tailroom to request the tailroom needed by the underlying Ethernet device to be allocated.

---
 drivers/net/wan/lapbether.c | 1 +
 1 file changed, 1 insertion(+)
drivers/net/wan/lapbether.c +1 -0
index 6eb0f7a85e531..5befc7f3f0e7a 100644
@@ -343,6 +343,7 @@ static int lapbeth_new_device(struct net_device *dev)
 	 */
 	ndev->needed_headroom = -1 + 3 + 2 + dev->hard_header_len
 					   + dev->needed_headroom;
+	ndev->needed_tailroom = dev->needed_tailroom;
 
 	lapbeth = netdev_priv(ndev);
 	lapbeth->axdev = ndev;
Signature · 1 line
2.25.1
author maintainer
#5 lore raw

PATCH 6/10 xfs: initialize the shortform attr header padding entry

From: "Darrick J. Wong" <[email protected]>

[ Upstream commit 125eac243806e021f33a1fdea3687eccbb9f7636 ]

Don't leak kernel memory contents into the shortform attr fork.

---
 fs/xfs/libxfs/xfs_attr_leaf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/libxfs/xfs_attr_leaf.c +2 -2
index 445a3f2f871fb..da8747b870df3 100644
@@ -514,8 +514,8 @@ xfs_attr_shortform_create(xfs_da_args_t *args)
 		ASSERT(ifp->if_flags & XFS_IFINLINE);
 	}
 	xfs_idata_realloc(dp, sizeof(*hdr), XFS_ATTR_FORK);
-	hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data;
-	hdr->count = 0;
+	hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data;
+	memset(hdr, 0, sizeof(*hdr));
 	hdr->totsize = cpu_to_be16(sizeof(*hdr));
 	xfs_trans_log_inode(args->trans, dp, XFS_ILOG_CORE | XFS_ILOG_ADATA);
 }
Signature · 1 line
2.25.1
author maintainer
#8 lore raw

PATCH 9/10 ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled

In reply to Sasha Levin

From: Rander Wang <[email protected]>

[ Upstream commit 13774d81f38538c5fa2924bdcdfa509155480fa6 ]

In snd_hdac_device_init pm_runtime_set_active is called to increase child_count in parent device. But when it is failed to build connection with GPU for one case that integrated graphic gpu is disabled, snd_hdac_ext_bus_device_exit will be invoked to clean up a HD-audio extended codec base device. At this time the child_count of parent is not decreased, which makes parent device can't get suspended.

This patch calls pm_runtime_set_suspended to decrease child_count in parent device in snd_hdac_device_exit to match with snd_hdac_device_init. pm_runtime_set_suspended can make sure that it will not decrease child_count if the device is already suspended.

---
 sound/hda/hdac_device.c | 2 ++
 1 file changed, 2 insertions(+)
sound/hda/hdac_device.c +2 -0
index e361024eabb63..020ec48f39048 100644
@@ -123,6 +123,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init);
 void snd_hdac_device_exit(struct hdac_device *codec)
 {
 	pm_runtime_put_noidle(&codec->dev);
+	/* keep balance of runtime PM child_count in parent device */
+	pm_runtime_set_suspended(&codec->dev);
 	snd_hdac_bus_remove_device(codec->bus, codec);
 	kfree(codec->vendor_name);
 	kfree(codec->chip_name);
Signature · 1 line
2.25.1
author maintainer
#9 lore raw

PATCH 10/10 gcov: Disable gcov build with GCC 10

In reply to Sasha Levin

From: Leon Romanovsky <[email protected]>

[ Upstream commit cfc905f158eaa099d6258031614d11869e7ef71c ]

GCOV built with GCC 10 doesn't initialize n_function variable. This produces different kernel panics as was seen by Colin in Ubuntu and me in FC 32.

As a workaround, let's disable GCOV build for broken GCC 10 version.

---
 kernel/gcov/Kconfig | 1 +
 1 file changed, 1 insertion(+)
kernel/gcov/Kconfig +1 -0
index 1276aabaab550..1d78ed19a3512 100644
@@ -3,6 +3,7 @@ menu "GCOV-based kernel profiling"
 config GCOV_KERNEL
 	bool "Enable gcov-based kernel profiling"
 	depends on DEBUG_FS
+	depends on !CC_IS_GCC || GCC_VERSION < 100000
 	select CONSTRUCTORS if !UML
 	default n
 	---help---
Signature · 1 line
2.25.1
author maintainer
#4 lore raw

PATCH 5/10 net: usb: Fix uninit-was-stored issue in asix_read_phy_addr()

In reply to Sasha Levin

From: Himadri Pandya <[email protected]>

[ Upstream commit a092b7233f0e000cc6f2c71a49e2ecc6f917a5fc ]

The buffer size is 2 Bytes and we expect to receive the same amount of data. But sometimes we receive less data and run into uninit-was-stored issue upon read. Hence modify the error check on the return value to match with the buffer size as a prevention.

Reported-and-tested by: [email protected]

---
 drivers/net/usb/asix_common.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/asix_common.c +1 -1
index 2092ef6431f20..712765976a221 100644
@@ -251,7 +251,7 @@ int asix_read_phy_addr(struct usbnet *dev, int internal)
 
 	netdev_dbg(dev->net, "asix_get_phy_addr()\n");
 
-	if (ret < 0) {
+	if (ret < 2) {
 		netdev_err(dev->net, "Error reading PHYID register: %02x\n", ret);
 		goto out;
 	}
Signature · 1 line
2.25.1
author maintainer
#3 lore raw

PATCH 4/10 cfg80211: regulatory: reject invalid hints

In reply to Sasha Levin

From: Johannes Berg <[email protected]>

[ Upstream commit 47caf685a6854593348f216e0b489b71c10cbe03 ]

Reject invalid hints early in order to not cause a kernel WARN later if they're restored to or similar.

---
 net/wireless/reg.c | 3 +++
 1 file changed, 3 insertions(+)
net/wireless/reg.c +3 -0
index 437ec52d5e71f..474923175b108 100644
@@ -2383,6 +2383,9 @@ int regulatory_hint_user(const char *alpha2,
 	if (WARN_ON(!alpha2))
 		return -EINVAL;
 
+	if (!is_world_regdom(alpha2) && !is_an_alpha2(alpha2))
+		return -EINVAL;
+
 	request = kzalloc(sizeof(struct regulatory_request), GFP_KERNEL);
 	if (!request)
 		return -ENOMEM;
Signature · 1 line
2.25.1
author maintainer
#1 lore raw

PATCH 2/10 firestream: Fix memleak in fs_open

In reply to Sasha Levin

From: Dinghao Liu <[email protected]>

[ Upstream commit 15ac5cdafb9202424206dc5bd376437a358963f9 ]

When make_rate() fails, vcc should be freed just like other error paths in fs_open().

---
 drivers/atm/firestream.c | 1 +
 1 file changed, 1 insertion(+)
drivers/atm/firestream.c +1 -0
index 04b39d0da8681..70708608ab1e7 100644
@@ -1009,6 +1009,7 @@ static int fs_open(struct atm_vcc *atm_vcc)
 				error = make_rate (pcr, r, &tmc0, NULL);
 				if (error) {
 					kfree(tc);
+					kfree(vcc);
 					return error;
 				}
 			}
Signature · 1 line
2.25.1