From 26cee6a38c54fd955bd11c007e2789d356686fa6 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 22 Jan 2021 14:53:15 +0100 Subject: [PATCH] 5.10-stable patches added patches: cxgb4-chtls-fix-tid-stuck-due-to-wrong-update-of-qid.patch drm-panel-otm8009a-allow-using-non-continuous-dsi-clock.patch mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch net-dsa-unbind-all-switches-from-tree-when-dsa-master-unbinds.patch spi-cadence-cache-reference-clock-rate-during-probe.patch spi-fsl-fix-driver-breakage-when-spi_cs_high-is-not-set-in-spi-mode.patch --- ...tid-stuck-due-to-wrong-update-of-qid.patch | 190 ++++++++++++++++++ ...allow-using-non-continuous-dsi-clock.patch | 39 ++++ ...disabled-in-__ieee80211_schedule_txq.patch | 39 ++++ ...-nulldata-packets-on-encrypted-links.patch | 36 ++++ ...es-from-tree-when-dsa-master-unbinds.patch | 117 +++++++++++ queue-5.10/series | 7 + ...he-reference-clock-rate-during-probe.patch | 53 +++++ ...n-spi_cs_high-is-not-set-in-spi-mode.patch | 54 +++++ 8 files changed, 535 insertions(+) create mode 100644 queue-5.10/cxgb4-chtls-fix-tid-stuck-due-to-wrong-update-of-qid.patch create mode 100644 queue-5.10/drm-panel-otm8009a-allow-using-non-continuous-dsi-clock.patch create mode 100644 queue-5.10/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch create mode 100644 queue-5.10/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch create mode 100644 queue-5.10/net-dsa-unbind-all-switches-from-tree-when-dsa-master-unbinds.patch create mode 100644 queue-5.10/spi-cadence-cache-reference-clock-rate-during-probe.patch create mode 100644 queue-5.10/spi-fsl-fix-driver-breakage-when-spi_cs_high-is-not-set-in-spi-mode.patch diff --git a/queue-5.10/cxgb4-chtls-fix-tid-stuck-due-to-wrong-update-of-qid.patch b/queue-5.10/cxgb4-chtls-fix-tid-stuck-due-to-wrong-update-of-qid.patch new file mode 100644 index 00000000000..6fcca305d53 --- /dev/null +++ b/queue-5.10/cxgb4-chtls-fix-tid-stuck-due-to-wrong-update-of-qid.patch @@ -0,0 +1,190 @@ +From 8ad2a970d2010add3963e7219eb50367ab3fa4eb Mon Sep 17 00:00:00 2001 +From: Ayush Sawal +Date: Tue, 12 Jan 2021 11:06:00 +0530 +Subject: cxgb4/chtls: Fix tid stuck due to wrong update of qid + +From: Ayush Sawal + +commit 8ad2a970d2010add3963e7219eb50367ab3fa4eb upstream. + +TID stuck is seen when there is a race in +CPL_PASS_ACCEPT_RPL/CPL_ABORT_REQ and abort is arriving +before the accept reply, which sets the queue number. +In this case HW ends up sending CPL_ABORT_RPL_RSS to an +incorrect ingress queue. + +V1->V2: +- Removed the unused variable len in chtls_set_quiesce_ctrl(). + +V2->V3: +- As kfree_skb() has a check for null skb, so removed this +check before calling kfree_skb() in func chtls_send_reset(). + +Fixes: cc35c88ae4db ("crypto : chtls - CPL handler definition") +Signed-off-by: Rohit Maheshwari +Signed-off-by: Ayush Sawal +Link: https://lore.kernel.org/r/20210112053600.24590-1-ayush.sawal@chelsio.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h | 7 ++ + drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h | 4 + + drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c | 32 ++++++++- + drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c | 41 ++++++++++++ + 4 files changed, 82 insertions(+), 2 deletions(-) + +--- a/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h ++++ b/drivers/net/ethernet/chelsio/cxgb4/t4_tcb.h +@@ -40,6 +40,13 @@ + #define TCB_L2T_IX_M 0xfffULL + #define TCB_L2T_IX_V(x) ((x) << TCB_L2T_IX_S) + ++#define TCB_T_FLAGS_W 1 ++#define TCB_T_FLAGS_S 0 ++#define TCB_T_FLAGS_M 0xffffffffffffffffULL ++#define TCB_T_FLAGS_V(x) ((__u64)(x) << TCB_T_FLAGS_S) ++ ++#define TCB_FIELD_COOKIE_TFLAG 1 ++ + #define TCB_SMAC_SEL_W 0 + #define TCB_SMAC_SEL_S 24 + #define TCB_SMAC_SEL_M 0xffULL +--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h ++++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls.h +@@ -573,7 +573,11 @@ int send_tx_flowc_wr(struct sock *sk, in + void chtls_tcp_push(struct sock *sk, int flags); + int chtls_push_frames(struct chtls_sock *csk, int comp); + int chtls_set_tcb_tflag(struct sock *sk, unsigned int bit_pos, int val); ++void chtls_set_tcb_field_rpl_skb(struct sock *sk, u16 word, ++ u64 mask, u64 val, u8 cookie, ++ int through_l2t); + int chtls_setkey(struct chtls_sock *csk, u32 keylen, u32 mode, int cipher_type); ++void chtls_set_quiesce_ctrl(struct sock *sk, int val); + void skb_entail(struct sock *sk, struct sk_buff *skb, int flags); + unsigned int keyid_to_addr(int start_addr, int keyid); + void free_tls_keyid(struct sock *sk); +--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c ++++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_cm.c +@@ -32,6 +32,7 @@ + #include "chtls.h" + #include "chtls_cm.h" + #include "clip_tbl.h" ++#include "t4_tcb.h" + + /* + * State transitions and actions for close. Note that if we are in SYN_SENT +@@ -267,7 +268,9 @@ static void chtls_send_reset(struct sock + if (sk->sk_state != TCP_SYN_RECV) + chtls_send_abort(sk, mode, skb); + else +- goto out; ++ chtls_set_tcb_field_rpl_skb(sk, TCB_T_FLAGS_W, ++ TCB_T_FLAGS_V(TCB_T_FLAGS_M), 0, ++ TCB_FIELD_COOKIE_TFLAG, 1); + + return; + out: +@@ -1948,6 +1951,8 @@ static void chtls_close_con_rpl(struct s + else if (tcp_sk(sk)->linger2 < 0 && + !csk_flag_nochk(csk, CSK_ABORT_SHUTDOWN)) + chtls_abort_conn(sk, skb); ++ else if (csk_flag_nochk(csk, CSK_TX_DATA_SENT)) ++ chtls_set_quiesce_ctrl(sk, 0); + break; + default: + pr_info("close_con_rpl in bad state %d\n", sk->sk_state); +@@ -2291,6 +2296,28 @@ static int chtls_wr_ack(struct chtls_dev + return 0; + } + ++static int chtls_set_tcb_rpl(struct chtls_dev *cdev, struct sk_buff *skb) ++{ ++ struct cpl_set_tcb_rpl *rpl = cplhdr(skb) + RSS_HDR; ++ unsigned int hwtid = GET_TID(rpl); ++ struct sock *sk; ++ ++ sk = lookup_tid(cdev->tids, hwtid); ++ ++ /* return EINVAL if socket doesn't exist */ ++ if (!sk) ++ return -EINVAL; ++ ++ /* Reusing the skb as size of cpl_set_tcb_field structure ++ * is greater than cpl_abort_req ++ */ ++ if (TCB_COOKIE_G(rpl->cookie) == TCB_FIELD_COOKIE_TFLAG) ++ chtls_send_abort(sk, CPL_ABORT_SEND_RST, NULL); ++ ++ kfree_skb(skb); ++ return 0; ++} ++ + chtls_handler_func chtls_handlers[NUM_CPL_CMDS] = { + [CPL_PASS_OPEN_RPL] = chtls_pass_open_rpl, + [CPL_CLOSE_LISTSRV_RPL] = chtls_close_listsrv_rpl, +@@ -2303,5 +2330,6 @@ chtls_handler_func chtls_handlers[NUM_CP + [CPL_CLOSE_CON_RPL] = chtls_conn_cpl, + [CPL_ABORT_REQ_RSS] = chtls_conn_cpl, + [CPL_ABORT_RPL_RSS] = chtls_conn_cpl, +- [CPL_FW4_ACK] = chtls_wr_ack, ++ [CPL_FW4_ACK] = chtls_wr_ack, ++ [CPL_SET_TCB_RPL] = chtls_set_tcb_rpl, + }; +--- a/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c ++++ b/drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_hw.c +@@ -88,6 +88,24 @@ static int chtls_set_tcb_field(struct so + return ret < 0 ? ret : 0; + } + ++void chtls_set_tcb_field_rpl_skb(struct sock *sk, u16 word, ++ u64 mask, u64 val, u8 cookie, ++ int through_l2t) ++{ ++ struct sk_buff *skb; ++ unsigned int wrlen; ++ ++ wrlen = sizeof(struct cpl_set_tcb_field) + sizeof(struct ulptx_idata); ++ wrlen = roundup(wrlen, 16); ++ ++ skb = alloc_skb(wrlen, GFP_KERNEL | __GFP_NOFAIL); ++ if (!skb) ++ return; ++ ++ __set_tcb_field(sk, skb, word, mask, val, cookie, 0); ++ send_or_defer(sk, tcp_sk(sk), skb, through_l2t); ++} ++ + /* + * Set one of the t_flags bits in the TCB. + */ +@@ -113,6 +131,29 @@ static int chtls_set_tcb_quiesce(struct + TF_RX_QUIESCE_V(val)); + } + ++void chtls_set_quiesce_ctrl(struct sock *sk, int val) ++{ ++ struct chtls_sock *csk; ++ struct sk_buff *skb; ++ unsigned int wrlen; ++ int ret; ++ ++ wrlen = sizeof(struct cpl_set_tcb_field) + sizeof(struct ulptx_idata); ++ wrlen = roundup(wrlen, 16); ++ ++ skb = alloc_skb(wrlen, GFP_ATOMIC); ++ if (!skb) ++ return; ++ ++ csk = rcu_dereference_sk_user_data(sk); ++ ++ __set_tcb_field(sk, skb, 1, TF_RX_QUIESCE_V(1), 0, 0, 1); ++ set_wr_txq(skb, CPL_PRIORITY_CONTROL, csk->port_id); ++ ret = cxgb4_ofld_send(csk->egress_dev, skb); ++ if (ret < 0) ++ kfree_skb(skb); ++} ++ + /* TLS Key bitmap processing */ + int chtls_init_kmap(struct chtls_dev *cdev, struct cxgb4_lld_info *lldi) + { diff --git a/queue-5.10/drm-panel-otm8009a-allow-using-non-continuous-dsi-clock.patch b/queue-5.10/drm-panel-otm8009a-allow-using-non-continuous-dsi-clock.patch new file mode 100644 index 00000000000..ff5595cb770 --- /dev/null +++ b/queue-5.10/drm-panel-otm8009a-allow-using-non-continuous-dsi-clock.patch @@ -0,0 +1,39 @@ +From 880ee3b7615e7cc087f659cb80ce22f5db56f9a2 Mon Sep 17 00:00:00 2001 +From: Antonio Borneo +Date: Tue, 22 Sep 2020 09:42:53 +0200 +Subject: drm/panel: otm8009a: allow using non-continuous dsi clock + +From: Antonio Borneo + +commit 880ee3b7615e7cc087f659cb80ce22f5db56f9a2 upstream. + +The panel is able to work when dsi clock is non-continuous, thus +the system power consumption can be reduced using such feature. + +Add MIPI_DSI_CLOCK_NON_CONTINUOUS to panel's mode_flags. + +Changes in v2: + - Added my signed-off + +Signed-off-by: Antonio Borneo +Signed-off-by: Yannick Fertre +Signed-off-by: Sam Ravnborg +Link: https://patchwork.freedesktop.org/patch/msgid/20200922074253.28810-1-yannick.fertre@st.com +Cc: "Alex G." +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/gpu/drm/panel/panel-orisetech-otm8009a.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c ++++ b/drivers/gpu/drm/panel/panel-orisetech-otm8009a.c +@@ -452,7 +452,7 @@ static int otm8009a_probe(struct mipi_ds + dsi->lanes = 2; + dsi->format = MIPI_DSI_FMT_RGB888; + dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | +- MIPI_DSI_MODE_LPM; ++ MIPI_DSI_MODE_LPM | MIPI_DSI_CLOCK_NON_CONTINUOUS; + + drm_panel_init(&ctx->panel, dev, &otm8009a_drm_funcs, + DRM_MODE_CONNECTOR_DSI); diff --git a/queue-5.10/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch b/queue-5.10/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch new file mode 100644 index 00000000000..5df12abed56 --- /dev/null +++ b/queue-5.10/mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch @@ -0,0 +1,39 @@ +From c13cf5c159660451c8fbdc37efb998b198e1d305 Mon Sep 17 00:00:00 2001 +From: Lorenzo Bianconi +Date: Sat, 26 Dec 2020 10:39:08 +0100 +Subject: mac80211: check if atf has been disabled in __ieee80211_schedule_txq +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Lorenzo Bianconi + +commit c13cf5c159660451c8fbdc37efb998b198e1d305 upstream. + +Check if atf has been disabled in __ieee80211_schedule_txq() in order to +avoid a given sta is always put to the beginning of the active_txqs list +and never moved to the end since deficit is not decremented in +ieee80211_sta_register_airtime() + +Fixes: b4809e9484da1 ("mac80211: Add airtime accounting and scheduling to TXQs") +Signed-off-by: Lorenzo Bianconi +Acked-by: Toke Høiland-Jørgensen +Link: https://lore.kernel.org/r/93889406c50f1416214c079ca0b8c9faecc5143e.1608975195.git.lorenzo@kernel.org +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/tx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -3836,7 +3836,7 @@ void __ieee80211_schedule_txq(struct iee + * get immediately moved to the back of the list on the next + * call to ieee80211_next_txq(). + */ +- if (txqi->txq.sta && ++ if (txqi->txq.sta && local->airtime_flags && + wiphy_ext_feature_isset(local->hw.wiphy, + NL80211_EXT_FEATURE_AIRTIME_FAIRNESS)) + list_add(&txqi->schedule_order, diff --git a/queue-5.10/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch b/queue-5.10/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch new file mode 100644 index 00000000000..321bacbb779 --- /dev/null +++ b/queue-5.10/mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch @@ -0,0 +1,36 @@ +From 2463ec86cd0338a2c2edbfb0b9d50c52ff76ff43 Mon Sep 17 00:00:00 2001 +From: Felix Fietkau +Date: Fri, 18 Dec 2020 20:15:25 +0100 +Subject: mac80211: do not drop tx nulldata packets on encrypted links + +From: Felix Fietkau + +commit 2463ec86cd0338a2c2edbfb0b9d50c52ff76ff43 upstream. + +ieee80211_tx_h_select_key drops any non-mgmt packets without a key when +encryption is used. This is wrong for nulldata packets that can't be +encrypted and are sent out for probing clients and indicating 4-address +mode. + +Reported-by: Sebastian Gottschall +Fixes: a0761a301746 ("mac80211: drop data frames without key on encrypted links") +Signed-off-by: Felix Fietkau +Link: https://lore.kernel.org/r/20201218191525.1168-1-nbd@nbd.name +Signed-off-by: Johannes Berg +Signed-off-by: Greg Kroah-Hartman + +--- + net/mac80211/tx.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/net/mac80211/tx.c ++++ b/net/mac80211/tx.c +@@ -662,7 +662,7 @@ ieee80211_tx_h_select_key(struct ieee802 + if (!skip_hw && tx->key && + tx->key->flags & KEY_FLAG_UPLOADED_TO_HARDWARE) + info->control.hw_key = &tx->key->conf; +- } else if (!ieee80211_is_mgmt(hdr->frame_control) && tx->sta && ++ } else if (ieee80211_is_data_present(hdr->frame_control) && tx->sta && + test_sta_flag(tx->sta, WLAN_STA_USES_ENCRYPTION)) { + return TX_DROP; + } diff --git a/queue-5.10/net-dsa-unbind-all-switches-from-tree-when-dsa-master-unbinds.patch b/queue-5.10/net-dsa-unbind-all-switches-from-tree-when-dsa-master-unbinds.patch new file mode 100644 index 00000000000..0773ed23e74 --- /dev/null +++ b/queue-5.10/net-dsa-unbind-all-switches-from-tree-when-dsa-master-unbinds.patch @@ -0,0 +1,117 @@ +From 07b90056cb15ff9877dca0d8f1b6583d1051f724 Mon Sep 17 00:00:00 2001 +From: Vladimir Oltean +Date: Tue, 12 Jan 2021 01:09:43 +0200 +Subject: net: dsa: unbind all switches from tree when DSA master unbinds + +From: Vladimir Oltean + +commit 07b90056cb15ff9877dca0d8f1b6583d1051f724 upstream. + +Currently the following happens when a DSA master driver unbinds while +there are DSA switches attached to it: + +$ echo 0000:00:00.5 > /sys/bus/pci/drivers/mscc_felix/unbind +------------[ cut here ]------------ +WARNING: CPU: 0 PID: 392 at net/core/dev.c:9507 +Call trace: + rollback_registered_many+0x5fc/0x688 + unregister_netdevice_queue+0x98/0x120 + dsa_slave_destroy+0x4c/0x88 + dsa_port_teardown.part.16+0x78/0xb0 + dsa_tree_teardown_switches+0x58/0xc0 + dsa_unregister_switch+0x104/0x1b8 + felix_pci_remove+0x24/0x48 + pci_device_remove+0x48/0xf0 + device_release_driver_internal+0x118/0x1e8 + device_driver_detach+0x28/0x38 + unbind_store+0xd0/0x100 + +Located at the above location is this WARN_ON: + + /* Notifier chain MUST detach us all upper devices. */ + WARN_ON(netdev_has_any_upper_dev(dev)); + +Other stacked interfaces, like VLAN, do indeed listen for +NETDEV_UNREGISTER on the real_dev and also unregister themselves at that +time, which is clearly the behavior that rollback_registered_many +expects. But DSA interfaces are not VLAN. They have backing hardware +(platform devices, PCI devices, MDIO, SPI etc) which have a life cycle +of their own and we can't just trigger an unregister from the DSA +framework when we receive a netdev notifier that the master unregisters. + +Luckily, there is something we can do, and that is to inform the driver +core that we have a runtime dependency to the DSA master interface's +device, and create a device link where that is the supplier and we are +the consumer. Having this device link will make the DSA switch unbind +before the DSA master unbinds, which is enough to avoid the WARN_ON from +rollback_registered_many. + +Note that even before the blamed commit, DSA did nothing intelligent +when the master interface got unregistered either. See the discussion +here: +https://lore.kernel.org/netdev/20200505210253.20311-1-f.fainelli@gmail.com/ +But this time, at least the WARN_ON is loud enough that the +upper_dev_link commit can be blamed. + +The advantage with this approach vs dev_hold(master) in the attached +link is that the latter is not meant for long term reference counting. +With dev_hold, the only thing that will happen is that when the user +attempts an unbind of the DSA master, netdev_wait_allrefs will keep +waiting and waiting, due to DSA keeping the refcount forever. DSA would +not access freed memory corresponding to the master interface, but the +unbind would still result in a freeze. Whereas with device links, +graceful teardown is ensured. It even works with cascaded DSA trees. + +$ echo 0000:00:00.2 > /sys/bus/pci/drivers/fsl_enetc/unbind +[ 1818.797546] device swp0 left promiscuous mode +[ 1819.301112] sja1105 spi2.0: Link is Down +[ 1819.307981] DSA: tree 1 torn down +[ 1819.312408] device eno2 left promiscuous mode +[ 1819.656803] mscc_felix 0000:00:00.5: Link is Down +[ 1819.667194] DSA: tree 0 torn down +[ 1819.711557] fsl_enetc 0000:00:00.2 eno2: Link is Down + +This approach allows us to keep the DSA framework absolutely unchanged, +and the driver core will just know to unbind us first when the master +goes away - as opposed to the large (and probably impossible) rework +required if attempting to listen for NETDEV_UNREGISTER. + +As per the documentation at Documentation/driver-api/device_link.rst, +specifying the DL_FLAG_AUTOREMOVE_CONSUMER flag causes the device link +to be automatically purged when the consumer fails to probe or later +unbinds. So we don't need to keep the consumer_link variable in struct +dsa_switch. + +Fixes: 2f1e8ea726e9 ("net: dsa: link interfaces with the DSA master to get rid of lockdep warnings") +Signed-off-by: Vladimir Oltean +Reviewed-by: Florian Fainelli +Tested-by: Florian Fainelli +Link: https://lore.kernel.org/r/20210111230943.3701806-1-olteanv@gmail.com +Signed-off-by: Jakub Kicinski +Signed-off-by: Greg Kroah-Hartman + +--- + net/dsa/master.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +--- a/net/dsa/master.c ++++ b/net/dsa/master.c +@@ -308,8 +308,18 @@ static struct lock_class_key dsa_master_ + + int dsa_master_setup(struct net_device *dev, struct dsa_port *cpu_dp) + { ++ struct dsa_switch *ds = cpu_dp->ds; ++ struct device_link *consumer_link; + int ret; + ++ /* The DSA master must use SET_NETDEV_DEV for this to work. */ ++ consumer_link = device_link_add(ds->dev, dev->dev.parent, ++ DL_FLAG_AUTOREMOVE_CONSUMER); ++ if (!consumer_link) ++ netdev_err(dev, ++ "Failed to create a device link to DSA switch %s\n", ++ dev_name(ds->dev)); ++ + rtnl_lock(); + ret = dev_set_mtu(dev, ETH_DATA_LEN + cpu_dp->tag_ops->overhead); + rtnl_unlock(); diff --git a/queue-5.10/series b/queue-5.10/series index 7a37b762e53..ee9314a678b 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -34,3 +34,10 @@ net-dsa-clear-devlink-port-type-before-unregistering-slave-netdevs.patch rxrpc-fix-handling-of-an-unsupported-token-type-in-rxrpc_read.patch net-stmmac-use-__napi_schedule-for-preempt_rt.patch can-mcp251xfd-mcp251xfd_handle_rxif_one-fix-wrong-null-pointer-check.patch +drm-panel-otm8009a-allow-using-non-continuous-dsi-clock.patch +mac80211-do-not-drop-tx-nulldata-packets-on-encrypted-links.patch +mac80211-check-if-atf-has-been-disabled-in-__ieee80211_schedule_txq.patch +net-dsa-unbind-all-switches-from-tree-when-dsa-master-unbinds.patch +cxgb4-chtls-fix-tid-stuck-due-to-wrong-update-of-qid.patch +spi-fsl-fix-driver-breakage-when-spi_cs_high-is-not-set-in-spi-mode.patch +spi-cadence-cache-reference-clock-rate-during-probe.patch diff --git a/queue-5.10/spi-cadence-cache-reference-clock-rate-during-probe.patch b/queue-5.10/spi-cadence-cache-reference-clock-rate-during-probe.patch new file mode 100644 index 00000000000..0f6adf2ba87 --- /dev/null +++ b/queue-5.10/spi-cadence-cache-reference-clock-rate-during-probe.patch @@ -0,0 +1,53 @@ +From 4d163ad79b155c71bf30366dc38f8d2502f78844 Mon Sep 17 00:00:00 2001 +From: Michael Hennerich +Date: Thu, 14 Jan 2021 17:42:17 +0200 +Subject: spi: cadence: cache reference clock rate during probe + +From: Michael Hennerich + +commit 4d163ad79b155c71bf30366dc38f8d2502f78844 upstream. + +The issue is that using SPI from a callback under the CCF lock will +deadlock, since this code uses clk_get_rate(). + +Fixes: c474b38665463 ("spi: Add driver for Cadence SPI controller") +Signed-off-by: Michael Hennerich +Signed-off-by: Alexandru Ardelean +Link: https://lore.kernel.org/r/20210114154217.51996-1-alexandru.ardelean@analog.com +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-cadence.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/spi/spi-cadence.c ++++ b/drivers/spi/spi-cadence.c +@@ -115,6 +115,7 @@ struct cdns_spi { + void __iomem *regs; + struct clk *ref_clk; + struct clk *pclk; ++ unsigned int clk_rate; + u32 speed_hz; + const u8 *txbuf; + u8 *rxbuf; +@@ -250,7 +251,7 @@ static void cdns_spi_config_clock_freq(s + u32 ctrl_reg, baud_rate_val; + unsigned long frequency; + +- frequency = clk_get_rate(xspi->ref_clk); ++ frequency = xspi->clk_rate; + + ctrl_reg = cdns_spi_read(xspi, CDNS_SPI_CR); + +@@ -558,8 +559,9 @@ static int cdns_spi_probe(struct platfor + master->auto_runtime_pm = true; + master->mode_bits = SPI_CPOL | SPI_CPHA | SPI_CS_HIGH; + ++ xspi->clk_rate = clk_get_rate(xspi->ref_clk); + /* Set to default valid value */ +- master->max_speed_hz = clk_get_rate(xspi->ref_clk) / 4; ++ master->max_speed_hz = xspi->clk_rate / 4; + xspi->speed_hz = master->max_speed_hz; + + master->bits_per_word_mask = SPI_BPW_MASK(8); diff --git a/queue-5.10/spi-fsl-fix-driver-breakage-when-spi_cs_high-is-not-set-in-spi-mode.patch b/queue-5.10/spi-fsl-fix-driver-breakage-when-spi_cs_high-is-not-set-in-spi-mode.patch new file mode 100644 index 00000000000..bea01bb4a2b --- /dev/null +++ b/queue-5.10/spi-fsl-fix-driver-breakage-when-spi_cs_high-is-not-set-in-spi-mode.patch @@ -0,0 +1,54 @@ +From 7a2da5d7960a64ee923fe3e31f01a1101052c66f Mon Sep 17 00:00:00 2001 +From: Christophe Leroy +Date: Thu, 14 Jan 2021 13:09:37 +0000 +Subject: spi: fsl: Fix driver breakage when SPI_CS_HIGH is not set in spi->mode + +From: Christophe Leroy + +commit 7a2da5d7960a64ee923fe3e31f01a1101052c66f upstream. + +Commit 766c6b63aa04 ("spi: fix client driver breakages when using GPIO +descriptors") broke fsl spi driver. + +As now we fully rely on gpiolib for handling the polarity of +chip selects, the driver shall not alter the GPIO value anymore +when SPI_CS_HIGH is not set in spi->mode. + +Fixes: 766c6b63aa04 ("spi: fix client driver breakages when using GPIO descriptors") +Cc: stable@vger.kernel.org +Signed-off-by: Christophe Leroy +Link: https://lore.kernel.org/r/6b51cc2bfbca70d3e9b9da7b7aa4c7a9d793ca0e.1610629002.git.christophe.leroy@csgroup.eu +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-fsl-spi.c | 5 ++--- + 1 file changed, 2 insertions(+), 3 deletions(-) + +--- a/drivers/spi/spi-fsl-spi.c ++++ b/drivers/spi/spi-fsl-spi.c +@@ -115,14 +115,13 @@ static void fsl_spi_chipselect(struct sp + { + struct mpc8xxx_spi *mpc8xxx_spi = spi_master_get_devdata(spi->master); + struct fsl_spi_platform_data *pdata; +- bool pol = spi->mode & SPI_CS_HIGH; + struct spi_mpc8xxx_cs *cs = spi->controller_state; + + pdata = spi->dev.parent->parent->platform_data; + + if (value == BITBANG_CS_INACTIVE) { + if (pdata->cs_control) +- pdata->cs_control(spi, !pol); ++ pdata->cs_control(spi, false); + } + + if (value == BITBANG_CS_ACTIVE) { +@@ -134,7 +133,7 @@ static void fsl_spi_chipselect(struct sp + fsl_spi_change_mode(spi); + + if (pdata->cs_control) +- pdata->cs_control(spi, pol); ++ pdata->cs_control(spi, true); + } + } + -- 2.47.3