From 2223716d9e14bcb6c5f4b9efb2bf40cc307519f4 Mon Sep 17 00:00:00 2001 From: Sasha Levin Date: Wed, 27 Mar 2019 14:31:16 -0400 Subject: [PATCH] patches for 4.9 Signed-off-by: Sasha Levin --- ...e-various-nl80211-messages-correctly.patch | 109 ++++++++++++++++++ queue-4.9/series | 3 + ...unicast-mac-address-to-mac-registers.patch | 55 +++++++++ ...o-fbdev-set-pixclock-0-in-goldfishfb.patch | 36 ++++++ 4 files changed, 203 insertions(+) create mode 100644 queue-4.9/cfg80211-size-various-nl80211-messages-correctly.patch create mode 100644 queue-4.9/stmmac-copy-unicast-mac-address-to-mac-registers.patch create mode 100644 queue-4.9/video-fbdev-set-pixclock-0-in-goldfishfb.patch diff --git a/queue-4.9/cfg80211-size-various-nl80211-messages-correctly.patch b/queue-4.9/cfg80211-size-various-nl80211-messages-correctly.patch new file mode 100644 index 00000000000..8bda2dbe529 --- /dev/null +++ b/queue-4.9/cfg80211-size-various-nl80211-messages-correctly.patch @@ -0,0 +1,109 @@ +From ebb3064e9be2755fb953602b459f5e4ab230c8de Mon Sep 17 00:00:00 2001 +From: Johannes Berg +Date: Mon, 9 Jan 2017 11:10:42 +0100 +Subject: cfg80211: size various nl80211 messages correctly + +[ Upstream commit 4ef8c1c93f848e360754f10eb2e7134c872b6597 ] + +Ilan reported that sometimes nl80211 messages weren't working if +the frames being transported got very large, which was really a +problem for userspace-to-kernel messages, but prompted me to look +at the code. + +Upon review, I found various places where variable-length data is +transported in an nl80211 message but the message isn't allocated +taking that into account. This shouldn't cause any problems since +the frames aren't really that long, apart in one place where two +(possibly very long frames) might not fit. + +Fix all the places (that I found) that get variable length data +from the driver and put it into a message to take the length of +the variable data into account. The 100 there is just a safe +constant for the remaining message overhead (it's usually around +50 for most messages.) + +Signed-off-by: Johannes Berg +Signed-off-by: Sasha Levin +--- + net/wireless/nl80211.c | 16 ++++++++-------- + 1 file changed, 8 insertions(+), 8 deletions(-) + +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c +index 549d0a4083b3..09a353c6373a 100644 +--- a/net/wireless/nl80211.c ++++ b/net/wireless/nl80211.c +@@ -12942,7 +12942,7 @@ static void nl80211_send_mlme_event(struct cfg80211_registered_device *rdev, + struct sk_buff *msg; + void *hdr; + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); ++ msg = nlmsg_new(100 + len, gfp); + if (!msg) + return; + +@@ -13094,7 +13094,7 @@ void nl80211_send_connect_result(struct cfg80211_registered_device *rdev, + struct sk_buff *msg; + void *hdr; + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); ++ msg = nlmsg_new(100 + req_ie_len + resp_ie_len, gfp); + if (!msg) + return; + +@@ -13136,7 +13136,7 @@ void nl80211_send_roamed(struct cfg80211_registered_device *rdev, + struct sk_buff *msg; + void *hdr; + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); ++ msg = nlmsg_new(100 + req_ie_len + resp_ie_len, gfp); + if (!msg) + return; + +@@ -13173,7 +13173,7 @@ void nl80211_send_disconnected(struct cfg80211_registered_device *rdev, + struct sk_buff *msg; + void *hdr; + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ++ msg = nlmsg_new(100 + ie_len, GFP_KERNEL); + if (!msg) + return; + +@@ -13249,7 +13249,7 @@ void cfg80211_notify_new_peer_candidate(struct net_device *dev, const u8 *addr, + + trace_cfg80211_notify_new_peer_candidate(dev, addr); + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); ++ msg = nlmsg_new(100 + ie_len, gfp); + if (!msg) + return; + +@@ -13620,7 +13620,7 @@ int nl80211_send_mgmt(struct cfg80211_registered_device *rdev, + struct sk_buff *msg; + void *hdr; + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); ++ msg = nlmsg_new(100 + len, gfp); + if (!msg) + return -ENOMEM; + +@@ -13664,7 +13664,7 @@ void cfg80211_mgmt_tx_status(struct wireless_dev *wdev, u64 cookie, + + trace_cfg80211_mgmt_tx_status(wdev, cookie, ack); + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, gfp); ++ msg = nlmsg_new(100 + len, gfp); + if (!msg) + return; + +@@ -14473,7 +14473,7 @@ void cfg80211_ft_event(struct net_device *netdev, + if (!ft_event->target_ap) + return; + +- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); ++ msg = nlmsg_new(100 + ft_event->ric_ies_len, GFP_KERNEL); + if (!msg) + return; + +-- +2.19.1 + diff --git a/queue-4.9/series b/queue-4.9/series index 03f59929534..27ff845c264 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -1,2 +1,5 @@ bluetooth-check-l2cap-option-sizes-returned-from-l2cap_get_conf_opt.patch bluetooth-verify-that-l2cap_get_conf_opt-provides-large-enough-buffer.patch +video-fbdev-set-pixclock-0-in-goldfishfb.patch +cfg80211-size-various-nl80211-messages-correctly.patch +stmmac-copy-unicast-mac-address-to-mac-registers.patch diff --git a/queue-4.9/stmmac-copy-unicast-mac-address-to-mac-registers.patch b/queue-4.9/stmmac-copy-unicast-mac-address-to-mac-registers.patch new file mode 100644 index 00000000000..5984a601aad --- /dev/null +++ b/queue-4.9/stmmac-copy-unicast-mac-address-to-mac-registers.patch @@ -0,0 +1,55 @@ +From 8ba85e5ab1c0ba6e3804c6f3c70346e7c5a90273 Mon Sep 17 00:00:00 2001 +From: Bhadram Varka +Date: Fri, 27 Oct 2017 08:22:02 +0530 +Subject: stmmac: copy unicast mac address to MAC registers + +[ Upstream commit a830405ee452ddc4101c3c9334e6fedd42c6b357 ] + +Currently stmmac driver not copying the valid ethernet +MAC address to MAC registers. This patch takes care +of updating the MAC register with MAC address. + +Signed-off-by: Bhadram Varka +Signed-off-by: David S. Miller +Signed-off-by: Sasha Levin +--- + .../net/ethernet/stmicro/stmmac/stmmac_main.c | 16 +++++++++++++++- + 1 file changed, 15 insertions(+), 1 deletion(-) + +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +index 20a2b01b392c..fc437d75ac76 100644 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +@@ -2931,6 +2931,20 @@ static int stmmac_ioctl(struct net_device *dev, struct ifreq *rq, int cmd) + return ret; + } + ++static int stmmac_set_mac_address(struct net_device *ndev, void *addr) ++{ ++ struct stmmac_priv *priv = netdev_priv(ndev); ++ int ret = 0; ++ ++ ret = eth_mac_addr(ndev, addr); ++ if (ret) ++ return ret; ++ ++ priv->hw->mac->set_umac_addr(priv->hw, ndev->dev_addr, 0); ++ ++ return ret; ++} ++ + #ifdef CONFIG_DEBUG_FS + static struct dentry *stmmac_fs_dir; + +@@ -3137,7 +3151,7 @@ static const struct net_device_ops stmmac_netdev_ops = { + #ifdef CONFIG_NET_POLL_CONTROLLER + .ndo_poll_controller = stmmac_poll_controller, + #endif +- .ndo_set_mac_address = eth_mac_addr, ++ .ndo_set_mac_address = stmmac_set_mac_address, + }; + + /** +-- +2.19.1 + diff --git a/queue-4.9/video-fbdev-set-pixclock-0-in-goldfishfb.patch b/queue-4.9/video-fbdev-set-pixclock-0-in-goldfishfb.patch new file mode 100644 index 00000000000..b6ad5e51c2d --- /dev/null +++ b/queue-4.9/video-fbdev-set-pixclock-0-in-goldfishfb.patch @@ -0,0 +1,36 @@ +From 6a23b65dc5b895d0039364785bd29901e50433c9 Mon Sep 17 00:00:00 2001 +From: Christoffer Dall +Date: Tue, 3 Jul 2018 17:43:09 +0200 +Subject: video: fbdev: Set pixclock = 0 in goldfishfb + +[ Upstream commit ace6033ec5c356615eaa3582fb1946e9eaff6662 ] + +User space Android code identifies pixclock == 0 as a sign for emulation +and will set the frame rate to 60 fps when reading this value, which is +the desired outcome. + +Signed-off-by: Christoffer Dall +Signed-off-by: Peter Maydell +Signed-off-by: Roman Kiryanov +Signed-off-by: Bartlomiej Zolnierkiewicz +Signed-off-by: Sasha Levin +--- + drivers/video/fbdev/goldfishfb.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/drivers/video/fbdev/goldfishfb.c b/drivers/video/fbdev/goldfishfb.c +index 14a93cb21310..66d58e93bc32 100644 +--- a/drivers/video/fbdev/goldfishfb.c ++++ b/drivers/video/fbdev/goldfishfb.c +@@ -234,7 +234,7 @@ static int goldfish_fb_probe(struct platform_device *pdev) + fb->fb.var.activate = FB_ACTIVATE_NOW; + fb->fb.var.height = readl(fb->reg_base + FB_GET_PHYS_HEIGHT); + fb->fb.var.width = readl(fb->reg_base + FB_GET_PHYS_WIDTH); +- fb->fb.var.pixclock = 10000; ++ fb->fb.var.pixclock = 0; + + fb->fb.var.red.offset = 11; + fb->fb.var.red.length = 5; +-- +2.19.1 + -- 2.47.2