6.6.33-rc1 review
Subsystems (7)
Greg Kroah-Hartman
maintainerPATCH 258/744 net: fec: remove .ndo_poll_controller to avoid deadlocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wei Fang <[email protected]>
[ Upstream commit c2e0c58b25a0a0c37ec643255558c5af4450c9f5 ]
There is a deadlock issue found in sungem driver, please refer to the commit ac0a230f719b ("eth: sungem: remove .ndo_poll_controller to avoid deadlocks"). The root cause of the issue is that netpoll is in atomic context and disable_irq() is called by .ndo_poll_controller interface of sungem driver, however, disable_irq() might sleep. After analyzing the implementation of fec_poll_controller(), the fec driver should have the same issue. Due to the fec driver uses NAPI for TX completions, the .ndo_poll_controller is unnecessary to be implemented in the fec driver, so fec_poll_controller() can be safely removed.
--- drivers/net/ethernet/freescale/fec_main.c | 26 ----------------------- 1 file changed, 26 deletions(-)
drivers/net/ethernet/freescale/fec_main.c +0 -26
@@ -3657,29 +3657,6 @@ fec_set_mac_address(struct net_device *ndev, void *p)return 0 ; } -#ifdef CONFIG_NET_POLL_CONTROLLER -/** -* fec_poll_controller - FEC Poll controller function -* @dev: The FEC network adapter -* -* Polled functionality used by netconsole and others in non interrupt mode -* -*/ -static void fec_poll_controller (struct net_device *dev) -{ -int i; -struct fec_enet_private *fep =netdev_priv (dev); - -for (i =0 ; i <FEC_IRQ_NUM ; i++) { -if (fep->irq[i] >0 ) { -disable_irq (fep->irq[i]); -fec_enet_interrupt (fep->irq[i], dev); -enable_irq (fep->irq[i]); - } - } -} -#endif -static inline void fec_enet_set_netdev_features (struct net_device *netdev,netdev_features_t features) {
@@ -3986,9 +3963,6 @@ static const struct net_device_ops fec_netdev_ops = { .ndo_tx_timeout = fec_timeout, .ndo_set_mac_address = fec_set_mac_address, .ndo_eth_ioctl = phy_do_ioctl_running, -#ifdef CONFIG_NET_POLL_CONTROLLER - .ndo_poll_controller = fec_poll_controller, -#endif .ndo_set_features = fec_set_features, .ndo_bpf = fec_enet_bpf, .ndo_xdp_xmit = fec_enet_xdp_xmit,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 259/744 mptcp: SO_KEEPALIVE: fix getsockopt support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matthieu Baerts (NGI0) <[email protected]>
[ Upstream commit a65198136eaa15b74ee0abf73f12ef83d469a334 ]
SO_KEEPALIVE support has to be set on each subflow: on each TCP socket, where sk_prot->keepalive is defined. Technically, nothing has to be done on the MPTCP socket. That's why mptcp_sol_socket_sync_intval() was called instead of mptcp_sol_socket_intval().
Except that when nothing is done on the MPTCP socket, the getsockopt(SO_KEEPALIVE), handled in net/core/sock.c:sk_getsockopt(), will not know if SO_KEEPALIVE has been set on the different subflows or not.
The fix is simple: simply call mptcp_sol_socket_intval() which will end up calling net/core/sock.c:sk_setsockopt() where the SOCK_KEEPOPEN flag will be set, the one used in sk_getsockopt().
So now, getsockopt(SO_KEEPALIVE) on an MPTCP socket will return the same value as the one previously set with setsockopt(SO_KEEPALIVE).
--- net/mptcp/sockopt.c | 2 -- 1 file changed, 2 deletions(-)
net/mptcp/sockopt.c +0 -2
@@ -181,8 +181,6 @@ static int mptcp_setsockopt_sol_socket_int(struct mptcp_sock *msk, int optname,switch (optname) {case SO_KEEPALIVE : -mptcp_sol_socket_sync_intval (msk, optname, val); -return 0 ;case SO_DEBUG :case SO_MARK :case SO_PRIORITY :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 260/744 net: micrel: Fix receiving the timestamp in the frame for lan8841
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Horatiu Vultur <[email protected]>
[ Upstream commit aea27a92a41dae14843f92c79e9e42d8f570105c ]
The blamed commit started to use the ptp workqueue to get the second part of the timestamp. And when the port was set down, then this workqueue is stopped. But if the config option NETWORK_PHY_TIMESTAMPING is not enabled, then the ptp_clock is not initialized so then it would crash when it would try to access the delayed work.
So then basically by setting up and then down the port, it would crash. The fix consists in checking if the ptp_clock is initialized and only then cancel the delayed work.
--- drivers/net/phy/micrel.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/phy/micrel.c +2 -1
@@ -4612,7 +4612,8 @@ static int lan8841_suspend(struct phy_device *phydev)struct kszphy_priv *priv = phydev->priv;struct kszphy_ptp_priv *ptp_priv = &priv->ptp_priv; -ptp_cancel_worker_sync (ptp_priv->ptp_clock); +if (ptp_priv->ptp_clock) +ptp_cancel_worker_sync (ptp_priv->ptp_clock);return genphy_suspend (phydev); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 261/744 Bluetooth: compute LE flow credits based on recvbuf space
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Urban <[email protected]>
[ Upstream commit ce60b9231b66710b6ee24042ded26efee120ecfc ]
Previously LE flow credits were returned to the sender even if the socket's receive buffer was full. This meant that no back-pressure
was applied to the sender, thus it continued to send data, resulting in data loss without any error being reported. Furthermore, the amount of credits was essentially fixed to a small amount, leading to reduced performance.
This is fixed by computing the number of returned LE flow credits based on the estimated available space in the receive buffer of an L2CAP socket. Consequently, if the receive buffer is full, no credits are returned until the buffer is read and thus cleared by user-space.
Since the computation of available receive buffer space can only be performed approximately (due to sk_buff overhead) and the receive buffer size may be changed by user-space after flow credits have been sent, superfluous received data is temporary stored within l2cap_pinfo. This is necessary because Bluetooth LE provides no retransmission mechanism once the data has been acked by the physical layer.
If receive buffer space estimation is not possible at the moment, we fall back to providing credits for one full packet as before. This is currently the case during connection setup, when MPS is not yet available.
--- include/net/bluetooth/l2cap.h | 11 ++++- net/bluetooth/l2cap_core.c | 56 ++++++++++++++++++--- net/bluetooth/l2cap_sock.c | 91 ++++++++++++++++++++++++++++------- 3 files changed, 132 insertions(+), 26 deletions(-)
include/net/bluetooth/l2cap.h +10 -1
@@ -548,6 +548,9 @@ struct l2cap_chan {__u16 tx_credits;__u16 rx_credits; +/* estimated available receive buffer space or -1 if unknown */ +ssize_t rx_avail; +__u8 tx_state;__u8 rx_state;
@@ -682,10 +685,15 @@ struct l2cap_user {/* ----- L2CAP socket info ----- */ #define l2cap_pi (sk) ((struct l2cap_pinfo *) sk) +struct l2cap_rx_busy { +struct list_head list; +struct sk_buff *skb; +}; +struct l2cap_pinfo {struct bt_sock bt;struct l2cap_chan *chan; -struct sk_buff *rx_busy_skb; +struct list_head rx_busy; };enum {
@@ -943,6 +951,7 @@ int l2cap_chan_connect(struct l2cap_chan *chan, __le16 psm, u16 cid,int l2cap_chan_reconfigure (struct l2cap_chan *chan,__u16 mtu);int l2cap_chan_send (struct l2cap_chan *chan,struct msghdr *msg,size_t len);void l2cap_chan_busy (struct l2cap_chan *chan,int busy); +void l2cap_chan_rx_avail (struct l2cap_chan *chan,ssize_t rx_avail);int l2cap_chan_check_security (struct l2cap_chan *chan,bool initiator);void l2cap_chan_set_defaults (struct l2cap_chan *chan);int l2cap_ertm_init (struct l2cap_chan *chan);
net/bluetooth/l2cap_core.c +49 -7
104 lines not on this page · raw message
net/bluetooth/l2cap_sock.c +73 -18
166 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 262/744 Bluetooth: qca: Fix error code in qca_read_fw_build_info()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit a189f0ee6685457528db7a36ded3085e5d13ddc3 ]
Return -ENOMEM on allocation failure. Don't return success.
--- drivers/bluetooth/btqca.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/bluetooth/btqca.c +3 -1
@@ -148,8 +148,10 @@ static int qca_read_fw_build_info(struct hci_dev *hdev) } build_label =kstrndup (&edl->data[1 ], build_lbl_len,GFP_KERNEL ); -if (!build_label) +if (!build_label) { + err = -ENOMEM ; goto out; + }hci_set_fw_info (hdev,"%s" , build_label);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 263/744 Bluetooth: ISO: Fix BIS cleanup
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Iulia Tanasescu <[email protected]>
[ Upstream commit a254b90c9aac3d3d938a07e019773e35a977451b ]
This fixes the master BIS cleanup procedure - as opposed to CIS cleanup, no HCI disconnect command should be issued. A master BIS should only be terminated by disabling periodic and extended advertising, and terminating the BIG.
In case of a Broadcast Receiver, all BIS and PA connections can be cleaned up by calling hci_conn_failed, since it contains all function calls that are necessary for successful cleanup.
Stable-dep-of: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
--- include/net/bluetooth/hci_sync.h | 2 ++ net/bluetooth/hci_conn.c | 7 +++++++ net/bluetooth/hci_sync.c | 28 ++++++++++++---------------- 3 files changed, 21 insertions(+), 16 deletions(-)
include/net/bluetooth/hci_sync.h +2 -0
@@ -80,6 +80,8 @@ int hci_start_per_adv_sync(struct hci_dev *hdev, u8 instance, u8 data_len, u8 *data, u32 flags, u16 min_interval, u16 max_interval, u16 sync_interval); +int hci_disable_per_advertising_sync (struct hci_dev *hdev,u8 instance); +int hci_remove_advertising_sync (struct hci_dev *hdev,struct sock *sk,u8 instance,bool force);int hci_disable_advertising_sync (struct hci_dev *hdev);
net/bluetooth/hci_conn.c +7 -0
@@ -759,6 +759,7 @@ static int terminate_big_sync(struct hci_dev *hdev, void *data)bt_dev_dbg (hdev,"big 0x%2.2x bis 0x%2.2x" , d->big, d->bis); +hci_disable_per_advertising_sync (hdev, d->bis);hci_remove_ext_adv_instance_sync (hdev, d->bis,NULL );/* Only terminate BIG if it has been created */
@@ -1279,6 +1280,12 @@ void hci_conn_failed(struct hci_conn *conn, u8 status)break ; } +/* In case of BIG/PA sync failed, clear conn flags so that +* the conns will be correctly cleaned up by ISO layer +*/ +test_and_clear_bit (HCI_CONN_BIG_SYNC_FAILED , &conn->flags); +test_and_clear_bit (HCI_CONN_PA_SYNC_FAILED , &conn->flags); + conn->state =BT_CLOSED ;hci_connect_cfm (conn, status);hci_conn_del (conn);
net/bluetooth/hci_sync.c +12 -16
@@ -1321,7 +1321,7 @@ int hci_start_ext_adv_sync(struct hci_dev *hdev, u8 instance)return hci_enable_ext_advertising_sync (hdev, instance); } -static int hci_disable_per_advertising_sync (struct hci_dev *hdev,u8 instance) +int hci_disable_per_advertising_sync (struct hci_dev *hdev,u8 instance) {struct hci_cp_le_set_per_adv_enable cp;struct adv_info *adv =NULL ;
@@ -5304,6 +5304,17 @@ static int hci_disconnect_sync(struct hci_dev *hdev, struct hci_conn *conn,if (conn->type ==AMP_LINK )return hci_disconnect_phy_link_sync (hdev, conn->handle, reason); +if (test_bit (HCI_CONN_BIG_CREATED , &conn->flags)) { +/* This is a BIS connection, hci_conn_del will +* do the necessary cleanup. +*/ +hci_dev_lock (hdev); +hci_conn_failed (conn, reason); +hci_dev_unlock (hdev); + +return 0 ; + } +memset (&cp,0 ,sizeof (cp)); cp.handle =cpu_to_le16 (conn->handle); cp.reason = reason;
@@ -5456,21 +5467,6 @@ int hci_abort_conn_sync(struct hci_dev *hdev, struct hci_conn *conn, u8 reason) err =hci_reject_conn_sync (hdev, conn, reason);break ;case BT_OPEN : -hci_dev_lock (hdev); - -/* Cleanup bis or pa sync connections */ -if (test_and_clear_bit (HCI_CONN_BIG_SYNC_FAILED , &conn->flags) || -test_and_clear_bit (HCI_CONN_PA_SYNC_FAILED , &conn->flags)) { -hci_conn_failed (conn, reason); - }else if (test_bit (HCI_CONN_PA_SYNC , &conn->flags) || -test_bit (HCI_CONN_BIG_SYNC , &conn->flags)) { - conn->state =BT_CLOSED ; -hci_disconn_cfm (conn, reason); -hci_conn_del (conn); - } - -hci_dev_unlock (hdev); -return 0 ;case BT_BOUND :break ;default :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 264/744 Bluetooth: Remove usage of the deprecated ida_simple_xx() API
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
[ Upstream commit 9c16d0c8d93e3d2a95c5ed927b061f244db75579 ]
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove().
Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_max() is inclusive. So a -1 has been added when needed.
Stable-dep-of: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
--- net/bluetooth/hci_core.c | 9 +++++---- net/bluetooth/hci_sock.c | 4 ++-- 2 files changed, 7 insertions(+), 6 deletions(-)
net/bluetooth/hci_core.c +5 -4
@@ -2609,10 +2609,11 @@ int hci_register_dev(struct hci_dev *hdev)*/ switch (hdev->dev_type) {case HCI_PRIMARY : - id =ida_simple_get (&hci_index_ida,0 ,HCI_MAX_ID ,GFP_KERNEL ); + id =ida_alloc_max (&hci_index_ida,HCI_MAX_ID -1 ,GFP_KERNEL );break ;case HCI_AMP : - id =ida_simple_get (&hci_index_ida,1 ,HCI_MAX_ID ,GFP_KERNEL ); + id =ida_alloc_range (&hci_index_ida,1 ,HCI_MAX_ID -1 , +GFP_KERNEL );break ;default :return -EINVAL ;
@@ -2711,7 +2712,7 @@ int hci_register_dev(struct hci_dev *hdev)destroy_workqueue (hdev->workqueue);destroy_workqueue (hdev->req_workqueue); err: -ida_simple_remove (&hci_index_ida, hdev->id); +ida_free (&hci_index_ida, hdev->id);return error; }
@@ -2793,7 +2794,7 @@ void hci_release_dev(struct hci_dev *hdev)hci_dev_unlock (hdev);ida_destroy (&hdev->unset_handle_ida); -ida_simple_remove (&hci_index_ida, hdev->id); +ida_free (&hci_index_ida, hdev->id);kfree_skb (hdev->sent_cmd);kfree_skb (hdev->req_skb);kfree_skb (hdev->recv_event);
net/bluetooth/hci_sock.c +2 -2
@@ -101,7 +101,7 @@ static bool hci_sock_gen_cookie(struct sock *sk)int id =hci_pi (sk)->cookie;if (!id) { - id =ida_simple_get (&sock_cookie_ida,1 ,0 ,GFP_KERNEL ); + id =ida_alloc_min (&sock_cookie_ida,1 ,GFP_KERNEL );if (id <0 ) id =0xffffffff ;
@@ -119,7 +119,7 @@ static void hci_sock_free_cookie(struct sock *sk)if (id) {hci_pi (sk)->cookie =0xffffffff ; -ida_simple_remove (&sock_cookie_ida, id); +ida_free (&sock_cookie_ida, id); } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 265/744 Bluetooth: hci_event: Remove code to removed CONFIG_BT_HS
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Bulwahn <[email protected]>
[ Upstream commit f4b0c2b4cd78b75acde56c2ee5aa732b6fb2a6a9 ]
Commit cec9f3c5561d ("Bluetooth: Remove BT_HS") removes config BT_HS, but misses two "ifdef BT_HS" blocks in hci_event.c.
Remove this dead code from this removed config option.
Stable-dep-of: 84a4bb6548a2 ("Bluetooth: HCI: Remove HCI_AMP support")
--- net/bluetooth/hci_event.c | 163 -------------------------------------- 1 file changed, 163 deletions(-)
net/bluetooth/hci_event.c +0 -163
@@ -5710,150 +5710,6 @@ static void hci_remote_oob_data_request_evt(struct hci_dev *hdev, void *edata,hci_dev_unlock (hdev); } -#if IS_ENABLED (CONFIG_BT_HS ) -static void hci_chan_selected_evt (struct hci_dev *hdev,void *data, -struct sk_buff *skb) -{ -struct hci_ev_channel_selected *ev = data; -struct hci_conn *hcon; - -bt_dev_dbg (hdev,"handle 0x%2.2x" , ev->phy_handle); - - hcon =hci_conn_hash_lookup_handle (hdev, ev->phy_handle); -if (!hcon) -return ; - -amp_read_loc_assoc_final_data (hdev, hcon); -} - -static void hci_phy_link_complete_evt (struct hci_dev *hdev,void *data, -struct sk_buff *skb) -{ -struct hci_ev_phy_link_complete *ev = data; -struct hci_conn *hcon, *bredr_hcon; - -bt_dev_dbg (hdev,"handle 0x%2.2x status 0x%2.2x" , ev->phy_handle, - ev->status); - -hci_dev_lock (hdev); - - hcon =hci_conn_hash_lookup_handle (hdev, ev->phy_handle); -if (!hcon) - goto unlock; - -if (!hcon->amp_mgr) - goto unlock; - -if (ev->status) { -hci_conn_del (hcon); - goto unlock; - } - - bredr_hcon = hcon->amp_mgr->l2cap_conn->hcon; - - hcon->state =BT_CONNECTED ; -bacpy (&hcon->dst, &bredr_hcon->dst); - -hci_conn_hold (hcon); - hcon->disc_timeout =HCI_DISCONN_TIMEOUT ; -hci_conn_drop (hcon); - -hci_debugfs_create_conn (hcon); -hci_conn_add_sysfs (hcon); - -amp_physical_cfm (bredr_hcon, hcon); - -unlock: -hci_dev_unlock (hdev); -} - -static void hci_loglink_complete_evt (struct hci_dev *hdev,void *data, -struct sk_buff *skb) -{ -struct hci_ev_logical_link_complete *ev = data; -struct hci_conn *hcon; -struct hci_chan *hchan; -struct amp_mgr *mgr; - -bt_dev_dbg (hdev,"log_handle 0x%4.4x phy_handle 0x%2.2x status 0x%2.2x" , -le16_to_cpu (ev->handle), ev->phy_handle, ev->status); - - hcon =hci_conn_hash_lookup_handle (hdev, ev->phy_handle); -if (!hcon) -return ; - -/* Create AMP hchan */ - hchan =hci_chan_create (hcon); -if (!hchan) -return ; - - hchan->handle =le16_to_cpu (ev->handle); - hchan->amp = true; - -BT_DBG ("hcon %p mgr %p hchan %p" , hcon, hcon->amp_mgr, hchan); - - mgr = hcon->amp_mgr; -if (mgr && mgr->bredr_chan) { -struct l2cap_chan *bredr_chan = mgr->bredr_chan; - -l2cap_chan_lock (bredr_chan); - - bredr_chan->conn->mtu = hdev->block_mtu; -l2cap_logical_cfm (bredr_chan, hchan,0 ); -hci_conn_hold (hcon); - -l2cap_chan_unlock (bredr_chan); - } -} - -static void hci_disconn_loglink_complete_evt (struct hci_dev *hdev,void *data, -struct sk_buff *skb) -{ -struct hci_ev_disconn_logical_link_complete *ev = data; -struct hci_chan *hchan; - -bt_dev_dbg (hdev,"handle 0x%4.4x status 0x%2.2x" , -le16_to_cpu (ev->handle), ev->status); - -if (ev->status) -return ; - -hci_dev_lock (hdev); - - hchan =hci_chan_lookup_handle (hdev,le16_to_cpu (ev->handle)); -if (!hchan || !hchan->amp) - goto unlock; - -amp_destroy_logical_link (hchan, ev->reason); - -unlock: -hci_dev_unlock (hdev); -} - -static void hci_disconn_phylink_complete_evt (struct hci_dev *hdev,void *data, -struct sk_buff *skb) -{ -struct hci_ev_disconn_phy_link_complete *ev = data; -struct hci_conn *hcon; - -bt_dev_dbg (hdev,"status 0x%2.2x" , ev->status); - -if (ev->status) -return ; - -hci_dev_lock (hdev); - - hcon =hci_conn_hash_lookup_handle (hdev, ev->phy_handle); -if (hcon && hcon->type ==AMP_LINK ) { - hcon->state =BT_CLOSED ; -hci_disconn_cfm (hcon, ev->reason); -hci_conn_del (hcon); - } - -hci_dev_unlock (hdev); -} -#endif -static void le_conn_update_addr (struct hci_conn *conn,bdaddr_t *bdaddr,u8 bdaddr_type,bdaddr_t *local_rpa) {
@@ -7675,25 +7531,6 @@ static const struct hci_ev {/* [0x3e = HCI_EV_LE_META] */ HCI_EV_REQ_VL (HCI_EV_LE_META , hci_le_meta_evt,sizeof (struct hci_ev_le_meta ),HCI_MAX_EVENT_SIZE ), -#if IS_ENABLED(CONFIG_BT_HS) -/* [0x40 = HCI_EV_PHY_LINK_COMPLETE] */ -HCI_EV (HCI_EV_PHY_LINK_COMPLETE , hci_phy_link_complete_evt, -sizeof (struct hci_ev_phy_link_complete )), -/* [0x41 = HCI_EV_CHANNEL_SELECTED] */ -HCI_EV (HCI_EV_CHANNEL_SELECTED , hci_chan_selected_evt, -sizeof (struct hci_ev_channel_selected )), -/* [0x42 = HCI_EV_DISCONN_PHY_LINK_COMPLETE] */ -HCI_EV (HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE , - hci_disconn_loglink_complete_evt, -sizeof (struct hci_ev_disconn_logical_link_complete )), -/* [0x45 = HCI_EV_LOGICAL_LINK_COMPLETE] */ -HCI_EV (HCI_EV_LOGICAL_LINK_COMPLETE , hci_loglink_complete_evt, -sizeof (struct hci_ev_logical_link_complete )), -/* [0x46 = HCI_EV_DISCONN_LOGICAL_LINK_COMPLETE] */ -HCI_EV (HCI_EV_DISCONN_PHY_LINK_COMPLETE , - hci_disconn_phylink_complete_evt, -sizeof (struct hci_ev_disconn_phy_link_complete )), -#endif/* [0x48 = HCI_EV_NUM_COMP_BLOCKS] */ HCI_EV (HCI_EV_NUM_COMP_BLOCKS , hci_num_comp_blocks_evt, sizeof(struct hci_ev_num_comp_blocks)),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 266/744 Bluetooth: HCI: Remove HCI_AMP support
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit 84a4bb6548a29326564f0e659fb8064503ecc1c7 ]
Since BT_HS has been remove HCI_AMP controllers no longer has any use so remove it along with the capability of creating AMP controllers.
Since we no longer need to differentiate between AMP and Primary controllers, as only HCI_PRIMARY is left, this also remove hdev->dev_type altogether.
--- drivers/bluetooth/btmrvl_main.c | 9 -- drivers/bluetooth/btrsi.c | 1 - drivers/bluetooth/btsdio.c | 8 -- drivers/bluetooth/btusb.c | 5 -- drivers/bluetooth/hci_bcm4377.c | 1 - drivers/bluetooth/hci_ldisc.c | 6 -- drivers/bluetooth/hci_serdev.c | 5 -- drivers/bluetooth/hci_uart.h | 1 - drivers/bluetooth/hci_vhci.c | 10 +-- drivers/bluetooth/virtio_bt.c | 2 - include/net/bluetooth/hci.h | 114 ------------------------ include/net/bluetooth/hci_core.h | 46 +--------- include/uapi/linux/virtio_bt.h | 1 - net/bluetooth/hci_conn.c | 3 +- net/bluetooth/hci_core.c | 132 +++------------------------ net/bluetooth/hci_event.c | 147 ------------------------------- net/bluetooth/hci_sock.c | 5 +- net/bluetooth/hci_sync.c | 112 +---------------------- net/bluetooth/l2cap_core.c | 21 +---- net/bluetooth/mgmt.c | 84 ++++++------------ 20 files changed, 49 insertions(+), 664 deletions(-)
drivers/bluetooth/btmrvl_main.c +0 -9
@@ -121,13 +121,6 @@ int btmrvl_process_event(struct btmrvl_private *priv, struct sk_buff *skb) ((event->data[2 ] ==MODULE_BROUGHT_UP ) || (event->data[2 ] ==MODULE_ALREADY_UP )) ? "Bring-up succeed" : "Bring-up failed"); - -if (event->length >3 && event->data[3 ]) - priv->btmrvl_dev.dev_type =HCI_AMP ; -else - priv->btmrvl_dev.dev_type =HCI_PRIMARY ; - -BT_DBG ("dev_type: %d" , priv->btmrvl_dev.dev_type); }else if (priv->btmrvl_dev.sendcmdflag && event->data[1 ] ==MODULE_SHUTDOWN_REQ ) { BT_DBG("EVENT:%s", (event->data[2]) ?
@@ -686,8 +679,6 @@ int btmrvl_register_hdev(struct btmrvl_private *priv) hdev->wakeup = btmrvl_wakeup;SET_HCIDEV_DEV (hdev, &card->func->dev); - hdev->dev_type = priv->btmrvl_dev.dev_type; - ret =hci_register_dev (hdev);if (ret <0 ) {BT_ERR ("Can not register HCI device" );
drivers/bluetooth/btrsi.c +0 -1
@@ -134,7 +134,6 @@ static int rsi_hci_attach(void *priv, struct rsi_proto_ops *ops) hdev->bus =HCI_USB ;hci_set_drvdata (hdev, h_adapter); - hdev->dev_type =HCI_PRIMARY ; hdev->open = rsi_hci_open; hdev->close = rsi_hci_close; hdev->flush = rsi_hci_flush;
drivers/bluetooth/btsdio.c +0 -8
@@ -32,9 +32,6 @@ static const struct sdio_device_id btsdio_table[] = {/* Generic Bluetooth Type-B SDIO device */ { SDIO_DEVICE_CLASS(SDIO_CLASS_BT_B) }, -/* Generic Bluetooth AMP controller */ - { SDIO_DEVICE_CLASS(SDIO_CLASS_BT_AMP) }, - { }/* Terminating entry */ };
@@ -319,11 +316,6 @@ static int btsdio_probe(struct sdio_func *func, hdev->bus =HCI_SDIO ;hci_set_drvdata (hdev, data); -if (id->class ==SDIO_CLASS_BT_AMP ) - hdev->dev_type =HCI_AMP ; -else - hdev->dev_type =HCI_PRIMARY ; - data->hdev = hdev;SET_HCIDEV_DEV (hdev, &func->dev);
drivers/bluetooth/btusb.c +0 -5
@@ -4308,11 +4308,6 @@ static int btusb_probe(struct usb_interface *intf, hdev->bus =HCI_USB ;hci_set_drvdata (hdev, data); -if (id->driver_info &BTUSB_AMP ) - hdev->dev_type =HCI_AMP ; -else - hdev->dev_type =HCI_PRIMARY ; - data->hdev = hdev;SET_HCIDEV_DEV (hdev, &intf->dev);
drivers/bluetooth/hci_bcm4377.c +0 -1
@@ -2361,7 +2361,6 @@ static int bcm4377_probe(struct pci_dev *pdev, const struct pci_device_id *id) bcm4377->hdev = hdev; hdev->bus =HCI_PCI ; - hdev->dev_type =HCI_PRIMARY ; hdev->open = bcm4377_hci_open; hdev->close = bcm4377_hci_close; hdev->send = bcm4377_hci_send_frame;
drivers/bluetooth/hci_ldisc.c +0 -6
@@ -667,11 +667,6 @@ static int hci_uart_register_dev(struct hci_uart *hu)if (!test_bit (HCI_UART_RESET_ON_INIT , &hu->hdev_flags))set_bit (HCI_QUIRK_RESET_ON_CLOSE , &hdev->quirks); -if (test_bit (HCI_UART_CREATE_AMP , &hu->hdev_flags)) - hdev->dev_type =HCI_AMP ; -else - hdev->dev_type =HCI_PRIMARY ; -/* Only call open() for the protocol after hdev is fully initialized as * open() (or a timer/workqueue it starts) may attempt to reference it. */
@@ -722,7 +717,6 @@ static int hci_uart_set_flags(struct hci_uart *hu, unsigned long flags) {unsigned long valid_flags =BIT (HCI_UART_RAW_DEVICE ) |BIT (HCI_UART_RESET_ON_INIT ) | -BIT (HCI_UART_CREATE_AMP ) |BIT (HCI_UART_INIT_PENDING ) |BIT (HCI_UART_EXT_CONFIG ) |BIT (HCI_UART_VND_DETECT );
drivers/bluetooth/hci_serdev.c +0 -5
@@ -366,11 +366,6 @@ int hci_uart_register_device_priv(struct hci_uart *hu,if (test_bit (HCI_UART_EXT_CONFIG , &hu->hdev_flags))set_bit (HCI_QUIRK_EXTERNAL_CONFIG , &hdev->quirks); -if (test_bit (HCI_UART_CREATE_AMP , &hu->hdev_flags)) - hdev->dev_type =HCI_AMP ; -else - hdev->dev_type =HCI_PRIMARY ; -if (test_bit (HCI_UART_INIT_PENDING , &hu->hdev_flags))return 0 ;
drivers/bluetooth/hci_uart.h +0 -1
@@ -37,7 +37,6 @@#define HCI_UART_RAW_DEVICE 0#define HCI_UART_RESET_ON_INIT 1 -#define HCI_UART_CREATE_AMP 2#define HCI_UART_INIT_PENDING 3#define HCI_UART_EXT_CONFIG 4#define HCI_UART_VND_DETECT 5
drivers/bluetooth/hci_vhci.c +1 -9
@@ -384,17 +384,10 @@ static int __vhci_create_device(struct vhci_data *data, __u8 opcode) {struct hci_dev *hdev;struct sk_buff *skb; -__u8 dev_type;if (data->hdev)return -EBADFD ; -/* bits 0-1 are dev_type (Primary or AMP) */ - dev_type = opcode &0x03 ; - -if (dev_type !=HCI_PRIMARY && dev_type !=HCI_AMP ) -return -EINVAL ; -/* bits 2-5 are reserved (must be zero) */ if (opcode &0x3c )return -EINVAL ;
@@ -412,7 +405,6 @@ static int __vhci_create_device(struct vhci_data *data, __u8 opcode) data->hdev = hdev; hdev->bus =HCI_VIRTUAL ; - hdev->dev_type = dev_type;hci_set_drvdata (hdev, data); hdev->open = vhci_open_dev;
@@ -634,7 +626,7 @@ static void vhci_open_timeout(struct work_struct *work) struct vhci_data *data = container_of(work, struct vhci_data, open_timeout.work); -vhci_create_device (data, amp ?HCI_AMP :HCI_PRIMARY ); +vhci_create_device (data,0x00 ); }static int vhci_open (struct inode *inode,struct file *file)
drivers/bluetooth/virtio_bt.c +0 -2
@@ -274,7 +274,6 @@ static int virtbt_probe(struct virtio_device *vdev)switch (type) {case VIRTIO_BT_CONFIG_TYPE_PRIMARY : -case VIRTIO_BT_CONFIG_TYPE_AMP :break ;default :return -EINVAL ;
@@ -303,7 +302,6 @@ static int virtbt_probe(struct virtio_device *vdev) vbt->hdev = hdev; hdev->bus =HCI_VIRTIO ; - hdev->dev_type = type;hci_set_drvdata (hdev, vbt); hdev->open = virtbt_open;
include/net/bluetooth/hci.h +0 -114
144 lines not on this page · raw message
include/net/bluetooth/hci_core.h +1 -45
118 lines not on this page · raw message
include/uapi/linux/virtio_bt.h +0 -1
@@ -13,7 +13,6 @@enum virtio_bt_config_type {VIRTIO_BT_CONFIG_TYPE_PRIMARY =0 , -VIRTIO_BT_CONFIG_TYPE_AMP =1 , };enum virtio_bt_config_vendor {
net/bluetooth/hci_conn.c +1 -2
@@ -1200,8 +1200,7 @@ struct hci_dev *hci_get_route(bdaddr_t *dst, bdaddr_t *src, uint8_t src_type)list_for_each_entry (d, &hci_dev_list, list) {if (!test_bit (HCI_UP , &d->flags) || -hci_dev_test_flag (d,HCI_USER_CHANNEL ) || - d->dev_type !=HCI_PRIMARY ) +hci_dev_test_flag (d,HCI_USER_CHANNEL ))continue ;/* Simple routing:
net/bluetooth/hci_core.c +10 -122
199 lines not on this page · raw message
net/bluetooth/hci_event.c +0 -147
189 lines not on this page · raw message
net/bluetooth/hci_sock.c +1 -4
@@ -485,7 +485,7 @@ static struct sk_buff *create_monitor_event(struct hci_dev *hdev, int event)return NULL ; ni =skb_put (skb,HCI_MON_NEW_INDEX_SIZE ); - ni->type = hdev->dev_type; + ni->type =0x00 ;/* Old hdev->dev_type */ ni->bus = hdev->bus;bacpy (&ni->bdaddr, &hdev->bdaddr); memcpy_and_pad(ni->name, sizeof(ni->name), hdev->name,
@@ -1007,9 +1007,6 @@ static int hci_sock_bound_ioctl(struct sock *sk, unsigned int cmd,if (hci_dev_test_flag (hdev,HCI_UNCONFIGURED ))return -EOPNOTSUPP ; -if (hdev->dev_type !=HCI_PRIMARY ) -return -EOPNOTSUPP ; -switch (cmd) {case HCISETRAW :if (!capable (CAP_NET_ADMIN ))
net/bluetooth/hci_sync.c +4 -108
187 lines not on this page · raw message
net/bluetooth/l2cap_core.c +4 -17
@@ -3930,7 +3930,7 @@ static inline int l2cap_command_rej(struct l2cap_conn *conn, }static void l2cap_connect (struct l2cap_conn *conn,struct l2cap_cmd_hdr *cmd, -u8 *data,u8 rsp_code,u8 amp_id) +u8 *data,u8 rsp_code) {struct l2cap_conn_req *req = (struct l2cap_conn_req *) data;struct l2cap_conn_rsp rsp;
@@ -4009,17 +4009,8 @@ static void l2cap_connect(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, status =L2CAP_CS_AUTHOR_PEND ; chan->ops->defer (chan); }else { -/* Force pending result for AMP controllers. -* The connection will succeed after the -* physical link is up. -*/ -if (amp_id ==AMP_ID_BREDR ) { -l2cap_state_change (chan,BT_CONFIG ); - result =L2CAP_CR_SUCCESS ; - }else { -l2cap_state_change (chan,BT_CONNECT2 ); - result =L2CAP_CR_PEND ; - } +l2cap_state_change (chan,BT_CONNECT2 ); + result =L2CAP_CR_PEND ; status =L2CAP_CS_NO_INFO ; } }else {
@@ -4084,7 +4075,7 @@ static int l2cap_connect_req(struct l2cap_conn *conn,mgmt_device_connected (hdev, hcon,NULL ,0 );hci_dev_unlock (hdev); -l2cap_connect (conn, cmd, data,L2CAP_CONN_RSP ,0 ); +l2cap_connect (conn, cmd, data,L2CAP_CONN_RSP );return 0 ; }
@@ -7497,10 +7488,6 @@ void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags)struct l2cap_conn *conn = hcon->l2cap_data;int len; -/* For AMP controller do not create l2cap conn */ -if (!conn && hcon->hdev->dev_type !=HCI_PRIMARY ) - goto drop; -if (!conn) conn =l2cap_conn_add (hcon);
net/bluetooth/mgmt.c +27 -57
133 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 267/744 drm/bridge: Fix improper bridge init order with pre_enable_prev_first
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jagan Teki <[email protected]>
[ Upstream commit e18aeeda0b6905c333df5a0566b99f5c84426098 ]
For a given bridge pipeline if any bridge sets pre_enable_prev_first flag then the pre_enable for the previous bridge will be called before pre_enable of this bridge and opposite is done for post_disable.
These are the potential bridge flags to alter bridge init order in order to satisfy the MIPI DSI host and downstream panel or bridge to function. However the existing pre_enable_prev_first logic with associated bridge ordering has broken for both pre_enable and post_disable calls.
[pre_enable]
The altered bridge ordering has failed if two consecutive bridges on a given pipeline enables the pre_enable_prev_first flag.
Example:
- Panel
- Bridge 1
- Bridge 2 pre_enable_prev_first
- Bridge 3
- Bridge 4 pre_enable_prev_first
- Bridge 5 pre_enable_prev_first
- Bridge 6
- Encoder
In this example, Bridge 4 and Bridge 5 have pre_enable_prev_first.
The logic looks for a bridge which enabled pre_enable_prev_first flag on each iteration and assigned the previou bridge to limit pointer if the bridge doesn't enable pre_enable_prev_first flags.
If control found Bridge 2 is pre_enable_prev_first then the iteration looks for Bridge 3 and found it is not pre_enable_prev_first and assigns it's previous Bridge 4 to limit pointer and calls pre_enable of Bridge 3 and Bridge 2 and assign iter pointer with limit which is Bridge 4.
Here is the actual problem, for the next iteration control look for Bridge 5 instead of Bridge 4 has iter pointer in previous iteration moved to Bridge 4 so this iteration skips the Bridge 4. The iteration found Bridge 6 doesn't pre_enable_prev_first flags so the limit assigned to Encoder. From next iteration Encoder skips as it is the last bridge for reverse order pipeline.
So, the resulting pre_enable bridge order would be,
- Panel, Bridge 1, Bridge 3, Bridge 2, Bridge 6, Bridge 5.
This patch fixes this by assigning limit to next pointer instead of previous bridge since the iteration always looks for bridge that does NOT request prev so assigning next makes sure the last bridge on a given iteration what exactly the limit bridge is.
So, the resulting pre_enable bridge order with fix would be,
- Panel, Bridge 1, Bridge 3, Bridge 2, Bridge 6, Bridge 5, Bridge 4, Encoder.
[post_disable]
The altered bridge ordering has failed if two consecutive bridges on a given pipeline enables the pre_enable_prev_first flag.
Example:
- Panel
- Bridge 1
- Bridge 2 pre_enable_prev_first
- Bridge 3
- Bridge 4 pre_enable_prev_first
- Bridge 5 pre_enable_prev_first
- Bridge 6
- Encoder
In this example Bridge 5 and Bridge 4 have pre_enable_prev_first.
The logic looks for a bridge which enabled pre_enable_prev_first flags on each iteration and assigned the previou bridge to next and next to limit pointer if the bridge does enable pre_enable_prev_first flag.
If control starts from Bridge 6 then it found next Bridge 5 is pre_enable_prev_first and immediately the next assigned to previous Bridge 6 and limit assignments to next Bridge 6 and call post_enable of Bridge 6 even though the next consecutive Bridge 5 is enabled with pre_enable_prev_first. This clearly misses the logic to find the state of next conducive bridge as everytime the next and limit assigns previous bridge if given bridge enabled pre_enable_prev_first.
So, the resulting post_disable bridge order would be,
- Encoder, Bridge 6, Bridge 5, Bridge 4, Bridge 3, Bridge 2, Bridge 1, Panel.
This patch fixes this by assigning next with previou bridge only if the bridge doesn't enable pre_enable_prev_first flag and the next further assign it to limit. This way we can find the bridge that NOT requested prev to disable last.
So, the resulting pre_enable bridge order with fix would be,
- Encoder, Bridge 4, Bridge 5, Bridge 6, Bridge 2, Bridge 3, Bridge 1, Panel.
Validated the bridge init ordering by incorporating dummy bridges in the sun6i-mipi-dsi pipeline
--- drivers/gpu/drm/drm_bridge.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/gpu/drm/drm_bridge.c +8 -2
@@ -687,11 +687,17 @@ void drm_atomic_bridge_chain_post_disable(struct drm_bridge *bridge,*/ list_for_each_entry_from (next, &encoder->bridge_chain, chain_node) { -if (next->pre_enable_prev_first) { +if (!next->pre_enable_prev_first) { next =list_prev_entry (next, chain_node); limit = next;break ; } + +if (list_is_last (&next->chain_node, + &encoder->bridge_chain)) { + limit = next; +break ; + } }/* Call these bridges in reverse order */
@@ -774,7 +780,7 @@ void drm_atomic_bridge_chain_pre_enable(struct drm_bridge *bridge,/* Found first bridge that does NOT * request prev to be enabled first */ - limit =list_prev_entry (next, chain_node); + limit = next;break ; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 268/744 drm/ci: uprev mesa version: fix container build & crosvm
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helen Koike <[email protected]>
[ Upstream commit 1887de00867d7a700babefc9647ccb9e0d11ee56 ]
When building containers, some rust packages were installed without locking the dependencies version, which got updated and started giving errors like:
error: failed to compile bindgen-cli v0.62.0, intermediate artifacts can be found at /tmp/cargo-installkNKRwf Caused by:
package rustix v0.38.13 cannot be built because it requires rustc 1.63 or newer, while the currently active rustc version is 1.60.0
A patch to Mesa was added fixing this error, so update it.
Also, commit in linux kernel 6.6 rc3 broke booting in crosvm. Mesa has upreved crosvm to fix this issue.
Stable-dep-of: a2c71b711e7e ("drm/ci: update device type for volteer devices")
--- drivers/gpu/drm/ci/build.yml | 1 + drivers/gpu/drm/ci/gitlab-ci.yml | 20 +++++++++++++++++++- drivers/gpu/drm/ci/image-tags.yml | 2 +- drivers/gpu/drm/ci/lava-submit.sh | 2 +- 4 files changed, 22 insertions(+), 3 deletions(-)
drivers/gpu/drm/ci/build.yml +1 -0
@@ -1,6 +1,7 @@ .build: extends: - .build-rules + - .container+build-rules stage: build artifacts: paths:
drivers/gpu/drm/ci/gitlab-ci.yml +19 -1
@@ -1,6 +1,6 @@ variables: DRM_CI_PROJECT_PATH: &drm-ci-project-path mesa/mesa - DRM_CI_COMMIT_SHA: &drm-ci-commit-sha 0dc961645c4f0241f8512cb0ec3ad59635842072 + DRM_CI_COMMIT_SHA: &drm-ci-commit-sha edfbf74df1d4d6ce54ffe24566108be0e1a98c3d UPSTREAM_REPO: git://anongit.freedesktop.org/drm/drm TARGET_BRANCH: drm-next
@@ -24,6 +24,8 @@ variables: PIPELINE_ARTIFACTS_BASE: ${S3_HOST}/artifacts/${CI_PROJECT_PATH}/${CI_PIPELINE_ID} # per-job artifact storage on MinIO JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID} + # default kernel for rootfs before injecting the current kernel tree + KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/gfx-ci/linux/v6.4.12-for-mesa-ci-f6b4ad45f48d LAVA_JOB_PRIORITY: 30
@@ -86,6 +88,17 @@ include: - '/.gitlab-ci/container/gitlab-ci.yml' - '/.gitlab-ci/test/gitlab-ci.yml' - '/.gitlab-ci/lava/lava-gitlab-ci.yml' + - '/src/microsoft/ci/gitlab-ci-inc.yml' + - '/src/gallium/drivers/zink/ci/gitlab-ci-inc.yml' + - '/src/gallium/drivers/crocus/ci/gitlab-ci-inc.yml' + - '/src/gallium/drivers/softpipe/ci/gitlab-ci-inc.yml' + - '/src/gallium/drivers/llvmpipe/ci/gitlab-ci-inc.yml' + - '/src/gallium/drivers/virgl/ci/gitlab-ci-inc.yml' + - '/src/gallium/drivers/nouveau/ci/gitlab-ci-inc.yml' + - '/src/gallium/frontends/lavapipe/ci/gitlab-ci-inc.yml' + - '/src/intel/ci/gitlab-ci-inc.yml' + - '/src/freedreno/ci/gitlab-ci-inc.yml' + - '/src/amd/ci/gitlab-ci-inc.yml' - drivers/gpu/drm/ci/image-tags.yml - drivers/gpu/drm/ci/container.yml - drivers/gpu/drm/ci/static-checks.yml
@@ -154,6 +167,11 @@ stages: # Run automatically once all dependency jobs have passed - when: on_success +# When to automatically run the CI for container jobs +.container+build-rules: + rules: + - !reference [.no_scheduled_pipelines-rules, rules] + - when: manual .ci-deqp-artifacts: artifacts:
drivers/gpu/drm/ci/image-tags.yml +1 -1
@@ -1,5 +1,5 @@ variables: - CONTAINER_TAG: "2023-08-10-mesa-uprev" + CONTAINER_TAG: "2023-10-11-mesa-uprev" DEBIAN_X86_64_BUILD_BASE_IMAGE: "debian/x86_64_build-base" DEBIAN_BASE_TAG: "${CONTAINER_TAG}"
drivers/gpu/drm/ci/lava-submit.sh +1 -1
@@ -22,7 +22,7 @@ cp "$SCRIPTS_DIR"/setup-test-env.sh results/job-rootfs-overlay/ # Prepare env vars for upload. section_start variables "Variables passed through:" -KERNEL_IMAGE_BASE_URL="https://${BASE_SYSTEM_HOST_PATH}" \ +KERNEL_IMAGE_BASE="https://${BASE_SYSTEM_HOST_PATH}" \ artifacts/ci-common/generate-env.sh | tee results/job-rootfs-overlay/set-job-env-vars.sh section_end variables
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 269/744 drm/ci: add subset-1-gfx to LAVA_TAGS and adjust shards
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Helen Koike <[email protected]>
[ Upstream commit 68a3f17732d1d72be958576b6ce0e6c29686a40b ]
The Collabora Lava farm added a tag called subset-1-gfx to half of devices the graphics community use.
Lets use this tag so we don't occupy all the resources.
This is particular important because Mesa3D shares the resources with DRM-CI and use them to do pre-merge tests, so it can block developers from getting their patches merged.
Stable-dep-of: a2c71b711e7e ("drm/ci: update device type for volteer devices")
--- drivers/gpu/drm/ci/gitlab-ci.yml | 2 +- drivers/gpu/drm/ci/test.yml | 23 ++++++++++++++--------- 2 files changed, 15 insertions(+), 10 deletions(-)
drivers/gpu/drm/ci/gitlab-ci.yml +1 -1
@@ -26,7 +26,7 @@ variables: JOB_ARTIFACTS_BASE: ${PIPELINE_ARTIFACTS_BASE}/${CI_JOB_ID} # default kernel for rootfs before injecting the current kernel tree KERNEL_IMAGE_BASE: https://${S3_HOST}/mesa-lava/gfx-ci/linux/v6.4.12-for-mesa-ci-f6b4ad45f48d - + LAVA_TAGS: subset-1-gfx LAVA_JOB_PRIORITY: 30 default:
drivers/gpu/drm/ci/test.yml +14 -9
@@ -86,7 +86,7 @@ msm:sc7180: extends: - .lava-igt:arm64 stage: msm - parallel: 2 + parallel: 4 variables: DRIVER_NAME: msm DEVICE_TYPE: sc7180-trogdor-lazor-limozeen
@@ -158,7 +158,7 @@ rockchip:rk3399: extends: - .lava-igt:arm64 stage: rockchip - parallel: 3 + parallel: 2 variables: DRIVER_NAME: rockchip DEVICE_TYPE: rk3399-gru-kevin
@@ -181,7 +181,7 @@ rockchip:rk3399: i915:apl: extends: - .i915 - parallel: 12 + parallel: 3 variables: DEVICE_TYPE: asus-C523NA-A20057-coral GPU_VERSION: apl
@@ -190,7 +190,7 @@ i915:apl: i915:glk: extends: - .i915 - parallel: 5 + parallel: 2 variables: DEVICE_TYPE: hp-x360-12b-ca0010nr-n4020-octopus GPU_VERSION: glk
@@ -199,7 +199,7 @@ i915:glk: i915:amly: extends: - .i915 - parallel: 8 + parallel: 2 variables: DEVICE_TYPE: asus-C433TA-AJ0005-rammus GPU_VERSION: amly
@@ -208,7 +208,7 @@ i915:amly: i915:kbl: extends: - .i915 - parallel: 5 + parallel: 3 variables: DEVICE_TYPE: hp-x360-14-G1-sona GPU_VERSION: kbl
@@ -217,7 +217,7 @@ i915:kbl: i915:whl: extends: - .i915 - parallel: 8 + parallel: 2 variables: DEVICE_TYPE: dell-latitude-5400-8665U-sarien GPU_VERSION: whl
@@ -226,7 +226,7 @@ i915:whl: i915:cml: extends: - .i915 - parallel: 6 + parallel: 2 variables: DEVICE_TYPE: asus-C436FA-Flip-hatch GPU_VERSION: cml
@@ -235,7 +235,7 @@ i915:cml: i915:tgl: extends: - .i915 - parallel: 6 + parallel: 8 variables: DEVICE_TYPE: asus-cx9400-volteer GPU_VERSION: tgl
@@ -254,6 +254,7 @@ i915:tgl: amdgpu:stoney: extends: - .amdgpu + parallel: 2 variables: DEVICE_TYPE: hp-11A-G6-EE-grunt GPU_VERSION: stoney
@@ -272,6 +273,7 @@ amdgpu:stoney: mediatek:mt8173: extends: - .mediatek + parallel: 4 variables: DEVICE_TYPE: mt8173-elm-hana GPU_VERSION: mt8173
@@ -283,6 +285,7 @@ mediatek:mt8173: mediatek:mt8183: extends: - .mediatek + parallel: 3 variables: DEVICE_TYPE: mt8183-kukui-jacuzzi-juniper-sku16 GPU_VERSION: mt8183
@@ -292,6 +295,7 @@ mediatek:mt8183: .mediatek:mt8192: extends: - .mediatek + parallel: 3 variables: DEVICE_TYPE: mt8192-asurada-spherion-r0 GPU_VERSION: mt8192
@@ -310,6 +314,7 @@ mediatek:mt8183: meson:g12b: extends: - .meson + parallel: 3 variables: DEVICE_TYPE: meson-g12b-a311d-khadas-vim3 GPU_VERSION: g12b
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 270/744 drm/ci: update device type for volteer devices
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Vignesh Raman <[email protected]>
[ Upstream commit a2c71b711e7efc6478976233768bdbc3386e6dce ]
Volteer devices in the collabora lab are categorized under the asus-cx9400-volteer device type. The majority of these units has an Intel Core i5-1130G7 CPU, while some of them have a Intel Core i7-1160G7 CPU instead. So due to this difference, new device type template is added for the Intel Core i5-1130G7 and i7-1160G7 variants of the Acer Chromebook Spin 514 (CP514-2H) volteer Chromebooks. So update the same in drm-ci.
https://gitlab.collabora.com/lava/lava/-/merge_requests/149
--- drivers/gpu/drm/ci/test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/ci/test.yml +3 -3
@@ -235,11 +235,11 @@ i915:cml: i915:tgl: extends: - .i915 - parallel: 8 + parallel: 5 variables: - DEVICE_TYPE: asus-cx9400-volteer + DEVICE_TYPE: acer-cp514-2h-1130g7-volteer GPU_VERSION: tgl - RUNNER_TAG: mesa-ci-x86-64-lava-asus-cx9400-volteer + RUNNER_TAG: mesa-ci-x86-64-lava-acer-cp514-2h-1130g7-volteer .amdgpu: extends:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 271/744 drm/omapdrm: Fix console by implementing fb_dirty
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit 632bac50544c0929ced9eed41e7d04c08adecbb0 ]
The framebuffer console stopped updating with commit f231af498c29 ("drm/fb-helper: Disconnect damage worker from update logic").
Let's fix the issue by implementing fb_dirty similar to what was done with commit 039a72ce7e57 ("drm/i915/fbdev: Implement fb_dirty for intel custom fb helper").
--- drivers/gpu/drm/omapdrm/omap_fbdev.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)
drivers/gpu/drm/omapdrm/omap_fbdev.c +12 -0
@@ -238,8 +238,20 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,return ret; } +static int omap_fbdev_dirty (struct drm_fb_helper *helper,struct drm_clip_rect *clip) +{ +if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) +return 0 ; + +if (helper->fb->funcs->dirty) +return helper->fb->funcs->dirty (helper->fb,NULL ,0 ,0 , clip,1 ); + +return 0 ; +} +static const struct drm_fb_helper_funcs omap_fb_helper_funcs = { .fb_probe = omap_fbdev_create, + .fb_dirty = omap_fbdev_dirty, };static struct drm_fb_helper *get_fb (struct fb_info *fbi)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 272/744 fbdev: Provide I/O-memory helpers as module
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
[ Upstream commit 6b180f66c0dd6266eeb2f74b59ee79a9f14fe430 ]
Provide helpers for accessing I/O memory in a helper module. The fbdev core uses these helpers, so select the module unconditionally for fbdev. Drivers will later be able to select the module individually and the helpers will become optional.
Stable-dep-of: 01c0cce88c54 ("drm/omapdrm: Fix console with deferred ops")
--- drivers/video/fbdev/core/Kconfig | 6 ++++++ drivers/video/fbdev/core/Makefile | 3 ++- drivers/video/fbdev/core/fb_io_fops.c | 3 +++ 3 files changed, 11 insertions(+), 1 deletion(-)
drivers/video/fbdev/core/Kconfig +6 -0
@@ -4,6 +4,7 @@ # config FB_CORE + select FB_IOMEM_FOPS select VIDEO_CMDLINE tristate
@@ -144,12 +145,17 @@ config FB_DMAMEM_HELPERS select FB_SYS_FOPS select FB_SYS_IMAGEBLIT +config FB_IOMEM_FOPS + tristate + depends on FB_CORE + config FB_IOMEM_HELPERS bool depends on FB_CORE select FB_CFB_COPYAREA select FB_CFB_FILLRECT select FB_CFB_IMAGEBLIT + select FB_IOMEM_FOPS config FB_SYSMEM_HELPERS bool
drivers/video/fbdev/core/Makefile +2 -1
@@ -3,7 +3,7 @@ obj-$(CONFIG_FB_NOTIFY) += fb_notify.o obj-$(CONFIG_FB_CORE) += fb.o fb-y := fb_info.o \ fbmem.o fbcmap.o \ - modedb.o fbcvt.o fb_cmdline.o fb_io_fops.o + modedb.o fbcvt.o fb_cmdline.o ifdef CONFIG_FB fb-y += fb_backlight.o fbmon.o endif
@@ -26,6 +26,7 @@ endif obj-$(CONFIG_FB_CFB_FILLRECT) += cfbfillrect.o obj-$(CONFIG_FB_CFB_COPYAREA) += cfbcopyarea.o obj-$(CONFIG_FB_CFB_IMAGEBLIT) += cfbimgblt.o +obj-$(CONFIG_FB_IOMEM_FOPS) += fb_io_fops.o obj-$(CONFIG_FB_SYS_FILLRECT) += sysfillrect.o obj-$(CONFIG_FB_SYS_COPYAREA) += syscopyarea.o obj-$(CONFIG_FB_SYS_IMAGEBLIT) += sysimgblt.o
drivers/video/fbdev/core/fb_io_fops.c +3 -0
@@ -131,3 +131,6 @@ ssize_t fb_io_write(struct fb_info *info, const char __user *buf, size_t count,return (cnt) ? cnt : err; }EXPORT_SYMBOL (fb_io_write); + +MODULE_DESCRIPTION ("Fbdev helpers for framebuffers in I/O memory" ); +MODULE_LICENSE ("GPL" );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 273/744 drm/omapdrm: Fix console with deferred ops
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit 01c0cce88c5480cc2505b79330246ef12eda938f ]
Commit 95da53d63dcf ("drm/omapdrm: Use regular fbdev I/O helpers") stopped console from updating for command mode displays because there is no damage handling in fb_sys_write() unlike we had earlier in drm_fb_helper_sys_write().
Let's fix the issue by adding FB_GEN_DEFAULT_DEFERRED_DMAMEM_OPS and FB_DMAMEM_HELPERS_DEFERRED as suggested by Thomas. We cannot use the FB_DEFAULT_DEFERRED_OPS as fb_deferred_io_mmap() won't work properly for write-combine.
--- drivers/gpu/drm/omapdrm/Kconfig | 2 +- drivers/gpu/drm/omapdrm/omap_fbdev.c | 28 ++++++++++++++++++++++------ drivers/video/fbdev/core/Kconfig | 6 ++++++ include/linux/fb.h | 4 ++++ 4 files changed, 33 insertions(+), 7 deletions(-)
drivers/gpu/drm/omapdrm/Kconfig +1 -1
@@ -4,7 +4,7 @@ config DRM_OMAP depends on DRM && OF depends on ARCH_OMAP2PLUS select DRM_KMS_HELPER - select FB_DMAMEM_HELPERS if DRM_FBDEV_EMULATION + select FB_DMAMEM_HELPERS_DEFERRED if DRM_FBDEV_EMULATION select VIDEOMODE_HELPERS select HDMI default n
drivers/gpu/drm/omapdrm/omap_fbdev.c +22 -6
@@ -51,6 +51,10 @@ static void pan_worker(struct work_struct *work)omap_gem_roll (bo, fbi->var.yoffset * npages); } +FB_GEN_DEFAULT_DEFERRED_DMAMEM_OPS (omap_fbdev, + drm_fb_helper_damage_range, + drm_fb_helper_damage_area) +static int omap_fbdev_pan_display (struct fb_var_screeninfo *var,struct fb_info *fbi) {
@@ -78,11 +82,9 @@ static int omap_fbdev_pan_display(struct fb_var_screeninfo *var,static int omap_fbdev_fb_mmap (struct fb_info *info,struct vm_area_struct *vma) { -struct drm_fb_helper *helper = info->par; -struct drm_framebuffer *fb = helper->fb; -struct drm_gem_object *bo =drm_gem_fb_get_obj (fb,0 ); + vma->vm_page_prot =pgprot_writecombine (vm_get_page_prot (vma->vm_flags)); -return drm_gem_mmap_obj (bo,omap_gem_mmap_size (bo), vma); +return fb_deferred_io_mmap (info, vma); }static void omap_fbdev_fb_destroy (struct fb_info *info)
@@ -94,6 +96,7 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)DBG (); +fb_deferred_io_cleanup (info);drm_fb_helper_fini (helper);omap_gem_unpin (bo);
@@ -104,15 +107,19 @@ static void omap_fbdev_fb_destroy(struct fb_info *info)kfree (fbdev); } +/* +* For now, we cannot use FB_DEFAULT_DEFERRED_OPS and fb_deferred_io_mmap() +* because we use write-combine. +*/ static const struct fb_ops omap_fb_ops = { .owner =THIS_MODULE , - __FB_DEFAULT_DMAMEM_OPS_RDWR, +__FB_DEFAULT_DEFERRED_OPS_RDWR (omap_fbdev), .fb_check_var = drm_fb_helper_check_var, .fb_set_par = drm_fb_helper_set_par, .fb_setcmap = drm_fb_helper_setcmap, .fb_blank = drm_fb_helper_blank, .fb_pan_display = omap_fbdev_pan_display, - __FB_DEFAULT_DMAMEM_OPS_DRAW, +__FB_DEFAULT_DEFERRED_OPS_DRAW (omap_fbdev), .fb_ioctl = drm_fb_helper_ioctl, .fb_mmap = omap_fbdev_fb_mmap, .fb_destroy = omap_fbdev_fb_destroy,
@@ -213,6 +220,15 @@ static int omap_fbdev_create(struct drm_fb_helper *helper, fbi->fix.smem_start = dma_addr; fbi->fix.smem_len = bo->size; +/* deferred I/O */ + helper->fbdefio.delay =HZ /20 ; + helper->fbdefio.deferred_io = drm_fb_helper_deferred_io; + + fbi->fbdefio = &helper->fbdefio; + ret =fb_deferred_io_init (fbi); +if (ret) + goto fail; +/* if we have DMM, then we can use it for scrolling by just * shuffling pages around in DMM rather than doing sw blit. */
drivers/video/fbdev/core/Kconfig +6 -0
@@ -145,6 +145,12 @@ config FB_DMAMEM_HELPERS select FB_SYS_FOPS select FB_SYS_IMAGEBLIT +config FB_DMAMEM_HELPERS_DEFERRED + bool + depends on FB_CORE + select FB_DEFERRED_IO + select FB_DMAMEM_HELPERS + config FB_IOMEM_FOPS tristate depends on FB_CORE
include/linux/fb.h +4 -0
@@ -690,6 +690,10 @@ extern int fb_deferred_io_fsync(struct file *file, loff_t start, __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \ __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys) +#define FB_GEN_DEFAULT_DEFERRED_DMAMEM_OPS (__prefix, __damage_range, __damage_area) \ + __FB_GEN_DEFAULT_DEFERRED_OPS_RDWR(__prefix, __damage_range, sys) \ + __FB_GEN_DEFAULT_DEFERRED_OPS_DRAW(__prefix, __damage_area, sys) +/* * Initializes struct fb_ops for deferred I/O. */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 274/744 printk: Let no_printk() use _printk()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 8522f6b760ca588928eede740d5d69dd1e936b49 ]
When printk-indexing is enabled, each printk() invocation emits a pi_entry structure, containing the format string and other information related to its location in the kernel sources. This is even true for no_printk(): while the actual code to print the message is optimized out by the compiler due to the always-false check, the pi_entry structure is still emitted.
As the main purpose of no_printk() is to provide a helper to maintain printf()-style format checking when debugging is disabled, this leads to the inclusion in the index of lots of printk formats that cannot be emitted by the current kernel.
Fix this by switching no_printk() from printk() to _printk().
This reduces the size of an arm64 defconfig kernel with CONFIG_PRINTK_INDEX=y by 576 KiB.
--- include/linux/printk.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/printk.h +1 -1
@@ -126,7 +126,7 @@ struct va_format {#define no_printk (fmt, ...) \ ({ \ if (0) \ - printk(fmt, ##__VA_ARGS__); \ + _printk(fmt, ##__VA_ARGS__); \ 0; \ })
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 275/744 dev_printk: Add and use dev_no_printk()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit c26ec799042a3888935d59b599f33e41efedf5f8 ]
When printk-indexing is enabled, each dev_printk() invocation emits a pi_entry structure. This is even true when the dev_printk() is protected by an always-false check, as is typically the case for debug
messages: while the actual code to print the message is optimized out by the compiler, the pi_entry structure is still emitted.
Avoid emitting pi_entry structures for unavailable dev_printk() kernel messages by:
1. Introducing a dev_no_printk() helper, mimicked after the existing no_printk() helper, which calls _dev_printk() instead of dev_printk(),
2. Replacing all "if (0) dev_printk(...)" constructs by calls to the new helper.
This reduces the size of an arm64 defconfig kernel with CONFIG_PRINTK_INDEX=y by 957 KiB.
--- include/linux/dev_printk.h | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-)
include/linux/dev_printk.h +13 -12
@@ -129,6 +129,16 @@ void _dev_info(const struct device *dev, const char *fmt, ...) _dev_printk(level, dev, fmt, ##__VA_ARGS__); \ }) +/* +* Dummy dev_printk for disabled debugging statements to use whilst maintaining +* gcc's format checking. +*/ +#define dev_no_printk (level, dev, fmt, ...) \ + ({ \ + if (0) \ + _dev_printk(level, dev, fmt, ##__VA_ARGS__); \ + }) +/* * #defines for all the dev_<level> macros to prefix with whatever * possible use of #define dev_fmt(fmt) ...
@@ -158,10 +168,7 @@ void _dev_info(const struct device *dev, const char *fmt, ...) dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)#else #define dev_dbg (dev, fmt, ...) \ -({ \ - if (0) \ - dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ -}) + dev_no_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)#endif #ifdef CONFIG_PRINTK
@@ -247,20 +254,14 @@ do { \ } while (0)#else #define dev_dbg_ratelimited (dev, fmt, ...) \ -do { \ - if (0) \ - dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ -} while (0) + dev_no_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)#endif #ifdef VERBOSE_DEBUG #define dev_vdbg dev_dbg#else #define dev_vdbg (dev, fmt, ...) \ -({ \ - if (0) \ - dev_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__); \ -}) + dev_no_printk(KERN_DEBUG, dev, dev_fmt(fmt), ##__VA_ARGS__)#endif /*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 276/744 drm/lcdif: Do not disable clocks on already suspended hardware
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit 172695f145fb4798ab605e8a73f6e87711930124 ]
In case the LCDIF is enabled in DT but unused, the clocks used by the LCDIF are not enabled. Those clocks may even have a use count of 0 in case there are no other users of those clocks. This can happen e.g. in case the LCDIF drives HDMI bridge which has no panel plugged into the HDMI connector.
Do not attempt to disable clocks in the suspend callback and re-enable clocks in the resume callback unless the LCDIF is enabled and was in use before the system entered suspend, otherwise the driver might end up trying to disable clocks which are already disabled with use count 0, and would trigger a warning from clock core about this condition.
Note that the lcdif_rpm_suspend() and lcdif_rpm_resume() functions internally perform the clocks disable and enable operations and act as runtime PM hooks too.
--- drivers/gpu/drm/mxsfb/lcdif_drv.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/mxsfb/lcdif_drv.c +5 -1
@@ -340,6 +340,9 @@ static int __maybe_unused lcdif_suspend(struct device *dev)if (ret)return ret; +if (pm_runtime_suspended (dev)) +return 0 ; +return lcdif_rpm_suspend (dev); }
@@ -347,7 +350,8 @@ static int __maybe_unused lcdif_resume(struct device *dev) {struct drm_device *drm =dev_get_drvdata (dev); -lcdif_rpm_resume (dev); +if (!pm_runtime_suspended (dev)) +lcdif_rpm_resume (dev);return drm_mode_config_helper_resume (drm); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 277/744 drm/dp: Dont attempt AUX transfers when eDP panels are not powered
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 8df1ddb5bf11ab820ad991e164dab82c0960add9 ]
If an eDP panel is not powered on then any attempts to talk to it over the DP AUX channel will timeout. Unfortunately these attempts may be quite slow. Userspace can initiate these attempts either via a /dev/drm_dp_auxN device or via the created i2c device.
Making the DP AUX drivers timeout faster is a difficult proposition. In theory we could just poll the panel's HPD line in the AUX transfer function and immediately return an error there. However, this is easier said than done. For one thing, there's no hard requirement to hook the HPD line up for eDP panels and it's OK to just delay a fixed amount. For another thing, the HPD line may not be fast to probe. On parade-ps8640 we need to wait for the bridge chip's firmware to boot before we can get the HPD line and this is a slow process.
The fact that the transfers are taking so long to timeout is causing real problems. The open source fwupd daemon sometimes scans DP busses looking for devices whose firmware need updating. If it happens to scan while a panel is turned off this scan can take a long time. The fwupd daemon could try to be smarter and only scan when eDP panels are turned on, but we can also improve the behavior in the kernel.
Let's let eDP panels drivers specify that a panel is turned off and then modify the common AUX transfer code not to attempt a transfer in this case.
Stable-dep-of: 5e842d55bad7 ("drm/panel: atna33xc20: Fix unbalanced regulator in the case HPD doesn't assert")
--- drivers/gpu/drm/display/drm_dp_helper.c | 35 +++++++++++++++++++ drivers/gpu/drm/panel/panel-edp.c | 3 ++ .../gpu/drm/panel/panel-samsung-atna33xc20.c | 2 ++ include/drm/display/drm_dp_helper.h | 6 ++++ 4 files changed, 46 insertions(+)
drivers/gpu/drm/display/drm_dp_helper.c +35 -0
@@ -532,6 +532,15 @@ static int drm_dp_dpcd_access(struct drm_dp_aux *aux, u8 request,mutex_lock (&aux->hw_mutex); +/* +* If the device attached to the aux bus is powered down then there's +* no reason to attempt a transfer. Error out immediately. +*/ +if (aux->powered_down) { + ret = -EBUSY ; + goto unlock; + } +/* * The specification doesn't give any recommendation on how often to * retry native transactions. We used to retry 7 times like for
@@ -599,6 +608,29 @@ int drm_dp_dpcd_probe(struct drm_dp_aux *aux, unsigned int offset) }EXPORT_SYMBOL (drm_dp_dpcd_probe); +/** +* drm_dp_dpcd_set_powered() - Set whether the DP device is powered +* @aux: DisplayPort AUX channel; for convenience it's OK to pass NULL here +* and the function will be a no-op. +* @powered: true if powered; false if not +* +* If the endpoint device on the DP AUX bus is known to be powered down +* then this function can be called to make future transfers fail immediately +* instead of needing to time out. +* +* If this function is never called then a device defaults to being powered. +*/ +void drm_dp_dpcd_set_powered (struct drm_dp_aux *aux,bool powered) +{ +if (!aux) +return ; + +mutex_lock (&aux->hw_mutex); + aux->powered_down = !powered; +mutex_unlock (&aux->hw_mutex); +} +EXPORT_SYMBOL (drm_dp_dpcd_set_powered); +/** * drm_dp_dpcd_read() - read a series of bytes from the DPCD * @aux: DisplayPort AUX channel (SST or MST)
@@ -1855,6 +1887,9 @@ static int drm_dp_i2c_xfer(struct i2c_adapter *adapter, struct i2c_msg *msgs,struct drm_dp_aux_msg msg;int err =0 ; +if (aux->powered_down) +return -EBUSY ; + dp_aux_i2c_transfer_size =clamp (dp_aux_i2c_transfer_size,1 ,DP_AUX_MAX_PAYLOAD_BYTES );memset (&msg,0 ,sizeof (msg));
drivers/gpu/drm/panel/panel-edp.c +3 -0
@@ -397,6 +397,7 @@ static int panel_edp_suspend(struct device *dev) {struct panel_edp *p =dev_get_drvdata (dev); +drm_dp_dpcd_set_powered (p->aux, false);gpiod_set_value_cansleep (p->enable_gpio,0 );regulator_disable (p->supply); p->unprepared_time =ktime_get_boottime ();
@@ -453,6 +454,7 @@ static int panel_edp_prepare_once(struct panel_edp *p) }gpiod_set_value_cansleep (p->enable_gpio,1 ); +drm_dp_dpcd_set_powered (p->aux, true); delay = p->desc->delay.hpd_reliable;if (p->no_hpd)
@@ -489,6 +491,7 @@ static int panel_edp_prepare_once(struct panel_edp *p)return 0 ; error: +drm_dp_dpcd_set_powered (p->aux, false);gpiod_set_value_cansleep (p->enable_gpio,0 );regulator_disable (p->supply); p->unprepared_time =ktime_get_boottime ();
drivers/gpu/drm/panel/panel-samsung-atna33xc20.c +2 -0
@@ -72,6 +72,7 @@ static int atana33xc20_suspend(struct device *dev)if (p->el3_was_on)atana33xc20_wait (p->el_on3_off_time,150 ); +drm_dp_dpcd_set_powered (p->aux, false); ret =regulator_disable (p->supply);if (ret)return ret;
@@ -93,6 +94,7 @@ static int atana33xc20_resume(struct device *dev) ret =regulator_enable (p->supply);if (ret)return ret; +drm_dp_dpcd_set_powered (p->aux, true); p->powered_on_time =ktime_get_boottime ();if (p->no_hpd) {
include/drm/display/drm_dp_helper.h +6 -0
@@ -449,9 +449,15 @@ struct drm_dp_aux {* @is_remote: Is this AUX CH actually using sideband messaging. */ bool is_remote; + +/** +* @powered_down: If true then the remote endpoint is powered down. +*/ +bool powered_down; };int drm_dp_dpcd_probe (struct drm_dp_aux *aux,unsigned int offset); +void drm_dp_dpcd_set_powered (struct drm_dp_aux *aux,bool powered);ssize_t drm_dp_dpcd_read (struct drm_dp_aux *aux,unsigned int offset,void *buffer,size_t size); ssize_t drm_dp_dpcd_write(struct drm_dp_aux *aux, unsigned int offset,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 278/744 drm/panel: atna33xc20: Fix unbalanced regulator in the case HPD doesnt assert
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 5e842d55bad7794823a50f24fd645b58f2ef93ab ]
When the atna33xc20 driver was first written the resume code never returned an error. If there was a problem waiting for HPD it just printed a warning and moved on. This changed in response to review feedback [1] on a future patch but I accidentally didn't account for rolling back the regulator enable in the error cases. Do so now.
[1] https://lore.kernel.org/all/[email protected]/
--- .../gpu/drm/panel/panel-samsung-atna33xc20.c | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-)
drivers/gpu/drm/panel/panel-samsung-atna33xc20.c +13 -9
@@ -109,19 +109,17 @@ static int atana33xc20_resume(struct device *dev)if (hpd_asserted <0 ) ret = hpd_asserted; -if (ret) +if (ret) {dev_warn (dev,"Error waiting for HPD GPIO: %d\n" , ret); - -return ret; - } - -if (p->aux->wait_hpd_asserted) { + goto error; + } + }else if (p->aux->wait_hpd_asserted) { ret = p->aux->wait_hpd_asserted (p->aux,HPD_MAX_US ); -if (ret) +if (ret) {dev_warn (dev,"Controller error waiting for HPD: %d\n" , ret); - -return ret; + goto error; + } }/*
@@ -133,6 +131,12 @@ static int atana33xc20_resume(struct device *dev)* right times. */ return 0 ; + +error: +drm_dp_dpcd_set_powered (p->aux, false); +regulator_disable (p->supply); + +return ret; }static int atana33xc20_disable (struct drm_panel *panel)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 279/744 drm/amd/display: Fix potential index out of bounds in color transformation function
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
[ Upstream commit 63ae548f1054a0b71678d0349c7dc9628ddd42ca ]
Fixes index out of bounds issue in the color transformation function. The issue could occur when the index 'i' exceeds the number of transfer function points (TRANSFER_FUNC_POINTS).
The fix adds a check to ensure 'i' is within bounds before accessing the transfer function points. If 'i' is out of bounds, an error message is logged and the function returns false to indicate an error.
Reported by smatch:drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:405 cm_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.red' 1025 <= s32max drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:406 cm_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.green' 1025 <= s32max drivers/gpu/drm/amd/amdgpu/../display/dc/dcn10/dcn10_cm_common.c:407 cm_helper_translate_curve_to_hw_format() error: buffer overflow 'output_tf->tf_pts.blue' 1025 <= s32max
--- drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_cm_common.c +5 -0
@@ -382,6 +382,11 @@ bool cm_helper_translate_curve_to_hw_format(struct dc_context *ctx, i += increment) {if (j == hw_points -1 )break ; +if (i >=TRANSFER_FUNC_POINTS ) { +DC_LOG_ERROR ("Index out of bounds: i=%d, TRANSFER_FUNC_POINTS=%d\n" , + i,TRANSFER_FUNC_POINTS ); +return false; + } rgb_resulted[j].red = output_tf->tf_pts.red[i]; rgb_resulted[j].green = output_tf->tf_pts.green[i]; rgb_resulted[j].blue = output_tf->tf_pts.blue[i];
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 280/744 ASoC: Intel: Disable route checks for Skylake boards
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cezary Rojewski <[email protected]>
[ Upstream commit 0cb3b7fd530b8c107443218ce6db5cb6e7b5dbe1 ]
Topology files that are propagated to the world and utilized by the skylake-driver carry shortcomings in their SectionGraphs.
Since commit daa480bde6b3 ("ASoC: soc-core: tidyup for snd_soc_dapm_add_routes()") route checks are no longer permissive. Probe failures for Intel boards have been partially addressed by commit a22ae72b86a4 ("ASoC: soc-core: disable route checks for legacy devices") and its follow up but only skl_nau88l25_ssm4567.c is patched. Fix the problem for the rest of the boards.
--- sound/soc/intel/boards/bxt_da7219_max98357a.c | 1 + sound/soc/intel/boards/bxt_rt298.c | 1 + sound/soc/intel/boards/glk_rt5682_max98357a.c | 2 ++ sound/soc/intel/boards/kbl_da7219_max98357a.c | 1 + sound/soc/intel/boards/kbl_da7219_max98927.c | 4 ++++ sound/soc/intel/boards/kbl_rt5660.c | 1 + sound/soc/intel/boards/kbl_rt5663_max98927.c | 2 ++ sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c | 1 + sound/soc/intel/boards/skl_hda_dsp_generic.c | 2 ++ sound/soc/intel/boards/skl_nau88l25_max98357a.c | 1 + sound/soc/intel/boards/skl_rt286.c | 1 + 11 files changed, 17 insertions(+)
sound/soc/intel/boards/bxt_da7219_max98357a.c +1 -0
@@ -768,6 +768,7 @@ static struct snd_soc_card broxton_audio_card = { .dapm_routes = audio_map, .num_dapm_routes = ARRAY_SIZE(audio_map), .fully_routed = true, + .disable_route_checks = true, .late_probe = bxt_card_late_probe, };
sound/soc/intel/boards/bxt_rt298.c +1 -0
@@ -574,6 +574,7 @@ static struct snd_soc_card broxton_rt298 = { .dapm_routes = broxton_rt298_map, .num_dapm_routes = ARRAY_SIZE(broxton_rt298_map), .fully_routed = true, + .disable_route_checks = true, .late_probe = bxt_card_late_probe, };
sound/soc/intel/boards/glk_rt5682_max98357a.c +2 -0
@@ -649,6 +649,8 @@ static int geminilake_audio_probe(struct platform_device *pdev) card = &glk_audio_card_rt5682_m98357a; card->dev = &pdev->dev;snd_soc_card_set_drvdata (card, ctx); +if (!snd_soc_acpi_sof_parent (&pdev->dev)) + card->disable_route_checks = true;/* override platform name, if required */ mach = pdev->dev.platform_data;
sound/soc/intel/boards/kbl_da7219_max98357a.c +1 -0
@@ -639,6 +639,7 @@ static struct snd_soc_card kabylake_audio_card_da7219_m98357a = { .dapm_routes = kabylake_map, .num_dapm_routes = ARRAY_SIZE(kabylake_map), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
sound/soc/intel/boards/kbl_da7219_max98927.c +4 -0
@@ -1036,6 +1036,7 @@ static struct snd_soc_card kbl_audio_card_da7219_m98927 = { .codec_conf = max98927_codec_conf, .num_configs = ARRAY_SIZE(max98927_codec_conf), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
@@ -1054,6 +1055,7 @@ static struct snd_soc_card kbl_audio_card_max98927 = { .codec_conf = max98927_codec_conf, .num_configs = ARRAY_SIZE(max98927_codec_conf), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
@@ -1071,6 +1073,7 @@ static struct snd_soc_card kbl_audio_card_da7219_m98373 = { .codec_conf = max98373_codec_conf, .num_configs = ARRAY_SIZE(max98373_codec_conf), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
@@ -1088,6 +1091,7 @@ static struct snd_soc_card kbl_audio_card_max98373 = { .codec_conf = max98373_codec_conf, .num_configs = ARRAY_SIZE(max98373_codec_conf), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
sound/soc/intel/boards/kbl_rt5660.c +1 -0
@@ -518,6 +518,7 @@ static struct snd_soc_card kabylake_audio_card_rt5660 = { .dapm_routes = kabylake_rt5660_map, .num_dapm_routes = ARRAY_SIZE(kabylake_rt5660_map), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
sound/soc/intel/boards/kbl_rt5663_max98927.c +2 -0
@@ -966,6 +966,7 @@ static struct snd_soc_card kabylake_audio_card_rt5663_m98927 = { .codec_conf = max98927_codec_conf, .num_configs = ARRAY_SIZE(max98927_codec_conf), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
@@ -982,6 +983,7 @@ static struct snd_soc_card kabylake_audio_card_rt5663 = { .dapm_routes = kabylake_5663_map, .num_dapm_routes = ARRAY_SIZE(kabylake_5663_map), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
sound/soc/intel/boards/kbl_rt5663_rt5514_max98927.c +1 -0
@@ -791,6 +791,7 @@ static struct snd_soc_card kabylake_audio_card = { .codec_conf = max98927_codec_conf, .num_configs = ARRAY_SIZE(max98927_codec_conf), .fully_routed = true, + .disable_route_checks = true, .late_probe = kabylake_card_late_probe, };
sound/soc/intel/boards/skl_hda_dsp_generic.c +2 -0
@@ -227,6 +227,8 @@ static int skl_hda_audio_probe(struct platform_device *pdev) ctx->common_hdmi_codec_drv = mach->mach_params.common_hdmi_codec_drv; hda_soc_card.dev = &pdev->dev; +if (!snd_soc_acpi_sof_parent (&pdev->dev)) + hda_soc_card.disable_route_checks = true;if (mach->mach_params.dmic_num >0 ) { snprintf(hda_soc_components, sizeof(hda_soc_components),
sound/soc/intel/boards/skl_nau88l25_max98357a.c +1 -0
@@ -654,6 +654,7 @@ static struct snd_soc_card skylake_audio_card = { .dapm_routes = skylake_map, .num_dapm_routes = ARRAY_SIZE(skylake_map), .fully_routed = true, + .disable_route_checks = true, .late_probe = skylake_card_late_probe, };
sound/soc/intel/boards/skl_rt286.c +1 -0
@@ -523,6 +523,7 @@ static struct snd_soc_card skylake_rt286 = { .dapm_routes = skylake_rt286_map, .num_dapm_routes = ARRAY_SIZE(skylake_rt286_map), .fully_routed = true, + .disable_route_checks = true, .late_probe = skylake_card_late_probe, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 281/744 ASoC: Intel: avs: ssm4567: Do not ignore route checks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cezary Rojewski <[email protected]>
[ Upstream commit e6719d48ba6329536c459dcee5a571e535687094 ]
A copy-paste from intel/boards/skl_nau88l25_ssm4567.c made the avs's equivalent disable route checks as well. Such behavior is not desired.
--- sound/soc/intel/avs/boards/ssm4567.c | 1 - 1 file changed, 1 deletion(-)
sound/soc/intel/avs/boards/ssm4567.c +0 -1
@@ -166,7 +166,6 @@ static int avs_ssm4567_probe(struct platform_device *pdev) card->dapm_routes = card_base_routes; card->num_dapm_routes =ARRAY_SIZE (card_base_routes); card->fully_routed = true; - card->disable_route_checks = true; ret =snd_soc_fixup_dai_links_platform_name (card, pname);if (ret)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 282/744 mtd: core: Report error if first mtd_otp_size() call fails in mtd_otp_nvmem_add()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aapo Vienamo <[email protected]>
[ Upstream commit d44f0bbbd8d182debcce88bda55b05269f3d33d6 ]
Jump to the error reporting code in mtd_otp_nvmem_add() if the mtd_otp_size() call fails. Without this fix, the error is not logged.
--- drivers/mtd/mtdcore.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/mtd/mtdcore.c +4 -2
@@ -955,8 +955,10 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd)if (mtd->_get_user_prot_info && mtd->_read_user_prot_reg) { size =mtd_otp_size (mtd, true); -if (size <0 ) -return size; +if (size <0 ) { + err = size; + goto err; + }if (size >0 ) { nvmem = mtd_otp_nvmem_register(mtd, "user-otp", size,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 283/744 mtd: rawnand: hynix: fixed typo
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Maxim Korotkov <[email protected]>
[ Upstream commit 6819db94e1cd3ce24a432f3616cd563ed0c4eaba ]
The function hynix_nand_rr_init() should probably return an error code. Judging by the usage, it seems that the return code is passed up the call stack.
Right now, it always returns 0 and the function hynix_nand_cleanup() in hynix_nand_init() has never been called.
Found by RASU JSC and Linux Verification Center (linuxtesting.org)
--- drivers/mtd/nand/raw/nand_hynix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/nand/raw/nand_hynix.c +1 -1
@@ -402,7 +402,7 @@ static int hynix_nand_rr_init(struct nand_chip *chip)if (ret)pr_warn ("failed to initialize read-retry infrastructure" ); -return 0 ; +return ret; } static void hynix_nand_extract_oobsize(struct nand_chip *chip,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 284/744 ASoC: mediatek: Assign dummy when codec not specified for a DAI link
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: AngeloGioacchino Del Regno <[email protected]>
[ Upstream commit 5f39231888c63f0a7708abc86b51b847476379d8 ]
MediaTek sound card drivers are checking whether a DAI link is present and used on a board to assign the correct parameters and this is done by checking the codec DAI names at probe time.
If no real codec is present, assign the dummy codec to the DAI link to avoid NULL pointer during string comparison.
--- sound/soc/mediatek/common/mtk-soundcard-driver.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/soc/mediatek/common/mtk-soundcard-driver.c +5 -1
@@ -22,7 +22,11 @@ static int set_card_codec_info(struct snd_soc_card *card, codec_node =of_get_child_by_name (sub_node,"codec" );if (!codec_node) { -dev_dbg (dev,"%s no specified codec\n" , dai_link->name); +dev_dbg (dev,"%s no specified codec: setting dummy.\n" , dai_link->name); + + dai_link->codecs = &snd_soc_dummy_dlc; + dai_link->num_codecs =1 ; + dai_link->dynamic =1 ;return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 285/744 fbdev: shmobile: fix snprintf truncation
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 26c8cfb9d1e4b252336d23dd5127a8cbed414a32 ]
The name of the overlay does not fit into the fixed-length field:
drivers/video/fbdev/sh_mobile_lcdcfb.c:1577:2: error: 'snprintf' will always be truncated; specified size is 16, but format string expands to at least 25
Make it short enough by changing the string.
--- drivers/video/fbdev/sh_mobile_lcdcfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/video/fbdev/sh_mobile_lcdcfb.c +1 -1
@@ -1575,7 +1575,7 @@ sh_mobile_lcdc_overlay_fb_init(struct sh_mobile_lcdc_overlay *ovl)*/ info->fix = sh_mobile_lcdc_overlay_fix;snprintf (info->fix.id,sizeof (info->fix.id), -"SH Mobile LCDC Overlay %u" , ovl->index); +"SHMobile ovl %u" , ovl->index); info->fix.smem_start = ovl->dma_handle; info->fix.smem_len = ovl->fb_size; info->fix.line_length = ovl->pitch;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 286/744 ASoC: kirkwood: Fix potential NULL dereference
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Mishin <[email protected]>
[ Upstream commit ea60ab95723f5738e7737b56dda95e6feefa5b50 ]
In kirkwood_dma_hw_params() mv_mbus_dram_info() returns NULL if CONFIG_PLAT_ORION macro is not defined.
Fix this bug by adding NULL check.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- sound/soc/kirkwood/kirkwood-dma.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/kirkwood/kirkwood-dma.c +3 -0
@@ -182,6 +182,9 @@ static int kirkwood_dma_hw_params(struct snd_soc_component *component,const struct mbus_dram_target_info *dram =mv_mbus_dram_info ();unsigned long addr = substream->runtime->dma_addr; +if (!dram) +return 0 ; +if (substream->stream ==SNDRV_PCM_STREAM_PLAYBACK )kirkwood_dma_conf_mbus_windows (priv->io,KIRKWOOD_PLAYBACK_WIN , addr, dram);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 287/744 drm/meson: vclk: fix calculation of 59.94 fractional rates
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christian Hewitt <[email protected]>
[ Upstream commit bfbc68e4d8695497f858a45a142665e22a512ea3 ]
Playing 4K media with 59.94 fractional rate (typically VP9) causes the screen to lose sync with the following error reported in the system log:
[ 89.610280] Fatal Error, invalid HDMI vclk freq 593406
Modetest shows the following:
3840x2160 59.94 3840 4016 4104 4400 2160 2168 2178 2250 593407 flags: xxxx, xxxx, drm calculated value -------------------------------------^
Change the fractional rate calculation to stop DIV_ROUND_CLOSEST rounding down which results in vclk freq failing to match correctly.
--- drivers/gpu/drm/meson/meson_vclk.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/meson/meson_vclk.c +3 -3
@@ -790,13 +790,13 @@ meson_vclk_vic_supported_freq(struct meson_drm *priv, unsigned int phy_freq, FREQ_1000_1001(params[i].pixel_freq));DRM_DEBUG_DRIVER ("i = %d phy_freq = %d alt = %d\n" , i, params[i].phy_freq, -FREQ_1000_1001 (params[i].phy_freq/10 )*10 ); +FREQ_1000_1001 (params[i].phy_freq/1000 )*1000 );/* Match strict frequency */ if (phy_freq == params[i].phy_freq && vclk_freq == params[i].vclk_freq)return MODE_OK ;/* Match 1000/1001 variant */ -if (phy_freq == (FREQ_1000_1001 (params[i].phy_freq/10 )*10 ) && +if (phy_freq == (FREQ_1000_1001 (params[i].phy_freq/1000 )*1000 ) && vclk_freq ==FREQ_1000_1001 (params[i].vclk_freq))return MODE_OK ; }
@@ -1070,7 +1070,7 @@ void meson_vclk_setup(struct meson_drm *priv, unsigned int target,for (freq =0 ; params[freq].pixel_freq ; ++freq) {if ((phy_freq == params[freq].phy_freq || - phy_freq ==FREQ_1000_1001 (params[freq].phy_freq/10 )*10 ) && + phy_freq ==FREQ_1000_1001 (params[freq].phy_freq/1000 )*1000 ) && (vclk_freq == params[freq].vclk_freq || vclk_freq ==FREQ_1000_1001 (params[freq].vclk_freq))) {if (vclk_freq != params[freq].vclk_freq)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 288/744 drm/mediatek: Add 0 size check to mtk_drm_gem_obj
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Justin Green <[email protected]>
[ Upstream commit 1e4350095e8ab2577ee05f8c3b044e661b5af9a0 ]
Add a check to mtk_drm_gem_init if we attempt to allocate a GEM object of 0 bytes. Currently, no such check exists and the kernel will panic if a userspace application attempts to allocate a 0x0 GBM buffer.
Tested by attempting to allocate a 0x0 GBM buffer on an MT8188 and verifying that we now return EINVAL.
--- drivers/gpu/drm/mediatek/mtk_drm_gem.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/mediatek/mtk_drm_gem.c +3 -0
@@ -38,6 +38,9 @@ static struct mtk_drm_gem_obj *mtk_drm_gem_init(struct drm_device *dev, size =round_up (size,PAGE_SIZE ); +if (size ==0 ) +return ERR_PTR (-EINVAL ); + mtk_gem_obj =kzalloc (sizeof (*mtk_gem_obj),GFP_KERNEL );if (!mtk_gem_obj)return ERR_PTR (-ENOMEM );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 289/744 powerpc/fsl-soc: hide unused const variable
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 01acaf3aa75e1641442cc23d8fe0a7bb4226efb1 ]
vmpic_msi_feature is only used conditionally, which triggers a rare -Werror=unused-const-variable= warning with gcc:
arch/powerpc/sysdev/fsl_msi.c:567:37: error: 'vmpic_msi_feature' defined but not used [-Werror=unused-const-variable=]
567 | static const struct fsl_msi_feature vmpic_msi_feature =
Hide this one in the same #ifdef as the reference so we can turn on the warning by default.
--- arch/powerpc/sysdev/fsl_msi.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/sysdev/fsl_msi.c +2 -0
@@ -568,10 +568,12 @@ static const struct fsl_msi_feature ipic_msi_feature = { .msiir_offset = 0x38, }; +#ifdef CONFIG_EPAPR_PARAVIRT static const struct fsl_msi_feature vmpic_msi_feature = { .fsl_pic_ip =FSL_PIC_IP_VMPIC , .msiir_offset =0 , }; +#endif static const struct of_device_id fsl_of_msi_ids[] = { {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 290/744 ASoC: Intel: common: add ACPI matching tables for Arrow Lake
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arun T <[email protected]>
[ Upstream commit 24af0d7c0f9f49a243b77e607e3f4a4737386b59 ]
Initial support for ARL w/ RT711
Stable-dep-of: 1f1b820dc3c6 ("ASoC: SOF: Intel: mtl: Correct rom_status_reg")
--- include/sound/soc-acpi-intel-match.h | 2 + sound/soc/intel/common/Makefile | 1 + .../intel/common/soc-acpi-intel-arl-match.c | 51 +++++++++++++++++++ 3 files changed, 54 insertions(+) create mode 100644 sound/soc/intel/common/soc-acpi-intel-arl-match.c
include/sound/soc-acpi-intel-match.h +2 -0
@@ -32,6 +32,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cnl_sdw_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_cfl_sdw_machines[];
@@ -42,6 +43,7 @@ extern struct snd_soc_acpi_mach snd_soc_acpi_intel_adl_sdw_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_rpl_sdw_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_mtl_sdw_machines[];extern struct snd_soc_acpi_mach snd_soc_acpi_intel_lnl_sdw_machines[]; +extern struct snd_soc_acpi_mach snd_soc_acpi_intel_arl_sdw_machines[];/* * generic table used for HDA codec-based platforms, possibly with
sound/soc/intel/common/Makefile +1 -0
@@ -10,6 +10,7 @@ snd-soc-acpi-intel-match-objs := soc-acpi-intel-byt-match.o soc-acpi-intel-cht-m soc-acpi-intel-tgl-match.o soc-acpi-intel-ehl-match.o \ soc-acpi-intel-jsl-match.o soc-acpi-intel-adl-match.o \ soc-acpi-intel-rpl-match.o soc-acpi-intel-mtl-match.o \ + soc-acpi-intel-arl-match.o \ soc-acpi-intel-lnl-match.o \ soc-acpi-intel-hda-match.o \ soc-acpi-intel-sdw-mockup-match.o
sound/soc/intel/common/soc-acpi-intel-arl-match.c new file +51 -0
51 lines not on this page · raw message
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 291/744 ASoC: SOF: Intel: pci-mtl: use ARL specific firmware definitions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arun T <[email protected]>
[ Upstream commit 3851831f529ec3d7b2c7708b2579bfc00d43733c ]
Split out firmware definitions for Intel Arrow Lake platforms.
Stable-dep-of: 1f1b820dc3c6 ("ASoC: SOF: Intel: mtl: Correct rom_status_reg")
--- sound/soc/sof/intel/pci-mtl.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+)
sound/soc/sof/intel/pci-mtl.c +31 -0
@@ -50,9 +50,40 @@ static const struct sof_dev_desc mtl_desc = { .ops_free = hda_ops_free, }; +static const struct sof_dev_desc arl_desc = { + .use_acpi_target_states = true, + .machines = snd_soc_acpi_intel_arl_machines, + .alt_machines = snd_soc_acpi_intel_arl_sdw_machines, + .resindex_lpe_base =0 , + .resindex_pcicfg_base =-1 , + .resindex_imr_base =-1 , + .irqindex_host_ipc =-1 , + .chip_info = &mtl_chip_info, + .ipc_supported_mask =BIT (SOF_IPC_TYPE_4 ), + .ipc_default =SOF_IPC_TYPE_4 , + .dspless_mode_supported = true,/* Only supported for HDaudio */ + .default_fw_path = { + [SOF_IPC_TYPE_4 ] ="intel/sof-ipc4/arl" , + }, + .default_lib_path = { + [SOF_IPC_TYPE_4 ] ="intel/sof-ipc4-lib/arl" , + }, + .default_tplg_path = { + [SOF_IPC_TYPE_4 ] ="intel/sof-ace-tplg" , + }, + .default_fw_filename = { + [SOF_IPC_TYPE_4 ] ="sof-arl.ri" , + }, + .nocodec_tplg_filename ="sof-arl-nocodec.tplg" , + .ops = &sof_mtl_ops, + .ops_init = sof_mtl_ops_init, + .ops_free = hda_ops_free, +}; +/* PCI IDs */ static const struct pci_device_id sof_pci_ids[] = { {PCI_DEVICE_DATA (INTEL ,HDA_MTL , &mtl_desc) }, + {PCI_DEVICE_DATA (INTEL ,HDA_ARL_S , &arl_desc) }, {0 , } };MODULE_DEVICE_TABLE (pci, sof_pci_ids);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 292/744 ASoC: SOF: Intel: pci-mtl: fix ARL-S definitions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pierre-Louis Bossart <[email protected]>
[ Upstream commit a00be6dc9bb80796244196033aa5eb258b6af47a ]
The initial copy/paste from MTL was incorrect, the hardware is different and requires different descriptors along with a dedicated firmware binary.
Stable-dep-of: 1f1b820dc3c6 ("ASoC: SOF: Intel: mtl: Correct rom_status_reg")
--- sound/soc/sof/intel/hda.h | 1 + sound/soc/sof/intel/mtl.c | 28 ++++++++++++++++++++++++++++ sound/soc/sof/intel/pci-mtl.c | 12 ++++++------ 3 files changed, 35 insertions(+), 6 deletions(-)
sound/soc/sof/intel/hda.h +1 -0
@@ -876,6 +876,7 @@ extern const struct sof_intel_dsp_desc ehl_chip_info;extern const struct sof_intel_dsp_desc jsl_chip_info;extern const struct sof_intel_dsp_desc adls_chip_info;extern const struct sof_intel_dsp_desc mtl_chip_info; +extern const struct sof_intel_dsp_desc arl_s_chip_info;extern const struct sof_intel_dsp_desc lnl_chip_info;/* Probes support */
sound/soc/sof/intel/mtl.c +28 -0
@@ -743,3 +743,31 @@ const struct sof_intel_dsp_desc mtl_chip_info = { .hw_ip_version = SOF_INTEL_ACE_1_0, };EXPORT_SYMBOL_NS (mtl_chip_info,SND_SOC_SOF_INTEL_HDA_COMMON ); + +const struct sof_intel_dsp_desc arl_s_chip_info = { + .cores_num =2 , + .init_core_mask =BIT (0 ), + .host_managed_cores_mask =BIT (0 ), + .ipc_req =MTL_DSP_REG_HFIPCXIDR , + .ipc_req_mask =MTL_DSP_REG_HFIPCXIDR_BUSY , + .ipc_ack =MTL_DSP_REG_HFIPCXIDA , + .ipc_ack_mask =MTL_DSP_REG_HFIPCXIDA_DONE , + .ipc_ctl =MTL_DSP_REG_HFIPCXCTL , + .rom_status_reg =MTL_DSP_ROM_STS , + .rom_init_timeout =300 , + .ssp_count =MTL_SSP_COUNT , + .ssp_base_offset =CNL_SSP_BASE_OFFSET , + .sdw_shim_base =SDW_SHIM_BASE_ACE , + .sdw_alh_base =SDW_ALH_BASE_ACE , + .d0i3_offset =MTL_HDA_VS_D0I3C , + .read_sdw_lcount = hda_sdw_check_lcount_common, + .enable_sdw_irq = mtl_enable_sdw_irq, + .check_sdw_irq = mtl_dsp_check_sdw_irq, + .check_sdw_wakeen_irq = hda_sdw_check_wakeen_irq_common, + .check_ipc_irq = mtl_dsp_check_ipc_irq, + .cl_init = mtl_dsp_cl_init, + .power_down_dsp = mtl_power_down_dsp, + .disable_interrupts = mtl_dsp_disable_interrupts, + .hw_ip_version =SOF_INTEL_ACE_1_0 , +}; +EXPORT_SYMBOL_NS (arl_s_chip_info,SND_SOC_SOF_INTEL_HDA_COMMON );
sound/soc/sof/intel/pci-mtl.c +6 -6
@@ -50,7 +50,7 @@ static const struct sof_dev_desc mtl_desc = { .ops_free = hda_ops_free, }; -static const struct sof_dev_desc arl_desc = { +static const struct sof_dev_desc arl_s_desc = { .use_acpi_target_states = true, .machines = snd_soc_acpi_intel_arl_machines, .alt_machines = snd_soc_acpi_intel_arl_sdw_machines,
@@ -58,21 +58,21 @@ static const struct sof_dev_desc arl_desc = { .resindex_pcicfg_base = -1, .resindex_imr_base = -1, .irqindex_host_ipc = -1, - .chip_info = &mtl_chip_info, + .chip_info = &arl_s_chip_info, .ipc_supported_mask = BIT(SOF_IPC_TYPE_4), .ipc_default = SOF_IPC_TYPE_4, .dspless_mode_supported = true, /* Only supported for HDaudio */ .default_fw_path = { - [SOF_IPC_TYPE_4] = "intel/sof-ipc4/arl", + [SOF_IPC_TYPE_4] = "intel/sof-ipc4/arl-s", }, .default_lib_path = { - [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/arl", + [SOF_IPC_TYPE_4] = "intel/sof-ipc4-lib/arl-s", }, .default_tplg_path = { [SOF_IPC_TYPE_4] = "intel/sof-ace-tplg", }, .default_fw_filename = { - [SOF_IPC_TYPE_4] = "sof-arl.ri", + [SOF_IPC_TYPE_4] = "sof-arl-s.ri", }, .nocodec_tplg_filename = "sof-arl-nocodec.tplg", .ops = &sof_mtl_ops,
@@ -83,7 +83,7 @@ static const struct sof_dev_desc arl_desc = {/* PCI IDs */ static const struct pci_device_id sof_pci_ids[] = { {PCI_DEVICE_DATA (INTEL ,HDA_MTL , &mtl_desc) }, - {PCI_DEVICE_DATA (INTEL ,HDA_ARL_S , &arl_desc) }, + {PCI_DEVICE_DATA (INTEL ,HDA_ARL_S , &arl_s_desc) }, {0 , } };MODULE_DEVICE_TABLE (pci, sof_pci_ids);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 293/744 ASoC: SOF: Intel: mtl: Correct rom_status_reg
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
[ Upstream commit 1f1b820dc3c65b6883da3130ba3b8624dcbf87db ]
ACE1 architecture changed the place where the ROM updates the status code from the shared SRAM window to HFFLGP1QW0 register for the status and HFFLGP1QW0 + 4 for the error code.
The rom_status_reg is not used on MTL because it was wrongly assigned based on older platform convention (SRAM window) and it was giving inconsistent readings.
--- sound/soc/sof/intel/mtl.c | 4 ++-- sound/soc/sof/intel/mtl.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
sound/soc/sof/intel/mtl.c +2 -2
@@ -725,7 +725,7 @@ const struct sof_intel_dsp_desc mtl_chip_info = { .ipc_ack = MTL_DSP_REG_HFIPCXIDA, .ipc_ack_mask = MTL_DSP_REG_HFIPCXIDA_DONE, .ipc_ctl = MTL_DSP_REG_HFIPCXCTL, - .rom_status_reg = MTL_DSP_ROM_STS, + .rom_status_reg = MTL_DSP_REG_HFFLGPXQWY, .rom_init_timeout = 300, .ssp_count = MTL_SSP_COUNT, .ssp_base_offset = CNL_SSP_BASE_OFFSET,
@@ -753,7 +753,7 @@ const struct sof_intel_dsp_desc arl_s_chip_info = { .ipc_ack = MTL_DSP_REG_HFIPCXIDA, .ipc_ack_mask = MTL_DSP_REG_HFIPCXIDA_DONE, .ipc_ctl = MTL_DSP_REG_HFIPCXCTL, - .rom_status_reg = MTL_DSP_ROM_STS, + .rom_status_reg = MTL_DSP_REG_HFFLGPXQWY, .rom_init_timeout = 300, .ssp_count = MTL_SSP_COUNT, .ssp_base_offset = CNL_SSP_BASE_OFFSET,
sound/soc/sof/intel/mtl.h +2 -2
@@ -76,8 +76,8 @@#define MTL_DSP_ROM_STS MTL_SRAM_WINDOW_OFFSET(0)/* ROM status */ #define MTL_DSP_ROM_ERROR (MTL_SRAM_WINDOW_OFFSET(0) + 0x4)/* ROM error code */ -#define MTL_DSP_REG_HFFLGPXQWY 0x163200/* ROM debug status */ -#define MTL_DSP_REG_HFFLGPXQWY_ERROR 0x163204/* ROM debug error code */ +#define MTL_DSP_REG_HFFLGPXQWY 0x163200/* DSP core0 status */ +#define MTL_DSP_REG_HFFLGPXQWY_ERROR 0x163204/* DSP core0 error */ #define MTL_DSP_REG_HfIMRIS1 0x162088#define MTL_DSP_REG_HfIMRIS1_IU_MASK BIT(0)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 294/744 ASoC: SOF: Intel: lnl: Correct rom_status_reg
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
[ Upstream commit b852574c671a9983dd51c81582c8c5085f3dc382 ]
ACE2 architecture changed the place where the ROM updates the status code from the shared SRAM window (and HFFLGP1QW0 in ACE1) to HFDSC register for the status and HFDEC (HFDSC + 4) for the error code.
The rom_status_reg is not used on LNL because it was wrongly assigned based on older platform convention (SRAM window) and it was giving inconsistent readings.
Add new header file for lnl specific register definitions.
--- sound/soc/sof/intel/lnl.c | 3 ++- sound/soc/sof/intel/lnl.h | 15 +++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 sound/soc/sof/intel/lnl.h
sound/soc/sof/intel/lnl.c +2 -1
@@ -16,6 +16,7 @@#include "hda-ipc.h" #include "../sof-audio.h" #include "mtl.h" +#include "lnl.h" #include <sound/hda-mlink.h> /* LunarLake ops */
@@ -172,7 +173,7 @@ const struct sof_intel_dsp_desc lnl_chip_info = { .ipc_ack = MTL_DSP_REG_HFIPCXIDA, .ipc_ack_mask = MTL_DSP_REG_HFIPCXIDA_DONE, .ipc_ctl = MTL_DSP_REG_HFIPCXCTL, - .rom_status_reg = MTL_DSP_ROM_STS, + .rom_status_reg = LNL_DSP_REG_HFDSC, .rom_init_timeout = 300, .ssp_count = MTL_SSP_COUNT, .d0i3_offset = MTL_HDA_VS_D0I3C,
sound/soc/sof/intel/lnl.h new file +15 -0
@@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-3-Clause) */ +/* +* This file is provided under a dual BSD/GPLv2 license. When using or +* redistributing this file, you may do so under either license. +* +* Copyright(c) 2024 Intel Corporation. All rights reserved. +*/ + +#ifndef __SOF_INTEL_LNL_H +#define __SOF_INTEL_LNL_H + +#define LNL_DSP_REG_HFDSC 0x160200/* DSP core0 status */ +#define LNL_DSP_REG_HFDEC 0x160204/* DSP core0 error */ + +#endif /* __SOF_INTEL_LNL_H */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 295/744 ASoC: SOF: Intel: mtl: call dsp dump when boot retry fails
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yong Zhi <[email protected]>
[ Upstream commit d5070d0c10326e09276c34568b9a19fb9a727b6e ]
Call snd_sof_dsp_dbg_dump() with the same flags/dump_msg as used in function hda_loader.c/cl_dsp_init().
Stable-dep-of: 26187f44aabd ("ASoC: SOF: Intel: mtl: Disable interrupts when firmware boot failed")
--- sound/soc/sof/intel/mtl.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-)
sound/soc/sof/intel/mtl.c +13 -2
@@ -437,7 +437,8 @@ int mtl_dsp_cl_init(struct snd_sof_dev *sdev, int stream_tag, bool imr_boot)struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;const struct sof_intel_dsp_desc *chip = hda->desc;unsigned int status; -u32 ipc_hdr; +u32 ipc_hdr, flags; +char *dump_msg;int ret;/* step 1: purge FW request */
@@ -490,8 +491,18 @@ int mtl_dsp_cl_init(struct snd_sof_dev *sdev, int stream_tag, bool imr_boot)return 0 ; err: -snd_sof_dsp_dbg_dump (sdev,"MTL DSP init fail" ,0 ); + flags =SOF_DBG_DUMP_PCI |SOF_DBG_DUMP_MBOX |SOF_DBG_DUMP_OPTIONAL ; + +/* after max boot attempts make sure that the dump is printed */ +if (hda->boot_iteration ==HDA_FW_BOOT_ATTEMPTS ) + flags &= ~SOF_DBG_DUMP_OPTIONAL ; + + dump_msg =kasprintf (GFP_KERNEL ,"Boot iteration failed: %d/%d" , + hda->boot_iteration,HDA_FW_BOOT_ATTEMPTS ); +snd_sof_dsp_dbg_dump (sdev, dump_msg, flags);mtl_dsp_core_power_down (sdev,SOF_DSP_PRIMARY_CORE ); + +kfree (dump_msg);return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 296/744 ASoC: SOF: Intel: mtl: Disable interrupts when firmware boot failed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
[ Upstream commit 26187f44aabdf3df7609b7c78724a059c230a2ad ]
In case of error during the firmware boot we need to disable the interrupts which were enabled as part of the boot sequence.
--- sound/soc/sof/intel/mtl.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/sof/intel/mtl.c +1 -0
@@ -500,6 +500,7 @@ int mtl_dsp_cl_init(struct snd_sof_dev *sdev, int stream_tag, bool imr_boot) dump_msg =kasprintf (GFP_KERNEL ,"Boot iteration failed: %d/%d" , hda->boot_iteration,HDA_FW_BOOT_ATTEMPTS );snd_sof_dsp_dbg_dump (sdev, dump_msg, flags); +mtl_enable_interrupts (sdev, false);mtl_dsp_core_power_down (sdev,SOF_DSP_PRIMARY_CORE );kfree (dump_msg);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 297/744 ASoC: SOF: Intel: mtl: Implement firmware boot state check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Ujfalusi <[email protected]>
[ Upstream commit 6b1c1c47e76f0161bda2b1ac2e86a219fe70244f ]
With the corrected rom_status_reg values we can now add a check for target boot status for firmware booting.
With the check now we can identify failed firmware boots (IMR boots) and we can use the fallback to purge boot the DSP.
--- sound/soc/sof/intel/mtl.c | 37 ++++++++++++++++++++++++++++++++----- 1 file changed, 32 insertions(+), 5 deletions(-)
sound/soc/sof/intel/mtl.c +32 -5
@@ -436,7 +436,7 @@ int mtl_dsp_cl_init(struct snd_sof_dev *sdev, int stream_tag, bool imr_boot) {struct sof_intel_hda_dev *hda = sdev->pdata->hw_pdata;const struct sof_intel_dsp_desc *chip = hda->desc; -unsigned int status; +unsigned int status, target_status;u32 ipc_hdr, flags;char *dump_msg;int ret;
@@ -482,13 +482,40 @@ int mtl_dsp_cl_init(struct snd_sof_dev *sdev, int stream_tag, bool imr_boot)mtl_enable_ipc_interrupts (sdev); +if (chip->rom_status_reg ==MTL_DSP_ROM_STS ) { +/* +* Workaround: when the ROM status register is pointing to +* the SRAM window (MTL_DSP_ROM_STS) the platform cannot catch +* ROM_INIT_DONE because of a very short timing window. +* Follow the recommendations and skip target state waiting. +*/ +return 0 ; + } +/* -* ACE workaround: don't wait for ROM INIT. -* The platform cannot catch ROM_INIT_DONE because of a very short -* timing window. Follow the recommendations and skip this part. +* step 7: +* - Cold/Full boot: wait for ROM init to proceed to download the firmware +* - IMR boot: wait for ROM firmware entered (firmware booted up from IMR) */ +if (imr_boot) + target_status =FSR_STATE_FW_ENTERED ; +else + target_status =FSR_STATE_INIT_DONE ; -return 0 ; + ret =snd_sof_dsp_read_poll_timeout (sdev,HDA_DSP_BAR , + chip->rom_status_reg, status, + (FSR_TO_STATE_CODE (status) == target_status), +HDA_DSP_REG_POLL_INTERVAL_US , + chip->rom_init_timeout * +USEC_PER_MSEC ); + +if (!ret) +return 0 ; + +if (hda->boot_iteration ==HDA_FW_BOOT_ATTEMPTS ) +dev_err (sdev->dev, +"%s: timeout with rom_status_reg (%#x) read\n" , + __func__, chip->rom_status_reg); err: flags =SOF_DBG_DUMP_PCI |SOF_DBG_DUMP_MBOX |SOF_DBG_DUMP_OPTIONAL ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 298/744 fbdev: sisfb: hide unused variables
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 688cf598665851b9e8cb5083ff1d208ce43d10ff ]
Building with W=1 shows that a couple of variables in this driver are only used in certain configurations:
drivers/video/fbdev/sis/init301.c:239:28: error: 'SiS_Part2CLVX_6' defined but not used [-Werror=unused-const-variable=]
239 | static const unsigned char SiS_Part2CLVX_6[] = { /* 1080i */
| ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:230:28: error: 'SiS_Part2CLVX_5' defined but not used [-Werror=unused-const-variable=]
230 | static const unsigned char SiS_Part2CLVX_5[] = { /* 750p */
| ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:211:28: error: 'SiS_Part2CLVX_4' defined but not used [-Werror=unused-const-variable=]
211 | static const unsigned char SiS_Part2CLVX_4[] = { /* PAL */
| ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:192:28: error: 'SiS_Part2CLVX_3' defined but not used [-Werror=unused-const-variable=]
192 | static const unsigned char SiS_Part2CLVX_3[] = { /* NTSC, 525i, 525p */
| ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:184:28: error: 'SiS_Part2CLVX_2' defined but not used [-Werror=unused-const-variable=]
184 | static const unsigned char SiS_Part2CLVX_2[] = {
| ^~~~~~~~~~~~~~~
drivers/video/fbdev/sis/init301.c:176:28: error: 'SiS_Part2CLVX_1' defined but not used [-Werror=unused-const-variable=]
176 | static const unsigned char SiS_Part2CLVX_1[] = {
| ^~~~~~~~~~~~~~~This started showing up after the definitions were moved into the source file from the header, which was not flagged by the compiler. Move the definition into the appropriate #ifdef block that already exists next to them.
--- drivers/video/fbdev/sis/init301.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/video/fbdev/sis/init301.c +1 -2
@@ -172,7 +172,7 @@ static const unsigned char SiS_HiTVGroup3_2[] = { };/* 301C / 302ELV extended Part2 TV registers (4 tap scaler) */ - +#ifdef CONFIG_FB_SIS_315 static const unsigned char SiS_Part2CLVX_1[] = {0x00 ,0x00 , 0x00,0x20,0x00,0x00,0x7F,0x20,0x02,0x7F,0x7D,0x20,0x04,0x7F,0x7D,0x1F,0x06,0x7E,
@@ -245,7 +245,6 @@ static const unsigned char SiS_Part2CLVX_6[] = { /* 1080i */ 0xFF,0xFF, }; -#ifdef CONFIG_FB_SIS_315 /* 661 et al LCD data structure (2.03.00) */ static const unsigned char SiS_LCDStruct661[] = {/* 1024x768 */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 299/744 selftests: cgroup: skip test_cgcore_lesser_ns_open when cgroup2 mounted without nsdelegate
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tianchen Ding <[email protected]>
[ Upstream commit 4793cb599b1bdc3d356f0374c2c99ffe890ae876 ]
The test case test_cgcore_lesser_ns_open only tasks effect when cgroup2 is mounted with "nsdelegate" mount option. If it misses this option, or is remounted without "nsdelegate", the test case will fail. For example, running bpf/test_cgroup_storage first, and then run cgroup/test_core will fail on test_cgcore_lesser_ns_open. Skip it if "nsdelegate" is not detected in cgroup2 mount options.
--- tools/testing/selftests/cgroup/cgroup_util.c | 8 +++++--- tools/testing/selftests/cgroup/cgroup_util.h | 2 +- tools/testing/selftests/cgroup/test_core.c | 7 ++++++- tools/testing/selftests/cgroup/test_cpu.c | 2 +- tools/testing/selftests/cgroup/test_cpuset.c | 2 +- tools/testing/selftests/cgroup/test_freezer.c | 2 +- tools/testing/selftests/cgroup/test_kill.c | 2 +- tools/testing/selftests/cgroup/test_kmem.c | 2 +- tools/testing/selftests/cgroup/test_memcontrol.c | 2 +- tools/testing/selftests/cgroup/test_zswap.c | 2 +- 10 files changed, 19 insertions(+), 12 deletions(-)
tools/testing/selftests/cgroup/cgroup_util.c +5 -3
@@ -195,10 +195,10 @@ int cg_write_numeric(const char *cgroup, const char *control, long value)return cg_write (cgroup, control, buf); } -int cg_find_unified_root (char *root,size_t len) +int cg_find_unified_root (char *root,size_t len,bool *nsdelegate) {char buf[10 *PAGE_SIZE ]; -char *fs, *mount, *type; +char *fs, *mount, *type, *options;const char delim[] ="\n\t " ;if (read_text ("/proc/self/mounts" , buf,sizeof (buf)) <=0 )
@@ -211,12 +211,14 @@ int cg_find_unified_root(char *root, size_t len)for (fs =strtok (buf, delim); fs; fs =strtok (NULL , delim)) { mount =strtok (NULL , delim); type =strtok (NULL , delim); -strtok (NULL , delim); + options =strtok (NULL , delim);strtok (NULL , delim);strtok (NULL , delim);if (strcmp (type,"cgroup2" ) ==0 ) {strncpy (root, mount, len); +if (nsdelegate) + *nsdelegate = !!strstr (options,"nsdelegate" );return 0 ; } }
tools/testing/selftests/cgroup/cgroup_util.h +1 -1
@@ -21,7 +21,7 @@ static inline int values_close(long a, long b, int err)return abs (a - b) <= (a + b) /100 * err; } -extern int cg_find_unified_root (char *root,size_t len); +extern int cg_find_unified_root (char *root,size_t len,bool *nsdelegate);extern char *cg_name (const char *root,const char *name);extern char *cg_name_indexed (const char *root,const char *name,int index);extern char *cg_control (const char *cgroup,const char *control);
tools/testing/selftests/cgroup/test_core.c +6 -1
@@ -18,6 +18,8 @@#include "../kselftest.h" #include "cgroup_util.h" +static bool nsdelegate; +static int touch_anon (char *buf,size_t size) {int fd;
@@ -775,6 +777,9 @@ static int test_cgcore_lesser_ns_open(const char *root)pid_t pid;int status; +if (!nsdelegate) +return KSFT_SKIP ; + cg_test_a =cg_name (root,"cg_test_a" ); cg_test_b =cg_name (root,"cg_test_b" );
@@ -862,7 +867,7 @@ int main(int argc, char *argv[])char root[PATH_MAX ];int i, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root), &nsdelegate))ksft_exit_skip ("cgroup v2 isn't mounted\n" );if (cg_read_strstr (root,"cgroup.subtree_control" ,"memory" ))
tools/testing/selftests/cgroup/test_cpu.c +1 -1
@@ -700,7 +700,7 @@ int main(int argc, char *argv[])char root[PATH_MAX ];int i, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root),NULL ))ksft_exit_skip ("cgroup v2 isn't mounted\n" );if (cg_read_strstr (root,"cgroup.subtree_control" ,"cpu" ))
tools/testing/selftests/cgroup/test_cpuset.c +1 -1
@@ -249,7 +249,7 @@ int main(int argc, char *argv[])char root[PATH_MAX ];int i, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root),NULL ))ksft_exit_skip ("cgroup v2 isn't mounted\n" );if (cg_read_strstr (root,"cgroup.subtree_control" ,"cpuset" ))
tools/testing/selftests/cgroup/test_freezer.c +1 -1
@@ -827,7 +827,7 @@ int main(int argc, char *argv[])char root[PATH_MAX ];int i, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root),NULL ))ksft_exit_skip ("cgroup v2 isn't mounted\n" );for (i =0 ; i <ARRAY_SIZE (tests); i++) {switch (tests[i].fn (root)) {
tools/testing/selftests/cgroup/test_kill.c +1 -1
@@ -276,7 +276,7 @@ int main(int argc, char *argv[])char root[PATH_MAX ];int i, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root),NULL ))ksft_exit_skip ("cgroup v2 isn't mounted\n" );for (i =0 ; i <ARRAY_SIZE (tests); i++) {switch (tests[i].fn (root)) {
tools/testing/selftests/cgroup/test_kmem.c +1 -1
@@ -420,7 +420,7 @@ int main(int argc, char **argv)char root[PATH_MAX ];int i, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root),NULL ))ksft_exit_skip ("cgroup v2 isn't mounted\n" );/*
tools/testing/selftests/cgroup/test_memcontrol.c +1 -1
@@ -1314,7 +1314,7 @@ int main(int argc, char **argv)char root[PATH_MAX ];int i, proc_status, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root),NULL ))ksft_exit_skip ("cgroup v2 isn't mounted\n" );/*
tools/testing/selftests/cgroup/test_zswap.c +1 -1
@@ -250,7 +250,7 @@ int main(int argc, char **argv)char root[PATH_MAX ];int i, ret =EXIT_SUCCESS ; -if (cg_find_unified_root (root,sizeof (root))) +if (cg_find_unified_root (root,sizeof (root),NULL ))ksft_exit_skip ("cgroup v2 isn't mounted\n" );if (!zswap_configured ())
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 300/744 ASoC: Intel: avs: Fix ASRC module initialization
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cezary Rojewski <[email protected]>
[ Upstream commit 9d2e26f31c7cc3fa495c423af9b4902ec0dc7be3 ]
The ASRC module configuration consists of several reserved fields. Zero them out when initializing the module to avoid sending invalid data.
--- sound/soc/intel/avs/path.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/intel/avs/path.c +1 -0
@@ -368,6 +368,7 @@ static int avs_asrc_create(struct avs_dev *adev, struct avs_path_module *mod)struct avs_tplg_module *t = mod->template;struct avs_asrc_cfg cfg; +memset (&cfg,0 ,sizeof (cfg)); cfg.base.cpc = t->cfg_base->cpc; cfg.base.ibs = t->cfg_base->ibs; cfg.base.obs = t->cfg_base->obs;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 301/744 ASoC: Intel: avs: Fix potential integer overflow
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cezary Rojewski <[email protected]>
[ Upstream commit c7e832cabe635df47c2bf6df7801e97bf3045b1e ]
While stream_tag for CLDMA on SKL-based platforms is always 1, function hda_cldma_setup() uses AZX_SD_CTL_STRM() macro which does:
stream_tag << 20
what combined with stream_tag type of 'unsigned int' generates a potential overflow issue. Update the field type to fix that.
--- sound/soc/intel/avs/cldma.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/avs/cldma.c +1 -1
@@ -35,7 +35,7 @@ struct hda_cldma {unsigned int buffer_size;unsigned int num_periods; -unsigned int stream_tag; +unsigned char stream_tag;void __iomem *sd_addr;struct snd_dma_buffer dmab_data;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 302/744 ASoC: Intel: avs: Test result of avs_get_module_entry()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cezary Rojewski <[email protected]>
[ Upstream commit 41bf4525fadb3d8df3860420d6ac9025c51a3bac ]
While PROBE_MOD_UUID is always part of the base AudioDSP firmware manifest, from maintenance point of view it is better to check the result.
--- sound/soc/intel/avs/probes.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
sound/soc/intel/avs/probes.c +9 -5
@@ -19,8 +19,11 @@ static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_idstruct avs_probe_cfg cfg = {{0 }};struct avs_module_entry mentry;u8 dummy; +int ret; -avs_get_module_entry (adev, &AVS_PROBE_MOD_UUID , &mentry); + ret =avs_get_module_entry (adev, &AVS_PROBE_MOD_UUID , &mentry); +if (ret) +return ret;/* * Probe module uses no cycles, audio data format and input and output
@@ -39,11 +42,12 @@ static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_idstatic void avs_dsp_delete_probe (struct avs_dev *adev) {struct avs_module_entry mentry; +int ret; -avs_get_module_entry (adev, &AVS_PROBE_MOD_UUID , &mentry); - -/* There is only ever one probe module instance. */ -avs_dsp_delete_module (adev, mentry.module_id,0 ,INVALID_PIPELINE_ID ,0 ); + ret =avs_get_module_entry (adev, &AVS_PROBE_MOD_UUID , &mentry); +if (!ret) +/* There is only ever one probe module instance. */ +avs_dsp_delete_module (adev, mentry.module_id,0 ,INVALID_PIPELINE_ID ,0 ); }static inline struct hdac_ext_stream *avs_compr_get_host_stream (struct snd_compr_stream *cstream)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 303/744 media: ngene: Add dvb_ca_en50221_init return value check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Burakov <[email protected]>
[ Upstream commit 9bb1fd7eddcab2d28cfc11eb20f1029154dac718 ]
The return value of dvb_ca_en50221_init() is not checked here that may cause undefined behavior in case of nonzero value return.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/media/pci/ngene/ngene-core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/pci/ngene/ngene-core.c +3 -1
@@ -1488,7 +1488,9 @@ static int init_channel(struct ngene_channel *chan) }if (dev->ci.en && (io &NGENE_IO_TSOUT )) { -dvb_ca_en50221_init (adapter, dev->ci.en,0 ,1 ); + ret =dvb_ca_en50221_init (adapter, dev->ci.en,0 ,1 ); +if (ret !=0 ) + goto err;set_transfer (chan,1 ); chan->dev->channel[2 ].DataFormatFlags =DF_SWAP32 ;set_transfer (&chan->dev->channel[2 ],1 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 304/744 media: rcar-vin: work around -Wenum-compare-conditional warning
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 1a742c6010d136cb6c441a0f1dd2bfbfae3c4df2 ]
clang-19 warns about mixing two enum types here:
drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional] drivers/media/platform/renesas/rcar-vin/rcar-core.c:216:18: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional] drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional] drivers/media/platform/renesas/rcar-vin/rcar-vin.h:296:12: error: conditional expression between different enumeration types ('enum rvin_csi_id' and 'enum rvin_isp_id') [-Werror,-Wenum-compare-conditional]
This one is intentional, and there is already a cast to work around another warning, so address this by adding another cast.
--- drivers/media/platform/renesas/rcar-vin/rcar-vin.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/renesas/rcar-vin/rcar-vin.h +1 -1
@@ -59,7 +59,7 @@ enum rvin_isp_id {#define RVIN_REMOTES_MAX \ (((unsigned int)RVIN_CSI_MAX) > ((unsigned int)RVIN_ISP_MAX) ? \ - RVIN_CSI_MAX : RVIN_ISP_MAX) + (unsigned int)RVIN_CSI_MAX : (unsigned int)RVIN_ISP_MAX)/** * enum rvin_dma_state - DMA states
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 305/744 media: radio-shark2: Avoid led_names truncations
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit 1820e16a3019b6258e6009d34432946a6ddd0a90 ]
Increase the size of led_names so it can fit any valid v4l2 device name.
Fixes:drivers/media/radio/radio-shark2.c:197:17: warning: ‘%s’ directive output may be truncated writing up to 35 bytes into a region of size 32 [-Wformat-truncation=]
--- drivers/media/radio/radio-shark2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/radio/radio-shark2.c +1 -1
@@ -62,7 +62,7 @@ struct shark_device {#ifdef SHARK_USE_LEDS struct work_struct led_work;struct led_classdev leds[NO_LEDS ]; -char led_names[NO_LEDS ][32 ]; +char led_names[NO_LEDS ][64 ];atomic_t brightness[NO_LEDS ];unsigned long brightness_new;#endif
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 306/744 drm: bridge: cdns-mhdp8546: Fix possible null pointer dereference
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Mishin <[email protected]>
[ Upstream commit 935a92a1c400285545198ca2800a4c6c519c650a ]
In cdns_mhdp_atomic_enable(), the return value of drm_mode_duplicate() is assigned to mhdp_state->current_mode, and there is a dereference of it in drm_mode_set_name(), which will lead to a NULL pointer dereference on failure of drm_mode_duplicate().
Fix this bug add a check of mhdp_state->current_mode.
--- drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/bridge/cadence/cdns-mhdp8546-core.c +3 -0
@@ -2057,6 +2057,9 @@ static void cdns_mhdp_atomic_enable(struct drm_bridge *bridge, mhdp_state =to_cdns_mhdp_bridge_state (new_state); mhdp_state->current_mode =drm_mode_duplicate (bridge->dev, mode); +if (!mhdp_state->current_mode) +return ; +drm_mode_set_name (mhdp_state->current_mode);dev_dbg (mhdp->dev,"%s: Enabling mode %s\n" , __func__, mode->name);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 307/744 platform/x86: xiaomi-wmi: Fix race condition when reporting key events
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Armin Wolf <[email protected]>
[ Upstream commit 290680c2da8061e410bcaec4b21584ed951479af ]
Multiple WMI events can be received concurrently, so multiple instances of xiaomi_wmi_notify() can be active at the same time. Since the input device is shared between those handlers, the key input sequence can be disturbed.
Fix this by protecting the key input sequence with a mutex.
Compile-tested only.
--- drivers/platform/x86/xiaomi-wmi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/platform/x86/xiaomi-wmi.c +18 -0
@@ -2,8 +2,10 @@/* WMI driver for Xiaomi Laptops */ #include <linux/acpi.h> +#include <linux/device.h> #include <linux/input.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/wmi.h> #include <uapi/linux/input-event-codes.h>
@@ -20,12 +22,21 @@struct xiaomi_wmi {struct input_dev *input_dev; +struct mutex key_lock;/* Protects the key event sequence */ unsigned int key_code; }; +static void xiaomi_mutex_destroy (void *data) +{ +struct mutex *lock = data; + +mutex_destroy (lock); +} +static int xiaomi_wmi_probe (struct wmi_device *wdev,const void *context) {struct xiaomi_wmi *data; +int ret;if (wdev ==NULL || context ==NULL )return -EINVAL ;
@@ -35,6 +46,11 @@ static int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)return -ENOMEM ;dev_set_drvdata (&wdev->dev, data); +mutex_init (&data->key_lock); + ret =devm_add_action_or_reset (&wdev->dev, xiaomi_mutex_destroy, &data->key_lock); +if (ret <0 ) +return ret; + data->input_dev =devm_input_allocate_device (&wdev->dev);if (data->input_dev ==NULL )return -ENOMEM ;
@@ -59,10 +75,12 @@ static void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)if (data ==NULL )return ; +mutex_lock (&data->key_lock);input_report_key (data->input_dev, data->key_code,1 );input_sync (data->input_dev);input_report_key (data->input_dev, data->key_code,0 );input_sync (data->input_dev); +mutex_unlock (&data->key_lock); }static const struct wmi_device_id xiaomi_wmi_id_table[] = {
Signature · 1 line
2.43.0
Re: [PATCH 6.6 307/744] platform/x86: xiaomi-wmi: Fix race condition when reporting key events
Am 06.06.24 um 15:59 schrieb Greg Kroah-Hartman:
Quoted 1 line
6.6-stable review patch. If anyone has any objections, please let me know.
Hi,
i already said that the underlying race condition can only be triggered since commit e2ffcda16290 ("ACPI: OSL: Allow Notify () handlers to run on all CPUs"), which afaik was introduced with kernel 6.8.
Because of this, i do not think that we have to backport this commit to kernels before 6.8.
Quoted 89 lines
------------------
From: Armin Wolf <[email protected]>
[ Upstream commit
290680c2da8061e410bcaec4b21584ed951479af]Multiple WMI events can be received concurrently, so multiple instances of
xiaomi_wmi_notify()can be active at the same time. Since the input device is shared between those handlers, the key input sequence can be disturbed.Fix this by protecting the key input sequence with a mutex.
Compile-tested only.
Fixes edb73f4f0247 ("platform/x86: wmi: add Xiaomi WMI key driver")Signed-off-by Armin Wolf <[email protected]>Reviewed-by Kuppuswamy Sathyanarayanan <[email protected]>Reviewed-by Hans de Goede <[email protected]>Signed-off-by Hans de Goede <[email protected]>Signed-off-by Sasha Levin <[email protected]>--- drivers/platform/x86/xiaomi-wmi.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)drivers/platform/x86/xiaomi-wmi.c +18
-0@@ -2,8 +2,10 @@/* WMI driver for Xiaomi Laptops */ #include <linux/acpi.h> +#include <linux/device.h> #include <linux/input.h> #include <linux/module.h> +#include <linux/mutex.h> #include <linux/wmi.h> #include <uapi/linux/input-event-codes.h> @@ -20,12 +22,21 @@struct xiaomi_wmi {struct input_dev *input_dev; +struct mutex key_lock;/* Protects the key event sequence */ unsigned int key_code; }; +static void xiaomi_mutex_destroy (void *data) +{ +struct mutex *lock = data; + +mutex_destroy (lock); +} +static int xiaomi_wmi_probe (struct wmi_device *wdev,const void *context) {struct xiaomi_wmi *data; +int ret;if (wdev ==NULL || context ==NULL )return -EINVAL ;@@ -35,6 +46,11 @@ static int xiaomi_wmi_probe(struct wmi_device *wdev, const void *context)return -ENOMEM ;dev_set_drvdata (&wdev->dev, data); +mutex_init (&data->key_lock); + ret =devm_add_action_or_reset (&wdev->dev, xiaomi_mutex_destroy, &data->key_lock); +if (ret <0 ) +return ret; + data->input_dev =devm_input_allocate_device (&wdev->dev);if (data->input_dev ==NULL )return -ENOMEM ;@@ -59,10 +75,12 @@ static void xiaomi_wmi_notify(struct wmi_device *wdev, union acpi_object *dummy)if (data ==NULL )return ; +mutex_lock (&data->key_lock);input_report_key (data->input_dev, data->key_code,1 );input_sync (data->input_dev);input_report_key (data->input_dev, data->key_code,0 );input_sync (data->input_dev); +mutex_unlock (&data->key_lock); }static const struct wmi_device_id xiaomi_wmi_id_table[] = {
Greg Kroah-Hartman
maintainerRe: [PATCH 6.6 307/744] platform/x86: xiaomi-wmi: Fix race condition when reporting key events
Quoted 4 lines · Armin Wolf
Am 06.06.24 um 15:59 schrieb Greg Kroah-Hartman:
Quoted 1 line
6.6-stable review patch. If anyone has any objections, please let me know.
Quoted 8 lines
Hi,
i already said that the underlying race condition can only be triggered since commit
e2ffcda16290("ACPI: OSL: Allow Notify () handlers to run on all CPUs"), which afaik was introduced with kernel 6.8.Because of this, i do not think that we have to backport this commit to kernels before 6.8.
Now dropped from all queues, thanks.
greg k-h
Greg Kroah-Hartman
maintainerPATCH 308/744 drm/msm/dp: allow voltage swing / pre emphasis of 3
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 22578178e5dd6d3aa4490879df8b6c2977d980be ]
Both dp_link_adjust_levels() and dp_ctrl_update_vx_px() limit swing and pre-emphasis to 2, while the real maximum value for the sum of the voltage swing and pre-emphasis is 3. Fix the DP code to remove this limitation.
Patchwork: https://patchwork.freedesktop.org/patch/577006/
--- drivers/gpu/drm/msm/dp/dp_ctrl.c | 6 +++--- drivers/gpu/drm/msm/dp/dp_link.c | 22 +++++++++++----------- drivers/gpu/drm/msm/dp/dp_link.h | 14 +------------- 3 files changed, 15 insertions(+), 27 deletions(-)
drivers/gpu/drm/msm/dp/dp_ctrl.c +3 -3
@@ -1019,14 +1019,14 @@ static int dp_ctrl_update_vx_px(struct dp_ctrl_private *ctrl)if (ret)return ret; -if (voltage_swing_level >=DP_TRAIN_VOLTAGE_SWING_MAX ) { +if (voltage_swing_level >=DP_TRAIN_LEVEL_MAX ) {drm_dbg_dp (ctrl->drm_dev,"max. voltage swing level reached %d\n" , voltage_swing_level); max_level_reached |=DP_TRAIN_MAX_SWING_REACHED ; } -if (pre_emphasis_level >=DP_TRAIN_PRE_EMPHASIS_MAX ) { +if (pre_emphasis_level >=DP_TRAIN_LEVEL_MAX ) {drm_dbg_dp (ctrl->drm_dev,"max. pre-emphasis level reached %d\n" , pre_emphasis_level);
@@ -1117,7 +1117,7 @@ static int dp_ctrl_link_train_1(struct dp_ctrl_private *ctrl, }if (ctrl->link->phy_params.v_level >= -DP_TRAIN_VOLTAGE_SWING_MAX ) { +DP_TRAIN_LEVEL_MAX ) {DRM_ERROR_RATELIMITED ("max v_level reached\n" );return -EAGAIN ; }
drivers/gpu/drm/msm/dp/dp_link.c +11 -11
@@ -1141,6 +1141,7 @@ int dp_link_get_colorimetry_config(struct dp_link *dp_link)int dp_link_adjust_levels (struct dp_link *dp_link,u8 *link_status) {int i; +u8 max_p_level;int v_max =0 , p_max =0 ;struct dp_link_private *link;
@@ -1172,30 +1173,29 @@ int dp_link_adjust_levels(struct dp_link *dp_link, u8 *link_status)* Adjust the voltage swing and pre-emphasis level combination to within * the allowable range. */ -if (dp_link->phy_params.v_level >DP_TRAIN_VOLTAGE_SWING_MAX ) { +if (dp_link->phy_params.v_level >DP_TRAIN_LEVEL_MAX ) {drm_dbg_dp (link->drm_dev,"Requested vSwingLevel=%d, change to %d\n" , dp_link->phy_params.v_level, -DP_TRAIN_VOLTAGE_SWING_MAX ); - dp_link->phy_params.v_level =DP_TRAIN_VOLTAGE_SWING_MAX ; +DP_TRAIN_LEVEL_MAX ); + dp_link->phy_params.v_level =DP_TRAIN_LEVEL_MAX ; } -if (dp_link->phy_params.p_level >DP_TRAIN_PRE_EMPHASIS_MAX ) { +if (dp_link->phy_params.p_level >DP_TRAIN_LEVEL_MAX ) {drm_dbg_dp (link->drm_dev,"Requested preEmphasisLevel=%d, change to %d\n" , dp_link->phy_params.p_level, -DP_TRAIN_PRE_EMPHASIS_MAX ); - dp_link->phy_params.p_level =DP_TRAIN_PRE_EMPHASIS_MAX ; +DP_TRAIN_LEVEL_MAX ); + dp_link->phy_params.p_level =DP_TRAIN_LEVEL_MAX ; } -if ((dp_link->phy_params.p_level >DP_TRAIN_PRE_EMPHASIS_LVL_1 ) - && (dp_link->phy_params.v_level == -DP_TRAIN_VOLTAGE_SWING_LVL_2 )) { + max_p_level =DP_TRAIN_LEVEL_MAX - dp_link->phy_params.v_level; +if (dp_link->phy_params.p_level > max_p_level) {drm_dbg_dp (link->drm_dev,"Requested preEmphasisLevel=%d, change to %d\n" , dp_link->phy_params.p_level, -DP_TRAIN_PRE_EMPHASIS_LVL_1 ); - dp_link->phy_params.p_level =DP_TRAIN_PRE_EMPHASIS_LVL_1 ; + max_p_level); + dp_link->phy_params.p_level = max_p_level; } drm_dbg_dp(link->drm_dev, "adjusted: v_level=%d, p_level=%d\n",
drivers/gpu/drm/msm/dp/dp_link.h +1 -13
@@ -19,19 +19,7 @@ struct dp_link_info {unsigned long capabilities; }; -enum dp_link_voltage_level { -DP_TRAIN_VOLTAGE_SWING_LVL_0 =0 , -DP_TRAIN_VOLTAGE_SWING_LVL_1 =1 , -DP_TRAIN_VOLTAGE_SWING_LVL_2 =2 , -DP_TRAIN_VOLTAGE_SWING_MAX =DP_TRAIN_VOLTAGE_SWING_LVL_2 , -}; - -enum dp_link_preemaphasis_level { -DP_TRAIN_PRE_EMPHASIS_LVL_0 =0 , -DP_TRAIN_PRE_EMPHASIS_LVL_1 =1 , -DP_TRAIN_PRE_EMPHASIS_LVL_2 =2 , -DP_TRAIN_PRE_EMPHASIS_MAX =DP_TRAIN_PRE_EMPHASIS_LVL_2 , -}; +#define DP_TRAIN_LEVEL_MAX 3struct dp_link_test_video {u32 test_video_pattern;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 309/744 drm/msm/dp: Avoid a long timeout for AUX transfer if nothing connected
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 5d1a7493343cc00d9019880b686e4e0a0f649531 ]
As documented in the description of the transfer() function of "struct drm_dp_aux", the transfer() function can be called at any time regardless of the state of the DP port. Specifically if the kernel has the DP AUX character device enabled and userspace accesses "/dev/drm_dp_auxN" directly then the AUX transfer function will be called regardless of whether a DP device is connected.
For eDP panels we have a special rule where we wait (with a 5 second timeout) for HPD to go high. This rule was important before all panels drivers were converted to call wait_hpd_asserted() and actually can be removed in a future commit.
For external DP devices we never checked for HPD. That means that trying to access the DP AUX character device (AKA hexdump -C /dev/drm_dp_auxN) would very, very slowly timeout. Specifically on my system:
$ time hexdump -C /dev/drm_dp_aux0 hexdump: /dev/drm_dp_aux0: Connection timed out real 0m8.200s We want access to the drm_dp_auxN character device to fail faster than 8 seconds when no DP cable is plugged in.
Let's add a test to make transfers fail right away if a device isn't plugged in. Rather than testing the HPD line directly, we have the dp_display module tell us when AUX transfers should be enabled so we can handle cases where HPD is signaled out of band like with Type C.
Patchwork: https://patchwork.freedesktop.org/patch/583127/
--- drivers/gpu/drm/msm/dp/dp_aux.c | 20 ++++++++++++++++++++ drivers/gpu/drm/msm/dp/dp_aux.h | 1 + drivers/gpu/drm/msm/dp/dp_display.c | 4 ++++ 3 files changed, 25 insertions(+)
drivers/gpu/drm/msm/dp/dp_aux.c +20 -0
@@ -35,6 +35,7 @@ struct dp_aux_private {bool no_send_stop;bool initted;bool is_edp; +bool enable_xfers;u32 offset;u32 segment;
@@ -297,6 +298,17 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, goto exit; } +/* +* If we're using DP and an external display isn't connected then the +* transfer won't succeed. Return right away. If we don't do this we +* can end up with long timeouts if someone tries to access the DP AUX +* character device when no DP device is connected. +*/ +if (!aux->is_edp && !aux->enable_xfers) { + ret = -ENXIO ; + goto exit; + } +/* * For eDP it's important to give a reasonably long wait here for HPD * to be asserted. This is because the panel driver may have _just_
@@ -428,6 +440,14 @@ irqreturn_t dp_aux_isr(struct drm_dp_aux *dp_aux)return IRQ_HANDLED ; } +void dp_aux_enable_xfers (struct drm_dp_aux *dp_aux,bool enabled) +{ +struct dp_aux_private *aux; + + aux = container_of(dp_aux, struct dp_aux_private, dp_aux); + aux->enable_xfers = enabled; +} +void dp_aux_reconfig (struct drm_dp_aux *dp_aux) {struct dp_aux_private *aux;
drivers/gpu/drm/msm/dp/dp_aux.h +1 -0
@@ -12,6 +12,7 @@int dp_aux_register (struct drm_dp_aux *dp_aux);void dp_aux_unregister (struct drm_dp_aux *dp_aux);irqreturn_t dp_aux_isr (struct drm_dp_aux *dp_aux); +void dp_aux_enable_xfers (struct drm_dp_aux *dp_aux,bool enabled);void dp_aux_init (struct drm_dp_aux *dp_aux);void dp_aux_deinit (struct drm_dp_aux *dp_aux);void dp_aux_reconfig (struct drm_dp_aux *dp_aux);
drivers/gpu/drm/msm/dp/dp_display.c +4 -0
@@ -586,6 +586,8 @@ static int dp_hpd_plug_handle(struct dp_display_private *dp, u32 data)u32 state;int ret; +dp_aux_enable_xfers (dp->aux, true); +mutex_lock (&dp->event_mutex); state = dp->hpd_state;
@@ -642,6 +644,8 @@ static int dp_hpd_unplug_handle(struct dp_display_private *dp, u32 data) {u32 state; +dp_aux_enable_xfers (dp->aux, false); +mutex_lock (&dp->event_mutex); state = dp->hpd_state;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 310/744 media: ipu3-cio2: Request IRQ earlier
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <[email protected]>
[ Upstream commit a069f79bfa6ec1ea0744981ea8425c8a25322579 ]
Call devm_request_irq() before registering the async notifier, as otherwise it would be possible to use the device before the interrupts could be delivered to the driver.
--- drivers/media/pci/intel/ipu3/ipu3-cio2.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/media/pci/intel/ipu3/ipu3-cio2.c +5 -5
@@ -1803,11 +1803,6 @@ static int cio2_pci_probe(struct pci_dev *pci_dev,v4l2_async_nf_init (&cio2->notifier, &cio2->v4l2_dev); -/* Register notifier for subdevices we care */ - r =cio2_parse_firmware (cio2); -if (r) - goto fail_clean_notifier; - r =devm_request_irq (dev, pci_dev->irq, cio2_irq,IRQF_SHARED ,CIO2_NAME , cio2);if (r) {
@@ -1815,6 +1810,11 @@ static int cio2_pci_probe(struct pci_dev *pci_dev, goto fail_clean_notifier; } +/* Register notifier for subdevices we care */ + r =cio2_parse_firmware (cio2); +if (r) + goto fail_clean_notifier; +pm_runtime_put_noidle (dev);pm_runtime_allow (dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 311/744 media: dt-bindings: ovti,ov2680: Fix the power supply names
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fabio Estevam <[email protected]>
[ Upstream commit e2f6ea61b6f3e4ebbb7dff857eea6220c18cd17b ]
The original .txt bindings had the OV2680 power supply names correct, but the transition from .txt to yaml spelled them incorrectly.
Fix the OV2680 power supply names as the original .txt bindings as these are the names used by the OV2680 driver and in devicetree.
--- .../bindings/media/i2c/ovti,ov2680.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
Documentation/devicetree/bindings/media/i2c/ovti,ov2680.yaml +9 -9
@@ -37,15 +37,15 @@ properties: active low. maxItems: 1 - dovdd-supply: + DOVDD-supply: description: Definition of the regulator used as interface power supply. - avdd-supply: + AVDD-supply: description: Definition of the regulator used as analog power supply. - dvdd-supply: + DVDD-supply: description: Definition of the regulator used as digital power supply.
@@ -59,9 +59,9 @@ required: - reg - clocks - clock-names - - dovdd-supply - - avdd-supply - - dvdd-supply + - DOVDD-supply + - AVDD-supply + - DVDD-supply - reset-gpios - port
@@ -82,9 +82,9 @@ examples: clock-names = "xvclk"; reset-gpios = <&gpio1 3 GPIO_ACTIVE_LOW>; - dovdd-supply = <&sw2_reg>; - dvdd-supply = <&sw2_reg>; - avdd-supply = <®_peri_3p15v>; + DOVDD-supply = <&sw2_reg>; + DVDD-supply = <&sw2_reg>; + AVDD-supply = <®_peri_3p15v>; port { ov2680_to_mipi: endpoint {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 312/744 media: i2c: et8ek8: Dont strip remove function when driver is builtin
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Uwe Kleine-König <[email protected]>
[ Upstream commit 545b215736c5c4b354e182d99c578a472ac9bfce ]
Using __exit for the remove function results in the remove callback being discarded with CONFIG_VIDEO_ET8EK8=y. When such a device gets unbound (e.g. using sysfs or hotplug), the driver is just removed without the cleanup being performed. This results in resource leaks. Fix it by compiling in the remove callback unconditionally.
This also fixes a W=1 modpost warning:
WARNING: modpost: drivers/media/i2c/et8ek8/et8ek8: section mismatch in reference: et8ek8_i2c_driver+0x10 (section: .data) -> et8ek8_remove (section: .exit.text)
--- drivers/media/i2c/et8ek8/et8ek8_driver.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/i2c/et8ek8/et8ek8_driver.c +2 -2
@@ -1460,7 +1460,7 @@ static int et8ek8_probe(struct i2c_client *client)return ret; } -static void __exit et8ek8_remove(struct i2c_client *client) +static void et8ek8_remove (struct i2c_client *client) {struct v4l2_subdev *subdev =i2c_get_clientdata (client);struct et8ek8_sensor *sensor =to_et8ek8_sensor (subdev);
@@ -1502,7 +1502,7 @@ static struct i2c_driver et8ek8_i2c_driver = { .of_match_table = et8ek8_of_table, }, .probe = et8ek8_probe, - .remove = __exit_p(et8ek8_remove), + .remove = et8ek8_remove, .id_table = et8ek8_id_table, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 313/744 media: v4l2-subdev: Fix stream handling for crop API
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Laurent Pinchart <[email protected]>
[ Upstream commit 34d7bf1c8e59f5fbf438ee32c96389ebe41ca2e8 ]
When support for streams was added to the V4L2 subdev API, the v4l2_subdev_crop structure was extended with a stream field, but the field was not handled in the core code that translates the VIDIOC_SUBDEV_[GS]_CROP ioctls to the selection API. Fix it.
--- drivers/media/v4l2-core/v4l2-subdev.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/v4l2-core/v4l2-subdev.c +2 -0
@@ -664,6 +664,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (&sel,0 ,sizeof (sel)); sel.which = crop->which; sel.pad = crop->pad; + sel.stream = crop->stream; sel.target =V4L2_SEL_TGT_CROP ; rval = v4l2_subdev_call(
@@ -688,6 +689,7 @@ static long subdev_do_ioctl(struct file *file, unsigned int cmd, void *arg,memset (&sel,0 ,sizeof (sel)); sel.which = crop->which; sel.pad = crop->pad; + sel.stream = crop->stream; sel.target =V4L2_SEL_TGT_CROP ; sel.r = crop->rect;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 314/744 fbdev: sh7760fb: allow modular build
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
[ Upstream commit 51084f89d687e14d96278241e5200cde4b0985c7 ]
There is no reason to prohibit sh7760fb from being built as a loadable module as suggested by Geert, so change the config symbol from bool to tristate to allow that and change the FB dependency as needed.
--- drivers/video/fbdev/Kconfig | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/video/fbdev/Kconfig +2 -2
@@ -1761,8 +1761,8 @@ config FB_COBALT depends on FB && MIPS_COBALT config FB_SH7760 - bool "SH7760/SH7763/SH7720/SH7721 LCDC support" - depends on FB=y && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \ + tristate "SH7760/SH7763/SH7720/SH7721 LCDC support" + depends on FB && (CPU_SUBTYPE_SH7760 || CPU_SUBTYPE_SH7763 \ || CPU_SUBTYPE_SH7720 || CPU_SUBTYPE_SH7721) select FB_IOMEM_HELPERS help
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 315/744 media: atomisp: ssh_css: Fix a null-pointer dereference in load_video_binaries
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhipeng Lu <[email protected]>
[ Upstream commit 3b621e9e9e148c0928ab109ac3d4b81487469acb ]
The allocation failure of mycs->yuv_scaler_binary in load_video_binaries() is followed with a dereference of mycs->yuv_scaler_binary after the following call chain:
sh_css_pipe_load_binaries()
|-> load_video_binaries(mycs->yuv_scaler_binary == NULL)
|
|-> sh_css_pipe_unload_binaries()
|-> unload_video_binaries()In unload_video_binaries(), it calls to ia_css_binary_unload with argument &pipe->pipe_settings.video.yuv_scaler_binary[i], which refers to the same memory slot as mycs->yuv_scaler_binary. Thus, a null-pointer dereference is triggered.
--- drivers/staging/media/atomisp/pci/sh_css.c | 1 + 1 file changed, 1 insertion(+)
drivers/staging/media/atomisp/pci/sh_css.c +1 -0
@@ -4737,6 +4737,7 @@ static int load_video_binaries(struct ia_css_pipe *pipe)sizeof (struct ia_css_binary ), GFP_KERNEL);if (!mycs->yuv_scaler_binary) { + mycs->num_yuv_scaler =0 ; err = -ENOMEM ;return err; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 316/744 drm/arm/malidp: fix a possible null pointer dereference
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huai-Yuan Liu <[email protected]>
[ Upstream commit a1f95aede6285dba6dd036d907196f35ae3a11ea ]
In malidp_mw_connector_reset, new memory is allocated with kzalloc, but no check is performed. In order to prevent null pointer dereferencing, ensure that mw_state is checked before calling __drm_atomic_helper_connector_reset.
--- drivers/gpu/drm/arm/malidp_mw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/arm/malidp_mw.c +4 -1
@@ -72,7 +72,10 @@ static void malidp_mw_connector_reset(struct drm_connector *connector)__drm_atomic_helper_connector_destroy_state (connector->state);kfree (connector->state); -__drm_atomic_helper_connector_reset (connector, &mw_state->base); + connector->state =NULL ; + +if (mw_state) +__drm_atomic_helper_connector_reset (connector, &mw_state->base); } static enum drm_connector_status
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 317/744 drm: vc4: Fix possible null pointer dereference
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Mishin <[email protected]>
[ Upstream commit c534b63bede6cb987c2946ed4d0b0013a52c5ba7 ]
In vc4_hdmi_audio_init() of_get_address() may return
NULL which is later dereferenced. Fix this bug by adding NULL check.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/gpu/drm/vc4/vc4_hdmi.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/vc4/vc4_hdmi.c +2 -0
@@ -2729,6 +2729,8 @@ static int vc4_hdmi_audio_init(struct vc4_hdmi *vc4_hdmi) index =1 ; addr =of_get_address (dev->of_node, index,NULL ,NULL ); +if (!addr) +return -EINVAL ; vc4_hdmi->audio.dma_data.addr =be32_to_cpup (addr) + mai_data->offset; vc4_hdmi->audio.dma_data.addr_width =DMA_SLAVE_BUSWIDTH_4_BYTES ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 318/744 ASoC: tracing: Export SND_SOC_DAPM_DIR_OUT to its value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Steven Rostedt <[email protected]>
[ Upstream commit 58300f8d6a48e58d1843199be743f819e2791ea3 ]
The string SND_SOC_DAPM_DIR_OUT is printed in the snd_soc_dapm_path trace event instead of its value:
(((REC->path_dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-")
User space cannot parse this, as it has no idea what SND_SOC_DAPM_DIR_OUT is. Use TRACE_DEFINE_ENUM() to convert it to its value:
(((REC->path_dir) == 1) ? "->" : "<-")
So that user space tools, such as perf and trace-cmd, can parse it correctly.
--- include/trace/events/asoc.h | 2 ++ 1 file changed, 2 insertions(+)
include/trace/events/asoc.h +2 -0
@@ -12,6 +12,8 @@#define DAPM_DIRECT "(direct)"#define DAPM_ARROW (dir) (((dir) == SND_SOC_DAPM_DIR_OUT) ? "->" : "<-") +TRACE_DEFINE_ENUM (SND_SOC_DAPM_DIR_OUT ); +struct snd_soc_jack ;struct snd_soc_card ;struct snd_soc_dapm_widget ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 319/744 drm/bridge: anx7625: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit ef4a9204d594fe959cdbc7418273caf4001535c8 ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -4
@@ -2076,10 +2076,8 @@ static int anx7625_setup_dsi_device(struct anx7625_data *ctx) }; host =of_find_mipi_dsi_host_by_node (ctx->pdata.mipi_host_node); -if (!host) { -DRM_DEV_ERROR (dev,"fail to find dsi host.\n" ); -return -EPROBE_DEFER ; - } +if (!host) +return dev_err_probe (dev, -EPROBE_DEFER ,"fail to find dsi host.\n" ); dsi =devm_mipi_dsi_device_register_full (dev, host, &info);if (IS_ERR (dsi)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 320/744 drm/bridge: icn6211: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 275fafe58faa7fdb10fa245412696ecef676aac5 ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
--- drivers/gpu/drm/bridge/chipone-icn6211.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/chipone-icn6211.c +2 -4
@@ -563,10 +563,8 @@ static int chipone_dsi_host_attach(struct chipone *icn) host =of_find_mipi_dsi_host_by_node (host_node);of_node_put (host_node); -if (!host) { -dev_err (dev,"failed to find dsi host\n" ); -return -EPROBE_DEFER ; - } +if (!host) +return dev_err_probe (dev, -EPROBE_DEFER ,"failed to find dsi host\n" ); dsi =mipi_dsi_device_register_full (host, &info);if (IS_ERR (dsi)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 321/744 drm/bridge: lt8912b: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit b3b4695ff47c4964d4ccb930890c9ffd8e455e20 ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
--- drivers/gpu/drm/bridge/lontium-lt8912b.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/lontium-lt8912b.c +2 -4
@@ -483,10 +483,8 @@ static int lt8912_attach_dsi(struct lt8912 *lt) }; host =of_find_mipi_dsi_host_by_node (lt->host_node); -if (!host) { -dev_err (dev,"failed to find dsi host\n" ); -return -EPROBE_DEFER ; - } +if (!host) +return dev_err_probe (dev, -EPROBE_DEFER ,"failed to find dsi host\n" ); dsi =devm_mipi_dsi_device_register_full (dev, host, &info);if (IS_ERR (dsi)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 322/744 drm/bridge: lt9611: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit cd0a2c6a081ff67007323725b9ff07d9934b1ed8 ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
--- drivers/gpu/drm/bridge/lontium-lt9611.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611.c +2 -4
@@ -760,10 +760,8 @@ static struct mipi_dsi_device *lt9611_attach_dsi(struct lt9611 *lt9611,int ret; host =of_find_mipi_dsi_host_by_node (dsi_node); -if (!host) { -dev_err (lt9611->dev,"failed to find dsi host\n" ); -return ERR_PTR (-EPROBE_DEFER ); - } +if (!host) +return ERR_PTR (dev_err_probe (lt9611->dev, -EPROBE_DEFER ,"failed to find dsi host\n" )); dsi =devm_mipi_dsi_device_register_full (dev, host, &info);if (IS_ERR (dsi)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 323/744 drm/bridge: lt9611uxc: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 6d9e877cde7e9b516a9a99751b8222c87557436d ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
--- drivers/gpu/drm/bridge/lontium-lt9611uxc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/lontium-lt9611uxc.c +2 -4
@@ -265,10 +265,8 @@ static struct mipi_dsi_device *lt9611uxc_attach_dsi(struct lt9611uxc *lt9611uxc,int ret; host =of_find_mipi_dsi_host_by_node (dsi_node); -if (!host) { -dev_err (dev,"failed to find dsi host\n" ); -return ERR_PTR (-EPROBE_DEFER ); - } +if (!host) +return ERR_PTR (dev_err_probe (dev, -EPROBE_DEFER ,"failed to find dsi host\n" )); dsi =devm_mipi_dsi_device_register_full (dev, host, &info);if (IS_ERR (dsi)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 324/744 drm/bridge: tc358775: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 272377aa0e3dddeec3f568c8bb9d12c7a79d8ef5 ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
--- drivers/gpu/drm/bridge/tc358775.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/tc358775.c +2 -4
@@ -610,10 +610,8 @@ static int tc_attach_host(struct tc_data *tc) }; host =of_find_mipi_dsi_host_by_node (tc->host_node); -if (!host) { -dev_err (dev,"failed to find dsi host\n" ); -return -EPROBE_DEFER ; - } +if (!host) +return dev_err_probe (dev, -EPROBE_DEFER ,"failed to find dsi host\n" ); dsi =devm_mipi_dsi_device_register_full (dev, host, &info);if (IS_ERR (dsi)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 325/744 drm/bridge: dpc3433: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 24f4f575214de776539d346b99b8717bffa8ebba ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
Also move the "failed to attach" error message so that it's only printed when the devm_mipi_dsi_attach() call fails.
--- drivers/gpu/drm/bridge/ti-dlpc3433.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/bridge/ti-dlpc3433.c +9 -8
@@ -319,12 +319,11 @@ static int dlpc_host_attach(struct dlpc *dlpc) .channel = 0, .node = NULL, }; +int ret; host =of_find_mipi_dsi_host_by_node (dlpc->host_node); -if (!host) { -DRM_DEV_ERROR (dev,"failed to find dsi host\n" ); -return -EPROBE_DEFER ; - } +if (!host) +return dev_err_probe (dev, -EPROBE_DEFER ,"failed to find dsi host\n" ); dlpc->dsi =mipi_dsi_device_register_full (host, &info);if (IS_ERR (dlpc->dsi)) {
@@ -336,7 +335,11 @@ static int dlpc_host_attach(struct dlpc *dlpc) dlpc->dsi->format =MIPI_DSI_FMT_RGB565 ; dlpc->dsi->lanes = dlpc->dsi_lanes; -return devm_mipi_dsi_attach (dev, dlpc->dsi); + ret =devm_mipi_dsi_attach (dev, dlpc->dsi); +if (ret) +DRM_DEV_ERROR (dev,"failed to attach dsi host\n" ); + +return ret; }static int dlpc3433_probe (struct i2c_client *client)
@@ -367,10 +370,8 @@ static int dlpc3433_probe(struct i2c_client *client)drm_bridge_add (&dlpc->bridge); ret =dlpc_host_attach (dlpc); -if (ret) { -DRM_DEV_ERROR (dev,"failed to attach dsi host\n" ); +if (ret) goto err_remove_bridge; - }return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 326/744 drm/panel: novatek-nt35950: Dont log an error when DSI host cant be found
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 5ff5505b9a2d827cae3f95dceba258c963138175 ]
Given that failing to find a DSI host causes the driver to defer probe, make use of dev_err_probe() to log the reason. This makes the defer probe reason available and avoids alerting userspace about something that is not necessarily an error.
--- drivers/gpu/drm/panel/panel-novatek-nt35950.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/panel/panel-novatek-nt35950.c +2 -4
@@ -565,10 +565,8 @@ static int nt35950_probe(struct mipi_dsi_device *dsi) } dsi_r_host =of_find_mipi_dsi_host_by_node (dsi_r);of_node_put (dsi_r); -if (!dsi_r_host) { -dev_err (dev,"Cannot get secondary DSI host\n" ); -return -EPROBE_DEFER ; - } +if (!dsi_r_host) +return dev_err_probe (dev, -EPROBE_DEFER ,"Cannot get secondary DSI host\n" ); nt->dsi[1 ] =mipi_dsi_device_register_full (dsi_r_host, info);if (!nt->dsi[1 ]) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 327/744 drm/bridge: anx7625: Update audio status while detecting
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsin-Te Yuan <[email protected]>
[ Upstream commit a665b4e60369867cddf50f37f16169a3e2f434ad ]
Previously, the audio status was not updated during detection, leading to a persistent audio despite hot plugging events. To resolve this issue, update the audio status during detection.
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +8 -1
@@ -2479,15 +2479,22 @@ static void anx7625_bridge_atomic_disable(struct drm_bridge *bridge,mutex_unlock (&ctx->aux_lock); } +static void +anx7625_audio_update_connector_status (struct anx7625_data *ctx, +enum drm_connector_status status); +static enum drm_connector_status anx7625_bridge_detect (struct drm_bridge *bridge) {struct anx7625_data *ctx =bridge_to_anx7625 (bridge);struct device *dev = ctx->dev; +enum drm_connector_status status;DRM_DEV_DEBUG_DRIVER (dev,"drm bridge detect\n" ); -return anx7625_sink_detect (ctx); + status =anx7625_sink_detect (ctx); +anx7625_audio_update_connector_status (ctx, status); +return status; } static struct edid *anx7625_bridge_get_edid(struct drm_bridge *bridge,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 328/744 drm/panel: simple: Add missing Innolux G121X1-L03 format, flags, connector
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit 11ac72d033b9f577e8ba0c7a41d1c312bb232593 ]
The .bpc = 6 implies .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG , add the missing bus_format. Add missing connector type and bus_flags as well.
Documentation [1] 1.4 GENERAL SPECIFICATI0NS indicates this panel is capable of both RGB 18bit/24bit panel, the current configuration uses 18bit mode, .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG , .bpc = 6.
Support for the 24bit mode would require another entry in panel-simple with .bus_format = MEDIA_BUS_FMT_RGB666_1X7X4_SPWG and .bpc = 8, which is out of scope of this fix.
[1] https://www.distec.de/fileadmin/pdf/produkte/TFT-Displays/Innolux/G121X1-L03_Datasheet.pdf
--- drivers/gpu/drm/panel/panel-simple.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/panel/panel-simple.c +3 -0
@@ -2407,6 +2407,9 @@ static const struct panel_desc innolux_g121x1_l03 = { .unprepare = 200, .disable = 400, }, + .bus_format = MEDIA_BUS_FMT_RGB666_1X7X3_SPWG, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, + .connector_type = DRM_MODE_CONNECTOR_LVDS, }; static const struct display_timing innolux_g156hce_l01_timings = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 329/744 drm/mipi-dsi: use correct return type for the DSC functions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit de1c705c50326acaceaf1f02bc5bf6f267c572bd ]
The functions mipi_dsi_compression_mode() and mipi_dsi_picture_parameter_set() return 0-or-error rather than a buffer size. Follow example of other similar MIPI DSI functions and use int return type instead of size_t.
--- drivers/gpu/drm/drm_mipi_dsi.c | 6 +++--- include/drm/drm_mipi_dsi.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/drm_mipi_dsi.c +3 -3
@@ -654,7 +654,7 @@ EXPORT_SYMBOL(mipi_dsi_set_maximum_return_packet_size);* * Return: 0 on success or a negative error code on failure. */ -ssize_t mipi_dsi_compression_mode (struct mipi_dsi_device *dsi,bool enable) +int mipi_dsi_compression_mode (struct mipi_dsi_device *dsi,bool enable) {/* Note: Needs updating for non-default PPS or algorithm */ u8 tx[2 ] = { enable <<0 ,0 };
@@ -679,8 +679,8 @@ EXPORT_SYMBOL(mipi_dsi_compression_mode);* * Return: 0 on success or a negative error code on failure. */ -ssize_t mipi_dsi_picture_parameter_set (struct mipi_dsi_device *dsi, -const struct drm_dsc_picture_parameter_set *pps) +int mipi_dsi_picture_parameter_set (struct mipi_dsi_device *dsi, +const struct drm_dsc_picture_parameter_set *pps) {struct mipi_dsi_msg msg = { .channel = dsi->channel,
include/drm/drm_mipi_dsi.h +3 -3
@@ -241,9 +241,9 @@ int mipi_dsi_shutdown_peripheral(struct mipi_dsi_device *dsi);int mipi_dsi_turn_on_peripheral (struct mipi_dsi_device *dsi);int mipi_dsi_set_maximum_return_packet_size (struct mipi_dsi_device *dsi,u16 value); -ssize_t mipi_dsi_compression_mode (struct mipi_dsi_device *dsi,bool enable); -ssize_t mipi_dsi_picture_parameter_set (struct mipi_dsi_device *dsi, -const struct drm_dsc_picture_parameter_set *pps); +int mipi_dsi_compression_mode (struct mipi_dsi_device *dsi,bool enable); +int mipi_dsi_picture_parameter_set (struct mipi_dsi_device *dsi, +const struct drm_dsc_picture_parameter_set *pps);ssize_t mipi_dsi_generic_write (struct mipi_dsi_device *dsi,const void *payload,size_t size);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 330/744 media: uvcvideo: Add quirk for Logitech Rally Bar
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
[ Upstream commit 07731053d11f7647d5d8bc23caac997a4d562dfe ]
Logitech Rally Bar devices, despite behaving as UVC cameras, have a different power management system that the other cameras from Logitech.
USB_QUIRK_RESET_RESUME is applied to all the UVC cameras from Logitech at the usb core. Unfortunately, USB_QUIRK_RESET_RESUME causes undesired USB disconnects in the Rally Bar that make them completely unusable.
There is an open discussion about if we should fix this in the core or add a quirk in the UVC driver. In order to enable this hardware, let's land this patch first, and we can revert it later if there is a different conclusion.
--- drivers/media/usb/uvc/uvc_driver.c | 31 ++++++++++++++++++++++++++++++ drivers/media/usb/uvc/uvcvideo.h | 1 + 2 files changed, 32 insertions(+)
drivers/media/usb/uvc/uvc_driver.c +31 -0
@@ -14,6 +14,7 @@#include <linux/module.h> #include <linux/slab.h> #include <linux/usb.h> +#include <linux/usb/quirks.h> #include <linux/usb/uvc.h> #include <linux/videodev2.h> #include <linux/vmalloc.h>
@@ -2232,6 +2233,9 @@ static int uvc_probe(struct usb_interface *intf, goto error; } +if (dev->quirks &UVC_QUIRK_NO_RESET_RESUME ) + udev->quirks &= ~USB_QUIRK_RESET_RESUME ; +uvc_dbg (dev,PROBE ,"UVC device initialized\n" );usb_enable_autosuspend (udev);return 0 ;
@@ -2574,6 +2578,33 @@ static const struct usb_device_id uvc_ids[] = { .bInterfaceSubClass = 1, .bInterfaceProtocol = 0, .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_RESTORE_CTRLS_ON_INIT) }, +/* Logitech Rally Bar Huddle */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x046d, + .idProduct = 0x087c, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) }, + /* Logitech Rally Bar */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x046d, + .idProduct = 0x089b, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) }, + /* Logitech Rally Bar Mini */ + { .match_flags = USB_DEVICE_ID_MATCH_DEVICE + | USB_DEVICE_ID_MATCH_INT_INFO, + .idVendor = 0x046d, + .idProduct = 0x08d3, + .bInterfaceClass = USB_CLASS_VIDEO, + .bInterfaceSubClass = 1, + .bInterfaceProtocol = 0, + .driver_info = UVC_INFO_QUIRK(UVC_QUIRK_NO_RESET_RESUME) }, /* Chicony CNF7129 (Asus EEE 100HE) */ { .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_INFO,
drivers/media/usb/uvc/uvcvideo.h +1 -0
@@ -73,6 +73,7 @@#define UVC_QUIRK_FORCE_Y8 0x00000800#define UVC_QUIRK_FORCE_BPP 0x00001000#define UVC_QUIRK_WAKE_AUTOSUSPEND 0x00002000 +#define UVC_QUIRK_NO_RESET_RESUME 0x00004000/* Format flags */ #define UVC_FMT_FLAG_COMPRESSED 0x00000001
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 331/744 drm/rockchip: vop2: Do not divide height twice for YUV
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Detlev Casanova <[email protected]>
[ Upstream commit e80c219f52861e756181d7f88b0d341116daac2b ]
For the cbcr format, gt2 and gt4 are computed again after src_h has been divided by vsub.
As src_h as already been divided by 2 before, introduce cbcr_src_h and cbcr_src_w to keep a copy of those values to be used for cbcr gt2 and gt4 computation.
This fixes yuv planes being unaligned vertically when down scaling to 1080 pixels from 2160.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 22 +++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +12 -10
@@ -609,6 +609,8 @@ static void vop2_setup_scale(struct vop2 *vop2, const struct vop2_win *win,const struct drm_format_info *info;u16 hor_scl_mode, ver_scl_mode;u16 hscl_filter_mode, vscl_filter_mode; +uint16_t cbcr_src_w = src_w; +uint16_t cbcr_src_h = src_h;u8 gt2 =0 ;u8 gt4 =0 ;u32 val;
@@ -666,27 +668,27 @@ static void vop2_setup_scale(struct vop2 *vop2, const struct vop2_win *win,vop2_win_write (win,VOP2_WIN_YRGB_VSCL_FILTER_MODE , vscl_filter_mode);if (info->is_yuv) { - src_w /= info->hsub; - src_h /= info->vsub; + cbcr_src_w /= info->hsub; + cbcr_src_h /= info->vsub; gt4 =0 ; gt2 =0 ; -if (src_h >= (4 * dst_h)) { +if (cbcr_src_h >= (4 * dst_h)) { gt4 =1 ; - src_h >>=2 ; - }else if (src_h >= (2 * dst_h)) { + cbcr_src_h >>=2 ; + }else if (cbcr_src_h >= (2 * dst_h)) { gt2 =1 ; - src_h >>=1 ; + cbcr_src_h >>=1 ; } - hor_scl_mode =scl_get_scl_mode (src_w, dst_w); - ver_scl_mode =scl_get_scl_mode (src_h, dst_h); + hor_scl_mode =scl_get_scl_mode (cbcr_src_w, dst_w); + ver_scl_mode =scl_get_scl_mode (cbcr_src_h, dst_h); - val =vop2_scale_factor (src_w, dst_w); + val =vop2_scale_factor (cbcr_src_w, dst_w);vop2_win_write (win,VOP2_WIN_SCALE_CBCR_X , val); - val =vop2_scale_factor (src_h, dst_h); + val =vop2_scale_factor (cbcr_src_h, dst_h);vop2_win_write (win,VOP2_WIN_SCALE_CBCR_Y , val);vop2_win_write (win,VOP2_WIN_VSD_CBCR_GT4 , gt4);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 332/744 drm/edid: Parse topology block for all DispID structure v1.x
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
[ Upstream commit e0a200ab4b72afd581bd6f82fc1ef510a4fb5478 ]
DisplayID spec v1.3 revision history notes do claim that the toplogy block was added in v1.3 so requiring structure v1.2 would seem correct, but there is at least one EDID in edid.tv with a topology block and structure v1.0. And there are also EDIDs with DisplayID structure v1.3 which seems to be totally incorrect as DisplayID spec v1.3 lists structure v1.2 as the only legal value.
Unfortunately I couldn't find copies of DisplayID spec v1.0-v1.2 anywhere (even on vesa.org), so I'll have to go on empirical evidence alone.
We used to parse the topology block on all v1.x structures until the check for structure v2.0 was added. Let's go back to doing that as the evidence does suggest that there are DisplayIDs in the wild that would miss out on the topology stuff otherwise.
Also toss out DISPLAY_ID_STRUCTURE_VER_12 entirely as it doesn't appear we can really use it for anything.
I *think* we could technically skip all the structure version checks as the block tags shouldn't conflict between v2.0 and v1.x. But no harm in having a bit of extra sanity checks I guess.
So far I'm not aware of any user reported regressions from overly strict check, but I do know that it broke igt/kms_tiled_display's fake DisplayID as that one gets generated with structure v1.0.
--- drivers/gpu/drm/drm_edid.c | 2 +- include/drm/drm_displayid.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/drm_edid.c +1 -1
@@ -7321,7 +7321,7 @@ static void drm_parse_tiled_block(struct drm_connector *connector,static bool displayid_is_tiled_block (const struct displayid_iter *iter,const struct displayid_block *block) { -return (displayid_version (iter) ==DISPLAY_ID_STRUCTURE_VER_12 && +return (displayid_version (iter) <DISPLAY_ID_STRUCTURE_VER_20 && block->tag ==DATA_BLOCK_TILED_DISPLAY ) || (displayid_version (iter) ==DISPLAY_ID_STRUCTURE_VER_20 && block->tag ==DATA_BLOCK_2_TILED_DISPLAY_TOPOLOGY );
include/drm/drm_displayid.h +0 -1
@@ -30,7 +30,6 @@ struct drm_edid;#define VESA_IEEE_OUI 0x3a0292/* DisplayID Structure versions */ -#define DISPLAY_ID_STRUCTURE_VER_12 0x12#define DISPLAY_ID_STRUCTURE_VER_20 0x20/* DisplayID Structure v1r2 Data Blocks */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 333/744 media: cadence: csi2rx: configure DPHY before starting source stream
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pratyush Yadav <[email protected]>
[ Upstream commit fd64dda48f7e3f67ada1e1fe47e784ab350da72e ]
When the source device is operating above 1.5 Gbps per lane, it needs to send the Skew Calibration Sequence before sending any HS data. If the DPHY is initialized after the source stream is started, then it might miss the sequence and not be able to receive data properly. Move the start of source subdev to the end of the sequence to make sure everything is ready to receive data before the source starts streaming.
--- drivers/media/platform/cadence/cdns-csi2rx.c | 26 +++++++++++--------- 1 file changed, 14 insertions(+), 12 deletions(-)
drivers/media/platform/cadence/cdns-csi2rx.c +14 -12
@@ -164,10 +164,6 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx)writel (reg, csi2rx->base +CSI2RX_STATIC_CFG_REG ); - ret =v4l2_subdev_call (csi2rx->source_subdev, video, s_stream, true); -if (ret) - goto err_disable_pclk; -/* Enable DPHY clk and data lanes. */ if (csi2rx->dphy) { reg =CSI2RX_DPHY_CL_EN |CSI2RX_DPHY_CL_RST ;
@@ -177,6 +173,13 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx) }writel (reg, csi2rx->base +CSI2RX_DPHY_LANE_CTRL_REG ); + + ret =csi2rx_configure_ext_dphy (csi2rx); +if (ret) { +dev_err (csi2rx->dev, +"Failed to configure external DPHY: %d\n" , ret); + goto err_disable_pclk; + } }/*
@@ -213,14 +216,9 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx)reset_control_deassert (csi2rx->sys_rst); -if (csi2rx->dphy) { - ret =csi2rx_configure_ext_dphy (csi2rx); -if (ret) { -dev_err (csi2rx->dev, -"Failed to configure external DPHY: %d\n" , ret); - goto err_disable_sysclk; - } - } + ret =v4l2_subdev_call (csi2rx->source_subdev, video, s_stream, true); +if (ret) + goto err_disable_sysclk;clk_disable_unprepare (csi2rx->p_clk);
@@ -234,6 +232,10 @@ static int csi2rx_start(struct csi2rx_priv *csi2rx)clk_disable_unprepare (csi2rx->pixel_clk[i -1 ]); } +if (csi2rx->dphy) { +writel (0 , csi2rx->base +CSI2RX_DPHY_LANE_CTRL_REG ); +phy_power_off (csi2rx->dphy); + } err_disable_pclk:clk_disable_unprepare (csi2rx->p_clk);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 334/744 clk: samsung: exynosautov9: fix wrong pll clock id value
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jaewon Kim <[email protected]>
[ Upstream commit 04ee3a0b44e3d18cf6b0c712d14b98624877fd26 ]
All PLL id values of CMU_TOP were incorrectly set to FOUT_SHARED0_PLL. It modified to the correct PLL clock id value.
--- drivers/clk/samsung/clk-exynosautov9.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/samsung/clk-exynosautov9.c +4 -4
@@ -352,13 +352,13 @@ static const struct samsung_pll_clock top_pll_clks[] __initconst = {/* CMU_TOP_PURECLKCOMP */ PLL (pll_0822x,FOUT_SHARED0_PLL ,"fout_shared0_pll" ,"oscclk" ,PLL_LOCKTIME_PLL_SHARED0 ,PLL_CON3_PLL_SHARED0 ,NULL ), -PLL (pll_0822x,FOUT_SHARED0_PLL ,"fout_shared1_pll" ,"oscclk" , +PLL (pll_0822x,FOUT_SHARED1_PLL ,"fout_shared1_pll" ,"oscclk" ,PLL_LOCKTIME_PLL_SHARED1 ,PLL_CON3_PLL_SHARED1 ,NULL ), -PLL (pll_0822x,FOUT_SHARED0_PLL ,"fout_shared2_pll" ,"oscclk" , +PLL (pll_0822x,FOUT_SHARED2_PLL ,"fout_shared2_pll" ,"oscclk" ,PLL_LOCKTIME_PLL_SHARED2 ,PLL_CON3_PLL_SHARED2 ,NULL ), -PLL (pll_0822x,FOUT_SHARED0_PLL ,"fout_shared3_pll" ,"oscclk" , +PLL (pll_0822x,FOUT_SHARED3_PLL ,"fout_shared3_pll" ,"oscclk" ,PLL_LOCKTIME_PLL_SHARED3 ,PLL_CON3_PLL_SHARED3 ,NULL ), -PLL (pll_0822x,FOUT_SHARED0_PLL ,"fout_shared4_pll" ,"oscclk" , +PLL (pll_0822x,FOUT_SHARED4_PLL ,"fout_shared4_pll" ,"oscclk" , PLL_LOCKTIME_PLL_SHARED4, PLL_CON3_PLL_SHARED4, NULL), };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 335/744 RDMA/mlx5: Uncacheable mkey has neither rb_key or cache_ent
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Or Har-Toov <[email protected]>
[ Upstream commit 0611a8e8b475fc5230b9a24d29c8397aaab20b63 ]
As some mkeys can't be modified with UMR due to some UMR limitations, like the size of translation that can be updated, not all user mkeys can be cached.
--- drivers/infiniband/hw/mlx5/mlx5_ib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/mlx5_ib.h +1 -1
@@ -643,7 +643,7 @@ struct mlx5_ib_mkey {unsigned int ndescs;struct wait_queue_head wait;refcount_t usecount; -/* User Mkey must hold either a rb_key or a cache_ent. */ +/* Cacheable user Mkey must hold either a rb_key or a cache_ent. */ struct mlx5r_cache_rb_key rb_key;struct mlx5_cache_ent *cache_ent; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 336/744 RDMA/mlx5: Adding remote atomic access flag to updatable flags
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Or Har-Toov <[email protected]>
[ Upstream commit 2ca7e93bc963d9ec2f5c24d117176851454967af ]
Currently IB_ACCESS_REMOTE_ATOMIC is blocked from being updated via UMR although in some cases it should be possible. These cases are checked in mlx5r_umr_can_reconfig function.
--- drivers/infiniband/hw/mlx5/mr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/mlx5/mr.c +2 -1
@@ -1594,7 +1594,8 @@ static bool can_use_umr_rereg_access(struct mlx5_ib_dev *dev,unsigned int diffs = current_access_flags ^ target_access_flags;if (diffs & ~(IB_ACCESS_LOCAL_WRITE |IB_ACCESS_REMOTE_WRITE | -IB_ACCESS_REMOTE_READ |IB_ACCESS_RELAXED_ORDERING )) +IB_ACCESS_REMOTE_READ |IB_ACCESS_RELAXED_ORDERING | +IB_ACCESS_REMOTE_ATOMIC ))return false;return mlx5r_umr_can_reconfig (dev, current_access_flags, target_access_flags);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 337/744 clk: mediatek: pllfh: Dont log error for missing fhctl node
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit bb7b3c8e7180f36de75cdea200ab7127f93f58cc ]
Support for fhctl clocks in apmixedsys was introduced at a later point and to this moment only one mt6795 based platform has a fhctl DT node present. Therefore the fhctl support in apmixedsys should be seen as optional and not cause an error when it is missing.
Change the message's log level to warning. The warning level is chosen so that it will still alert the fact that fhctl support might be unintentionally missing, but without implying that this is necessarily an issue.
Even if the FHCTL DT nodes are added to all current platforms moving forward, since those changes won't be backported, this ensures stable kernel releases won't have live with this error.
--- drivers/clk/mediatek/clk-pllfh.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/mediatek/clk-pllfh.c +1 -1
@@ -68,7 +68,7 @@ void fhctl_parse_dt(const u8 *compatible_node, struct mtk_pllfh_data *pllfhs, node =of_find_compatible_node (NULL ,NULL , compatible_node);if (!node) { -pr_err ("cannot find \"%s\"\n" , compatible_node); +pr_warn ("cannot find \"%s\"\n" , compatible_node);return ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 338/744 iommu: Undo pasid attachment only for the devices that have succeeded
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yi Liu <[email protected]>
[ Upstream commit b025dea63cded0d82bccd591fa105d39efc6435d ]
There is no error handling now in __iommu_set_group_pasid(), it relies on its caller to loop all the devices to undo the pasid attachment. This is not self-contained and has drawbacks. It would result in unnecessary remove_dev_pasid() calls on the devices that have not been attached to the new domain. But the remove_dev_pasid() callback would get the new domain from the group->pasid_array. So for such devices, the iommu driver won't find the attachment under the domain, hence unable to do cleanup. This may not be a real problem today. But it depends on the implementation of the underlying iommu driver. e.g. the intel iommu driver would warn for such devices. Such warnings are unnecessary.
To solve the above problem, it is necessary to handle the error within __iommu_set_group_pasid(). It only loops the devices that have attached to the new domain, and undo it.
--- drivers/iommu/iommu.c | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-)
drivers/iommu/iommu.c +15 -6
@@ -3369,15 +3369,26 @@ EXPORT_SYMBOL_GPL(iommu_group_dma_owner_claimed);static int __iommu_set_group_pasid (struct iommu_domain *domain,struct iommu_group *group,ioasid_t pasid) { -struct group_device *device; -int ret =0 ; +struct group_device *device, *last_gdev; +int ret;for_each_group_device (group, device) { ret = domain->ops->set_dev_pasid (domain, device->dev, pasid);if (ret) -break ; + goto err_revert; } +return 0 ; + +err_revert: + last_gdev = device; +for_each_group_device (group, device) { +const struct iommu_ops *ops =dev_iommu_ops (device->dev); + +if (device == last_gdev) +break ; + ops->remove_dev_pasid (device->dev, pasid); + }return ret; }
@@ -3423,10 +3434,8 @@ int iommu_attach_device_pasid(struct iommu_domain *domain, } ret =__iommu_set_group_pasid (domain, group, pasid); -if (ret) { -__iommu_remove_group_pasid (group, pasid); +if (ret)xa_erase (&group->pasid_array, pasid); - } out_unlock:mutex_unlock (&group->mutex);iommu_group_put (group);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 339/744 RDMA/hns: Fix return value in hns_roce_map_mr_sg
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhengchao Shao <[email protected]>
[ Upstream commit 203b70fda63425a4eb29f03f9074859afe821a39 ]
As described in the ib_map_mr_sg function comment, it returns the number of sg elements that were mapped to the memory region. However, hns_roce_map_mr_sg returns the number of pages required for mapping the DMA area. Fix it.
--- drivers/infiniband/hw/hns/hns_roce_mr.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/infiniband/hw/hns/hns_roce_mr.c +7 -8
@@ -421,18 +421,18 @@ int hns_roce_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, int sg_nents,struct ib_device *ibdev = &hr_dev->ib_dev;struct hns_roce_mr *mr =to_hr_mr (ibmr);struct hns_roce_mtr *mtr = &mr->pbl_mtr; -int ret =0 ; +int ret, sg_num =0 ; mr->npages =0 ; mr->page_list =kvcalloc (mr->pbl_mtr.hem_cfg.buf_pg_count,sizeof (dma_addr_t),GFP_KERNEL );if (!mr->page_list) -return ret; +return sg_num; - ret =ib_sg_to_pages (ibmr, sg, sg_nents, sg_offset, hns_roce_set_page); -if (ret <1 ) { + sg_num =ib_sg_to_pages (ibmr, sg, sg_nents, sg_offset, hns_roce_set_page); +if (sg_num <1 ) {ibdev_err (ibdev,"failed to store sg pages %u %u, cnt = %d.\n" , - mr->npages, mr->pbl_mtr.hem_cfg.buf_pg_count, ret); + mr->npages, mr->pbl_mtr.hem_cfg.buf_pg_count, sg_num); goto err_page_list; }
@@ -443,17 +443,16 @@ int hns_roce_map_mr_sg(struct ib_mr *ibmr, struct scatterlist *sg, int sg_nents, ret =hns_roce_mtr_map (hr_dev, mtr, mr->page_list, mr->npages);if (ret) {ibdev_err (ibdev,"failed to map sg mtr, ret = %d.\n" , ret); - ret =0 ; + sg_num =0 ; }else { mr->pbl_mtr.hem_cfg.buf_pg_shift = (u32 )ilog2 (ibmr->page_size); - ret = mr->npages; } err_page_list:kvfree (mr->page_list); mr->page_list =NULL ; -return ret; +return sg_num; } static void hns_roce_mw_free(struct hns_roce_dev *hr_dev,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 340/744 RDMA/hns: Fix deadlock on SRQ async events.
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengchang Tang <[email protected]>
[ Upstream commit b46494b6f9c19f141114a57729e198698f40af37 ]
xa_lock for SRQ table may be required in AEQ. Use xa_store_irq()/ xa_erase_irq() to avoid deadlock.
--- drivers/infiniband/hw/hns/hns_roce_main.c | 1 + drivers/infiniband/hw/hns/hns_roce_srq.c | 6 +++--- 2 files changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hns/hns_roce_main.c +1 -0
@@ -37,6 +37,7 @@#include <rdma/ib_smi.h> #include <rdma/ib_user_verbs.h> #include <rdma/ib_cache.h> +#include "hnae3.h" #include "hns_roce_common.h" #include "hns_roce_device.h" #include "hns_roce_hem.h"
drivers/infiniband/hw/hns/hns_roce_srq.c +3 -3
@@ -122,7 +122,7 @@ static int alloc_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq)return ret; } - ret =xa_err (xa_store (&srq_table->xa, srq->srqn, srq,GFP_KERNEL )); + ret =xa_err (xa_store_irq (&srq_table->xa, srq->srqn, srq,GFP_KERNEL ));if (ret) {ibdev_err (ibdev,"failed to store SRQC, ret = %d.\n" , ret); goto err_put;
@@ -135,7 +135,7 @@ static int alloc_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq)return 0 ; err_xa: -xa_erase (&srq_table->xa, srq->srqn); +xa_erase_irq (&srq_table->xa, srq->srqn); err_put:hns_roce_table_put (hr_dev, &srq_table->table, srq->srqn);
@@ -153,7 +153,7 @@ static void free_srqc(struct hns_roce_dev *hr_dev, struct hns_roce_srq *srq)dev_err (hr_dev->dev,"DESTROY_SRQ failed (%d) for SRQN %06lx\n" , ret, srq->srqn); -xa_erase (&srq_table->xa, srq->srqn); +xa_erase_irq (&srq_table->xa, srq->srqn);if (refcount_dec_and_test (&srq->refcount))complete (&srq->free);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 341/744 RDMA/hns: Fix UAF for cq async event
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengchang Tang <[email protected]>
[ Upstream commit a942ec2745ca864cd8512142100e4027dc306a42 ]
The refcount of CQ is not protected by locks. When CQ asynchronous events and CQ destruction are concurrent, CQ may have been released, which will cause UAF.
Use the xa_lock() to protect the CQ refcount.
--- drivers/infiniband/hw/hns/hns_roce_cq.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
drivers/infiniband/hw/hns/hns_roce_cq.c +13 -11
@@ -151,7 +151,7 @@ static int alloc_cqc(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq)return ret; } - ret =xa_err (xa_store (&cq_table->array, hr_cq->cqn, hr_cq,GFP_KERNEL )); + ret =xa_err (xa_store_irq (&cq_table->array, hr_cq->cqn, hr_cq,GFP_KERNEL ));if (ret) {ibdev_err (ibdev,"failed to xa_store CQ, ret = %d.\n" , ret); goto err_put;
@@ -164,7 +164,7 @@ static int alloc_cqc(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq)return 0 ; err_xa: -xa_erase (&cq_table->array, hr_cq->cqn); +xa_erase_irq (&cq_table->array, hr_cq->cqn); err_put:hns_roce_table_put (hr_dev, &cq_table->table, hr_cq->cqn);
@@ -183,7 +183,7 @@ static void free_cqc(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq)dev_err (dev,"DESTROY_CQ failed (%d) for CQN %06lx\n" , ret, hr_cq->cqn); -xa_erase (&cq_table->array, hr_cq->cqn); +xa_erase_irq (&cq_table->array, hr_cq->cqn);/* Waiting interrupt process procedure carried out */ synchronize_irq (hr_dev->eq_table.eq[hr_cq->vector].irq);
@@ -472,13 +472,6 @@ void hns_roce_cq_event(struct hns_roce_dev *hr_dev, u32 cqn, int event_type)struct ib_event event;struct ib_cq *ibcq; - hr_cq =xa_load (&hr_dev->cq_table.array, - cqn & (hr_dev->caps.num_cqs -1 )); -if (!hr_cq) { -dev_warn (dev,"async event for bogus CQ 0x%06x\n" , cqn); -return ; - } -if (event_type !=HNS_ROCE_EVENT_TYPE_CQ_ID_INVALID && event_type !=HNS_ROCE_EVENT_TYPE_CQ_ACCESS_ERROR && event_type !=HNS_ROCE_EVENT_TYPE_CQ_OVERFLOW ) {
@@ -487,7 +480,16 @@ void hns_roce_cq_event(struct hns_roce_dev *hr_dev, u32 cqn, int event_type)return ; } -refcount_inc (&hr_cq->refcount); +xa_lock (&hr_dev->cq_table.array); + hr_cq =xa_load (&hr_dev->cq_table.array, + cqn & (hr_dev->caps.num_cqs -1 )); +if (hr_cq) +refcount_inc (&hr_cq->refcount); +xa_unlock (&hr_dev->cq_table.array); +if (!hr_cq) { +dev_warn (dev,"async event for bogus CQ 0x%06x\n" , cqn); +return ; + } ibcq = &hr_cq->ib_cq;if (ibcq->event_handler) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 342/744 RDMA/hns: Fix GMV table pagesize
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengchang Tang <[email protected]>
[ Upstream commit ee045493283403969591087bd405fa280103282a ]
GMV's BA table only supports 4K pages. Currently, PAGESIZE is used to calculate gmv_bt_num, which will cause an abnormal number of gmv_bt_num in a 64K OS.
--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +1 -1
@@ -2088,7 +2088,7 @@ static void apply_func_caps(struct hns_roce_dev *hr_dev) caps->gid_table_len[0 ] = caps->gmv_bt_num * (HNS_HW_PAGE_SIZE / caps->gmv_entry_sz); - caps->gmv_entry_num = caps->gmv_bt_num * (PAGE_SIZE / + caps->gmv_entry_num = caps->gmv_bt_num * (HNS_HW_PAGE_SIZE / caps->gmv_entry_sz); }else {u32 func_num =max_t (u32,1 , hr_dev->func_num);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 343/744 RDMA/hns: Use complete parentheses in macros
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengchang Tang <[email protected]>
[ Upstream commit 4125269bb9b22e1d8cdf4412c81be8074dbc61ca ]
Use complete parentheses to ensure that macro expansion does not produce unexpected results.
--- drivers/infiniband/hw/hns/hns_roce_hem.h | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hem.h +6 -6
@@ -61,16 +61,16 @@ enum { (sizeof(struct scatterlist) + sizeof(void *)))#define check_whether_bt_num_3 (type, hop_num) \ - (type < HEM_TYPE_MTT && hop_num == 2) + ((type) < HEM_TYPE_MTT && (hop_num) == 2)#define check_whether_bt_num_2 (type, hop_num) \ - ((type < HEM_TYPE_MTT && hop_num == 1) || \ - (type >= HEM_TYPE_MTT && hop_num == 2)) + (((type) < HEM_TYPE_MTT && (hop_num) == 1) || \ + ((type) >= HEM_TYPE_MTT && (hop_num) == 2))#define check_whether_bt_num_1 (type, hop_num) \ - ((type < HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0) || \ - (type >= HEM_TYPE_MTT && hop_num == 1) || \ - (type >= HEM_TYPE_MTT && hop_num == HNS_ROCE_HOP_NUM_0)) + (((type) < HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0) || \ + ((type) >= HEM_TYPE_MTT && (hop_num) == 1) || \ + ((type) >= HEM_TYPE_MTT && (hop_num) == HNS_ROCE_HOP_NUM_0))struct hns_roce_hem_chunk {struct list_head list;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 344/744 RDMA/hns: Modify the print level of CQE error
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chengchang Tang <[email protected]>
[ Upstream commit 349e859952285ab9689779fb46de163f13f18f43 ]
Too much print may lead to a panic in kernel. Change ibdev_err() to ibdev_err_ratelimited(), and change the printing level of cqe dump to debug level.
--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +3 -2
@@ -3698,8 +3698,9 @@ static void get_cqe_status(struct hns_roce_dev *hr_dev, struct hns_roce_qp *qp, wc->status == IB_WC_WR_FLUSH_ERR))return ; -ibdev_err (&hr_dev->ib_dev,"error cqe status 0x%x:\n" , cqe_status); -print_hex_dump (KERN_ERR ,"" ,DUMP_PREFIX_NONE ,16 ,4 , cqe, +ibdev_err_ratelimited (&hr_dev->ib_dev,"error cqe status 0x%x:\n" , + cqe_status); +print_hex_dump (KERN_DEBUG ,"" ,DUMP_PREFIX_NONE ,16 ,4 , cqe, cq->cqe_size, false); wc->vendor_err =hr_reg_read (cqe,CQE_SUB_STATUS );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 345/744 clk: mediatek: mt8365-mm: fix DPI0 parent
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexandre Mergnat <[email protected]>
[ Upstream commit 4c0c087772d7e29bc2489ddb068d5167140bfc38 ]
To have a working display through DPI, a workaround has been implemented downstream to add "mm_dpi0_dpi0" and "dpi0_sel" to the DPI node. Shortly, that add an extra clock.
It seems consistent to have the "dpi0_sel" as parent. Additionnaly, "vpll_dpix" isn't used/managed.
Then, set the "mm_dpi0_dpi0" parent clock to "dpi0_sel".
The new clock tree is:
clk26m
lvdspll
lvdspll_X (2, 4, 8, 16)
dpi0_sel
mm_dpi0_dpi0--- drivers/clk/mediatek/clk-mt8365-mm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/mediatek/clk-mt8365-mm.c +1 -1
@@ -53,7 +53,7 @@ static const struct mtk_gate mm_clks[] = {GATE_MM0 (CLK_MM_MM_DSI0 ,"mm_dsi0" ,"mm_sel" ,17 ),GATE_MM0 (CLK_MM_MM_DISP_RDMA1 ,"mm_disp_rdma1" ,"mm_sel" ,18 ),GATE_MM0 (CLK_MM_MM_MDP_RDMA1 ,"mm_mdp_rdma1" ,"mm_sel" ,19 ), -GATE_MM0 (CLK_MM_DPI0_DPI0 ,"mm_dpi0_dpi0" ,"vpll_dpix" ,20 ), +GATE_MM0 (CLK_MM_DPI0_DPI0 ,"mm_dpi0_dpi0" ,"dpi0_sel" ,20 ),GATE_MM0 (CLK_MM_MM_FAKE ,"mm_fake" ,"mm_sel" ,21 ),GATE_MM0 (CLK_MM_MM_SMI_COMMON ,"mm_smi_common" ,"mm_sel" ,22 ), GATE_MM0(CLK_MM_MM_SMI_LARB0, "mm_smi_larb0", "mm_sel", 23),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 346/744 clk: rs9: fix wrong default value for clock amplitude
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Catalin Popescu <[email protected]>
[ Upstream commit 1758c68c81b8b881818fcebaaeb91055362a82f8 ]
According to 9FGV0241, 9FGV0441 & 9FGV0841 datasheets, the default value for the clock amplitude is 0.8V, while the driver assumes 0.7V.
Additionally, define constants for default values for both clock amplitude and spread spectrum and use them.
--- drivers/clk/clk-renesas-pcie.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/clk/clk-renesas-pcie.c +6 -4
@@ -24,10 +24,12 @@#define RS9_REG_SS_AMP_0V7 0x1#define RS9_REG_SS_AMP_0V8 0x2#define RS9_REG_SS_AMP_0V9 0x3 +#define RS9_REG_SS_AMP_DEFAULT RS9_REG_SS_AMP_0V8#define RS9_REG_SS_AMP_MASK 0x3#define RS9_REG_SS_SSC_100 0#define RS9_REG_SS_SSC_M025 (1 << 3)#define RS9_REG_SS_SSC_M050 (3 << 3) +#define RS9_REG_SS_SSC_DEFAULT RS9_REG_SS_SSC_100#define RS9_REG_SS_SSC_MASK (3 << 3)#define RS9_REG_SS_SSC_LOCK BIT(5)#define RS9_REG_SR 0x2
@@ -211,8 +213,8 @@ static int rs9_get_common_config(struct rs9_driver_data *rs9)int ret;/* Set defaults */ - rs9->pll_amplitude =RS9_REG_SS_AMP_0V7 ; - rs9->pll_ssc =RS9_REG_SS_SSC_100 ; + rs9->pll_amplitude =RS9_REG_SS_AMP_DEFAULT ; + rs9->pll_ssc =RS9_REG_SS_SSC_DEFAULT ;/* Output clock amplitude */ ret = of_property_read_u32(np, "renesas,out-amplitude-microvolt",
@@ -253,13 +255,13 @@ static void rs9_update_config(struct rs9_driver_data *rs9)int i;/* If amplitude is non-default, update it. */ -if (rs9->pll_amplitude !=RS9_REG_SS_AMP_0V7 ) { +if (rs9->pll_amplitude !=RS9_REG_SS_AMP_DEFAULT ) {regmap_update_bits (rs9->regmap,RS9_REG_SS ,RS9_REG_SS_AMP_MASK , rs9->pll_amplitude); }/* If SSC is non-default, update it. */ -if (rs9->pll_ssc !=RS9_REG_SS_SSC_100 ) { +if (rs9->pll_ssc !=RS9_REG_SS_SSC_DEFAULT ) {regmap_update_bits (rs9->regmap,RS9_REG_SS ,RS9_REG_SS_SSC_MASK , rs9->pll_ssc); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 347/744 clk: qcom: clk-alpha-pll: remove invalid Stromer register offset
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gabor Juhos <[email protected]>
[ Upstream commit 4f2bc4acbb1916b8cd2ce4bb3ba7b1cd7cb705fa ]
The offset of the CONFIG_CTL_U register defined for the Stromer PLL is wrong. It is not aligned on a 4 bytes boundary which might causes errors in regmap operations.
Maybe the intention behind of using the 0xff value was to indicate that the register is not implemented in the PLL, but this is not verified anywhere in the code. Moreover, this value is not used even in other register offset arrays despite that those PLLs also have unimplemented registers.
Additionally, on the Stromer PLLs the current code only touches the CONFIG_CTL_U register if the result of pll_has_64bit_config() is true which condition is not affected by the change.
Due to the reasons above, simply remove the CONFIG_CTL_U entry from the Stromer specific array.
--- drivers/clk/qcom/clk-alpha-pll.c | 1 - 1 file changed, 1 deletion(-)
drivers/clk/qcom/clk-alpha-pll.c +0 -1
@@ -212,7 +212,6 @@ const u8 clk_alpha_pll_regs[][PLL_OFF_MAX_REGS] = { [PLL_OFF_USER_CTL] = 0x18, [PLL_OFF_USER_CTL_U] = 0x1c, [PLL_OFF_CONFIG_CTL] = 0x20, - [PLL_OFF_CONFIG_CTL_U] = 0xff, [PLL_OFF_TEST_CTL] = 0x30, [PLL_OFF_TEST_CTL_U] = 0x34, [PLL_OFF_STATUS] = 0x28,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 348/744 RDMA/rxe: Fix seg fault in rxe_comp_queue_pkt
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bob Pearson <[email protected]>
[ Upstream commit 2b23b6097303ed0ba5f4bc036a1c07b6027af5c6 ]
In rxe_comp_queue_pkt() an incoming response packet skb is enqueued to the resp_pkts queue and then a decision is made whether to run the completer task inline or schedule it. Finally the skb is dereferenced to bump a 'hw' performance counter. This is wrong because if the completer task is already running in a separate thread it may have already processed the skb and freed it which can cause a seg fault. This has been observed infrequently in testing at high scale.
This patch fixes this by changing the order of enqueuing the packet until after the counter is accessed.
--- drivers/infiniband/sw/rxe/rxe_comp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/infiniband/sw/rxe/rxe_comp.c +3 -3
@@ -131,12 +131,12 @@ void rxe_comp_queue_pkt(struct rxe_qp *qp, struct sk_buff *skb) {int must_sched; -skb_queue_tail (&qp->resp_pkts, skb); - - must_sched =skb_queue_len (&qp->resp_pkts) >1 ; + must_sched =skb_queue_len (&qp->resp_pkts) >0 ;if (must_sched !=0 )rxe_counter_inc (SKB_TO_PKT (skb)->rxe,RXE_CNT_COMPLETER_SCHED ); +skb_queue_tail (&qp->resp_pkts, skb); +if (must_sched)rxe_sched_task (&qp->comp.task);else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 349/744 RDMA/rxe: Allow good work requests to be executed
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bob Pearson <[email protected]>
[ Upstream commit b703374837a8f8422fa3f1edcf65505421a65a6a ]
A previous commit incorrectly added an 'if(!err)' before scheduling the requester task in rxe_post_send_kernel(). But if there were send wrs successfully added to the send queue before a bad wr they might never get executed.
This commit fixes this by scheduling the requester task if any wqes were successfully posted in rxe_post_send_kernel() in rxe_verbs.c.
--- drivers/infiniband/sw/rxe/rxe_verbs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/infiniband/sw/rxe/rxe_verbs.c +5 -1
@@ -888,6 +888,7 @@ static int rxe_post_send_kernel(struct rxe_qp *qp, {int err =0 ;unsigned long flags; +int good =0 ;spin_lock_irqsave (&qp->sq.sq_lock, flags);while (ibwr) {
@@ -895,12 +896,15 @@ static int rxe_post_send_kernel(struct rxe_qp *qp,if (err) { *bad_wr = ibwr;break ; + }else { + good++; } ibwr = ibwr->next; }spin_unlock_irqrestore (&qp->sq.sq_lock, flags); -if (!err) +/* kickoff processing of any posted wqes */ +if (good)rxe_sched_task (&qp->req.task);spin_lock_irqsave (&qp->state_lock, flags);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 350/744 RDMA/rxe: Fix incorrect rxe_put in error path
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bob Pearson <[email protected]>
[ Upstream commit 8776618dbbd1b6f210b31509507e1aad461d6435 ]
In rxe_send() a ref is taken on the qp to keep it alive until the kfree_skb() has a chance to call the skb destructor rxe_skb_tx_dtor() which drops the reference. If the packet has an incorrect protocol the error path just calls kfree_skb() which will call the destructor which will drop the ref. Currently the driver also calls rxe_put() which is incorrect. Additionally since the packets sent to rxe_send() are under the control of the driver and it only ever produces IPV4 or IPV6 packets the simplest fix is to remove all the code in this block.
--- drivers/infiniband/sw/rxe/rxe_net.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-)
drivers/infiniband/sw/rxe/rxe_net.c +2 -10
@@ -366,18 +366,10 @@ static int rxe_send(struct sk_buff *skb, struct rxe_pkt_info *pkt)rxe_get (pkt->qp);atomic_inc (&pkt->qp->skb_out); -if (skb->protocol ==htons (ETH_P_IP )) { +if (skb->protocol ==htons (ETH_P_IP )) err =ip_local_out (dev_net (skb_dst (skb)->dev), skb->sk, skb); - }else if (skb->protocol ==htons (ETH_P_IPV6 )) { +else err =ip6_local_out (dev_net (skb_dst (skb)->dev), skb->sk, skb); - }else { -rxe_dbg_qp (pkt->qp,"Unknown layer 3 protocol: %d\n" , - skb->protocol); -atomic_dec (&pkt->qp->skb_out); -rxe_put (pkt->qp); -kfree_skb (skb); -return -EINVAL ; - }if (unlikely (net_xmit_eval (err))) {rxe_dbg_qp (pkt->qp,"error sending packet: %d\n" , err);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 351/744 IB/mlx5: Use __iowrite64_copy() for write combining stores
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jason Gunthorpe <[email protected]>
[ Upstream commit ef302283ddfceaba2657923af3f90fd58e6dff06 ]
mlx5 has a built in self-test at driver startup to evaluate if the platform supports write combining to generate a 64 byte PCIe TLP or not. This has proven necessary because a lot of common scenarios end up with broken write combining (especially inside virtual machines) and there is other way to learn this information.
This self test has been consistently failing on new ARM64 CPU designs (specifically with NVIDIA Grace's implementation of Neoverse V2). The C loop around writeq() generates some pretty terrible ARM64 assembly, but historically this has worked on a lot of existing ARM64 CPUs till now.
We see it succeed about 1 time in 10,000 on the worst effected systems. The CPU architects speculate that the load instructions interspersed with the stores makes the WC buffers statistically flush too often and thus the generation of large TLPs becomes infrequent. This makes the boot up test unreliable in that it indicates no write-combining, however userspace would be fine since it uses a ST4 instruction.
Further, S390 has similar issues where only the special zpci_memcpy_toio() will actually generate large TLPs, and the open coded loop does not trigger it at all.
Fix both ARM64 and S390 by switching to __iowrite64_copy() which now provides architecture specific variants that have a high change of generating a large TLP with write combining. x86 continues to use a similar writeq loop in the generate __iowrite64_copy().
--- drivers/infiniband/hw/mlx5/mem.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/infiniband/hw/mlx5/mem.c +3 -5
@@ -30,6 +30,7 @@* SOFTWARE. */ +#include <linux/io.h> #include <rdma/ib_umem_odp.h> #include "mlx5_ib.h" #include <linux/jiffies.h>
@@ -108,7 +109,6 @@ static int post_send_nop(struct mlx5_ib_dev *dev, struct ib_qp *ibqp, u64 wr_id,__be32 mmio_wqe[16 ] = {};unsigned long flags;unsigned int idx; -int i;if (unlikely (dev->mdev->state ==MLX5_DEVICE_STATE_INTERNAL_ERROR ))return -EIO ;
@@ -148,10 +148,8 @@ static int post_send_nop(struct mlx5_ib_dev *dev, struct ib_qp *ibqp, u64 wr_id,* we hit doorbell */ wmb (); -for (i =0 ; i <8 ; i++) -mlx5_write64 (&mmio_wqe[i *2 ], - bf->bfreg->map + bf->offset + i *8 ); -io_stop_wc (); +__iowrite64_copy (bf->bfreg->map + bf->offset, mmio_wqe, +sizeof (mmio_wqe) /8 ); bf->offset ^= bf->buf_size;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 352/744 clk: renesas: r8a779a0: Fix CANFD parent clock
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 3b23118bdbd898dc2f4de8f549d598d492c42ba8 ]
According to Figure 52A.1 ("RS-CANFD Module Block Diagram (in classical CAN mode)") in the R-Car V3U Series User’s Manual Rev. 0.5, the parent clock for the CANFD peripheral module clock is the S3D2 clock.
--- drivers/clk/renesas/r8a779a0-cpg-mssr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/renesas/r8a779a0-cpg-mssr.c +1 -1
@@ -139,7 +139,7 @@ static const struct mssr_mod_clk r8a779a0_mod_clks[] __initconst = {DEF_MOD ("avb3" ,214 ,R8A779A0_CLK_S3D2 ),DEF_MOD ("avb4" ,215 ,R8A779A0_CLK_S3D2 ),DEF_MOD ("avb5" ,216 ,R8A779A0_CLK_S3D2 ), -DEF_MOD ("canfd0" ,328 ,R8A779A0_CLK_CANFD ), +DEF_MOD ("canfd0" ,328 ,R8A779A0_CLK_S3D2 ),DEF_MOD ("csi40" ,331 ,R8A779A0_CLK_CSI0 ),DEF_MOD ("csi41" ,400 ,R8A779A0_CLK_CSI0 ), DEF_MOD("csi42", 401, R8A779A0_CLK_CSI0),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 353/744 clk: renesas: r9a07g043: Add clock and reset entry for PLIC
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lad Prabhakar <[email protected]>
[ Upstream commit 44019387fce230beda35b83da3a2c9fc5787704e ]
Add the missing clock and reset entry for PLIC. Also add R9A07G043_NCEPLIC_ACLK to the critical clocks list.
--- drivers/clk/renesas/r9a07g043-cpg.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/clk/renesas/r9a07g043-cpg.c +9 -0
@@ -250,6 +250,10 @@ static struct rzg2l_mod_clk r9a07g043_mod_clks[] = { 0x5a8, 1), DEF_MOD("tsu_pclk", R9A07G043_TSU_PCLK, R9A07G043_CLK_TSU, 0x5ac, 0), +#ifdef CONFIG_RISCV + DEF_MOD("nceplic_aclk", R9A07G043_NCEPLIC_ACLK, R9A07G043_CLK_P1, + 0x608, 0), +#endif };static struct rzg2l_reset r9a07g043_resets[] = {
@@ -303,6 +307,10 @@ static struct rzg2l_reset r9a07g043_resets[] = {DEF_RST (R9A07G043_ADC_PRESETN ,0x8a8 ,0 ),DEF_RST (R9A07G043_ADC_ADRST_N ,0x8a8 ,1 ),DEF_RST (R9A07G043_TSU_PRESETN ,0x8ac ,0 ), +#ifdef CONFIG_RISCV + DEF_RST(R9A07G043_NCEPLIC_ARESETN, 0x908, 0), +#endif + }; static const unsigned int r9a07g043_crit_mod_clks[] __initconst = {
@@ -312,6 +320,7 @@ static const unsigned int r9a07g043_crit_mod_clks[] __initconst = {#endif #ifdef CONFIG_RISCV MOD_CLK_BASE +R9A07G043_IAX45_CLK , +MOD_CLK_BASE +R9A07G043_NCEPLIC_ACLK , #endif MOD_CLK_BASE + R9A07G043_DMAC_ACLK, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 354/744 lib/test_hmm.c: handle src_pfns and dst_pfns allocation failure
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Duoming Zhou <[email protected]>
[ Upstream commit c2af060d1c18beaec56351cf9c9bcbbc5af341a3 ]
The kcalloc() in dmirror_device_evict_chunk() will return null if the physical memory has run out. As a result, if src_pfns or dst_pfns is dereferenced, the null pointer dereference bug will happen.
Moreover, the device is going away. If the kcalloc() fails, the pages mapping a chunk could not be evicted. So add a __GFP_NOFAIL flag in kcalloc().
Finally, as there is no need to have physically contiguous memory, Switch kcalloc() to kvcalloc() in order to avoid failing allocations.
--- lib/test_hmm.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
lib/test_hmm.c +4 -4
@@ -1226,8 +1226,8 @@ static void dmirror_device_evict_chunk(struct dmirror_chunk *chunk)unsigned long *src_pfns;unsigned long *dst_pfns; - src_pfns =kcalloc (npages,sizeof (*src_pfns),GFP_KERNEL ); - dst_pfns =kcalloc (npages,sizeof (*dst_pfns),GFP_KERNEL ); + src_pfns =kvcalloc (npages,sizeof (*src_pfns),GFP_KERNEL | __GFP_NOFAIL); + dst_pfns =kvcalloc (npages,sizeof (*dst_pfns),GFP_KERNEL | __GFP_NOFAIL);migrate_device_range (src_pfns, start_pfn, npages);for (i =0 ; i < npages; i++) {
@@ -1250,8 +1250,8 @@ static void dmirror_device_evict_chunk(struct dmirror_chunk *chunk) }migrate_device_pages (src_pfns, dst_pfns, npages);migrate_device_finalize (src_pfns, dst_pfns, npages); -kfree (src_pfns); -kfree (dst_pfns); +kvfree (src_pfns); +kvfree (dst_pfns); }/* Removes free pages from the free list so they can't be re-allocated */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 355/744 clk: qcom: dispcc-sm8450: fix DisplayPort clocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit e801038a02ce1e8c652a0b668dd233a4ee48aeb7 ]
On SM8450 DisplayPort link clocks use frequency tables inherited from the vendor kernel, it is not applicable in the upstream kernel. Drop frequency tables and use clk_byte2_ops for those clocks.
This fixes frequency selection in the OPP core (which otherwise attempts
to use invalid 810 KHz as DP link rate), also fixing the following
message:
msm-dp-display ae90000.displayport-controller: _opp_config_clk_single: failed to set clock rate: -22
--- drivers/clk/qcom/dispcc-sm8450.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
drivers/clk/qcom/dispcc-sm8450.c +4 -16
@@ -309,26 +309,17 @@ static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = { }, }; -static const struct freq_tbl ftbl_disp_cc_mdss_dptx0_link_clk_src[] = { -F (162000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (270000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (540000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (810000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), - { } -}; -static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = { .cmd_rcgr =0x819c , .mnd_width =0 , .hid_width =5 , .parent_map = disp_cc_parent_map_3, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx0_link_clk_src" , .parent_data = disp_cc_parent_data_3, .num_parents =ARRAY_SIZE (disp_cc_parent_data_3), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
@@ -382,13 +373,12 @@ static struct clk_rcg2 disp_cc_mdss_dptx1_link_clk_src = { .mnd_width = 0, .hid_width = 5, .parent_map = disp_cc_parent_map_3, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx1_link_clk_src" , .parent_data = disp_cc_parent_data_3, .num_parents =ARRAY_SIZE (disp_cc_parent_data_3), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
@@ -442,13 +432,12 @@ static struct clk_rcg2 disp_cc_mdss_dptx2_link_clk_src = { .mnd_width = 0, .hid_width = 5, .parent_map = disp_cc_parent_map_3, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx2_link_clk_src" , .parent_data = disp_cc_parent_data_3, .num_parents =ARRAY_SIZE (disp_cc_parent_data_3), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
@@ -502,13 +491,12 @@ static struct clk_rcg2 disp_cc_mdss_dptx3_link_clk_src = { .mnd_width = 0, .hid_width = 5, .parent_map = disp_cc_parent_map_3, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx3_link_clk_src" , .parent_data = disp_cc_parent_data_3, .num_parents =ARRAY_SIZE (disp_cc_parent_data_3), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 356/744 clk: qcom: dispcc-sm6350: fix DisplayPort clocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit 1113501cfb46d5c0eb960f0a8a9f6c0f91dc6fb6 ]
On SM6350 DisplayPort link clocks use frequency tables inherited from the vendor kernel, it is not applicable in the upstream kernel. Drop frequency tables and use clk_byte2_ops for those clocks.
This fixes frequency selection in the OPP core (which otherwise attempts
to use invalid 810 KHz as DP link rate), also fixing the following
message:
msm-dp-display ae90000.displayport-controller: _opp_config_clk_single: failed to set clock rate: -22
--- drivers/clk/qcom/dispcc-sm6350.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-)
drivers/clk/qcom/dispcc-sm6350.c +1 -10
@@ -221,26 +221,17 @@ static struct clk_rcg2 disp_cc_mdss_dp_crypto_clk_src = { }, }; -static const struct freq_tbl ftbl_disp_cc_mdss_dp_link_clk_src[] = { -F (162000 ,P_DP_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (270000 ,P_DP_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (540000 ,P_DP_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (810000 ,P_DP_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), - { } -}; -static struct clk_rcg2 disp_cc_mdss_dp_link_clk_src = { .cmd_rcgr =0x10f8 , .mnd_width =0 , .hid_width =5 , .parent_map = disp_cc_parent_map_0, - .freq_tbl = ftbl_disp_cc_mdss_dp_link_clk_src, .clkr.hw.init = &(struct clk_init_data ){ .name ="disp_cc_mdss_dp_link_clk_src" , .parent_data = disp_cc_parent_data_0, .num_parents =ARRAY_SIZE (disp_cc_parent_data_0), .flags =CLK_SET_RATE_PARENT |CLK_GET_RATE_NOCACHE , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 357/744 clk: qcom: dispcc-sm8550: fix DisplayPort clocks
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dmitry Baryshkov <[email protected]>
[ Upstream commit e90b5139da8465a15c3820b4b67ca9468dce93b4 ]
On SM8550 DisplayPort link clocks use frequency tables inherited from the vendor kernel, it is not applicable in the upstream kernel. Drop frequency tables and use clk_byte2_ops for those clocks.
This fixes frequency selection in the OPP core (which otherwise attempts
to use invalid 810 KHz as DP link rate), also fixing the following
message:
msm-dp-display ae90000.displayport-controller: _opp_config_clk_single: failed to set clock rate: -22
--- drivers/clk/qcom/dispcc-sm8550.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-)
drivers/clk/qcom/dispcc-sm8550.c +4 -16
@@ -345,26 +345,17 @@ static struct clk_rcg2 disp_cc_mdss_dptx0_aux_clk_src = { }, }; -static const struct freq_tbl ftbl_disp_cc_mdss_dptx0_link_clk_src[] = { -F (162000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (270000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (540000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), -F (810000 ,P_DP0_PHY_PLL_LINK_CLK ,1 ,0 ,0 ), - { } -}; -static struct clk_rcg2 disp_cc_mdss_dptx0_link_clk_src = { .cmd_rcgr =0x8170 , .mnd_width =0 , .hid_width =5 , .parent_map = disp_cc_parent_map_7, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx0_link_clk_src" , .parent_data = disp_cc_parent_data_7, .num_parents =ARRAY_SIZE (disp_cc_parent_data_7), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
@@ -418,13 +409,12 @@ static struct clk_rcg2 disp_cc_mdss_dptx1_link_clk_src = { .mnd_width = 0, .hid_width = 5, .parent_map = disp_cc_parent_map_3, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx1_link_clk_src" , .parent_data = disp_cc_parent_data_3, .num_parents =ARRAY_SIZE (disp_cc_parent_data_3), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
@@ -478,13 +468,12 @@ static struct clk_rcg2 disp_cc_mdss_dptx2_link_clk_src = { .mnd_width = 0, .hid_width = 5, .parent_map = disp_cc_parent_map_3, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx2_link_clk_src" , .parent_data = disp_cc_parent_data_3, .num_parents =ARRAY_SIZE (disp_cc_parent_data_3), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
@@ -538,13 +527,12 @@ static struct clk_rcg2 disp_cc_mdss_dptx3_link_clk_src = { .mnd_width = 0, .hid_width = 5, .parent_map = disp_cc_parent_map_3, - .freq_tbl = ftbl_disp_cc_mdss_dptx0_link_clk_src, .clkr.hw.init = &(struct clk_init_data ) { .name ="disp_cc_mdss_dptx3_link_clk_src" , .parent_data = disp_cc_parent_data_3, .num_parents =ARRAY_SIZE (disp_cc_parent_data_3), .flags =CLK_SET_RATE_PARENT , - .ops = &clk_rcg2_ops, + .ops = &clk_byte2_ops, }, };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 358/744 clk: qcom: mmcc-msm8998: fix venus clock issue
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marc Gonzalez <[email protected]>
[ Upstream commit e20ae5ae9f0c843aded4f06f3d1cab7384789e92 ]
Right now, msm8998 video decoder (venus) is non-functional:
$ time mpv --hwdec=v4l2m2m-copy --vd-lavc-software-fallback=no --vo=null --no-audio --untimed --length=30 --quiet demo-480.webm
(+) Video --vid=1 (*) (vp9 854x480 29.970fps)
Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[ffmpeg/video] vp9_v4l2m2m: output VIDIOC_REQBUFS failed: Connection timed out
[ffmpeg/video] vp9_v4l2m2m: no v4l2 output context's buffers
[ffmpeg/video] vp9_v4l2m2m: can't configure decoder
Could not open codec.
Software decoding fallback is disabled.
Exiting... (Quit)Bryan O'Donoghue suggested the proper fix:
- Set required register offsets in venus GDSC structs.
- Set HW_CTRL flag.
$ time mpv --hwdec=v4l2m2m-copy --vd-lavc-software-fallback=no --vo=null --no-audio --untimed --length=30 --quiet demo-480.webm
(+) Video --vid=1 (*) (vp9 854x480 29.970fps)
Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
[ffmpeg/video] vp9_v4l2m2m: VIDIOC_G_FMT ioctl
[ffmpeg/video] vp9_v4l2m2m: VIDIOC_G_FMT ioctl
...
Using hardware decoding (v4l2m2m-copy).
VO: [null] 854x480 nv12
Exiting... (End of file)
real 0m3.315s
user 0m1.277s
sys 0m0.453sNOTES:
GDSC = Globally Distributed Switch Controller
Use same code as mmcc-msm8996 with:
s/venus_gdsc/video_top_gdsc/
s/venus_core0_gdsc/video_subcore0_gdsc/
s/venus_core1_gdsc/video_subcore1_gdsc/
https://git.codelinaro.org/clo/la/kernel/msm-4.4/-/blob/caf_migration/kernel.lnx.4.4.r38-rel/include/dt-bindings/clock/msm-clocks-hwio-8996.h
https://git.codelinaro.org/clo/la/kernel/msm-4.4/-/blob/caf_migration/kernel.lnx.4.4.r38-rel/include/dt-bindings/clock/msm-clocks-hwio-8998.h
0x1024 = MMSS_VIDEO GDSCR (undocumented)0x1028 = MMSS_VIDEO_CORE_CBCR0x1030 = MMSS_VIDEO_AHB_CBCR0x1034 = MMSS_VIDEO_AXI_CBCR0x1038 = MMSS_VIDEO_MAXI_CBCR0x1040 = MMSS_VIDEO_SUBCORE0 GDSCR (undocumented)0x1044 = MMSS_VIDEO_SUBCORE1 GDSCR (undocumented)0x1048 = MMSS_VIDEO_SUBCORE0_CBCR0x104c = MMSS_VIDEO_SUBCORE1_CBCR
--- drivers/clk/qcom/mmcc-msm8998.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/clk/qcom/mmcc-msm8998.c +8 -0
@@ -2535,6 +2535,8 @@ static struct clk_branch vmem_ahb_clk = {static struct gdsc video_top_gdsc = { .gdscr =0x1024 , + .cxcs = (unsigned int []){0x1028 ,0x1034 ,0x1038 }, + .cxc_count =3 , .pd = { .name ="video_top" , },
@@ -2543,20 +2545,26 @@ static struct gdsc video_top_gdsc = {static struct gdsc video_subcore0_gdsc = { .gdscr =0x1040 , + .cxcs = (unsigned int []){0x1048 }, + .cxc_count =1 , .pd = { .name ="video_subcore0" , }, .parent = &video_top_gdsc.pd, .pwrsts =PWRSTS_OFF_ON , + .flags =HW_CTRL , };static struct gdsc video_subcore1_gdsc = { .gdscr =0x1044 , + .cxcs = (unsigned int []){0x104c }, + .cxc_count =1 , .pd = { .name ="video_subcore1" , }, .parent = &video_top_gdsc.pd, .pwrsts =PWRSTS_OFF_ON , + .flags =HW_CTRL , };static struct gdsc mdss_gdsc = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 359/744 x86/insn: Fix PUSH instruction in x86 instruction decoder opcode map
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
[ Upstream commit 59162e0c11d7257cde15f907d19fefe26da66692 ]
The x86 instruction decoder is used not only for decoding kernel instructions. It is also used by perf uprobes (user space probes) and by perf tools Intel Processor Trace decoding. Consequently, it needs to support instructions executed by user space also.
Opcode 0x68 PUSH instruction is currently defined as 64-bit operand size only i.e. (d64). That was based on Intel SDM Opcode Map. However that is contradicted by the Instruction Set Reference section for PUSH in the same manual.
Remove 64-bit operand size only annotation from opcode 0x68 PUSH instruction.
Example:
$ cat pushw.s
.global _start
.text
_start:
pushw $0x1234
mov $0x1,%eax # system call number (sys_exit)
int $0x80
$ as -o pushw.o pushw.s
$ ld -s -o pushw pushw.o
$ objdump -d pushw | tail -4
0000000000401000 <.text>:
401000: 66 68 34 12 pushw $0x1234
401004: b8 01 00 00 00 mov $0x1,%eax
401009: cd 80 int $0x80
$ perf record -e intel_pt//u ./pushw
[ perf record: Woken up 1 times to write data ]
[ perf record: Captured and wrote 0.014 MB perf.data ]Before:
$ perf script --insn-trace=disasm
Warning:
1 instruction trace errors
pushw 10349 [000] 10586.869237014: 401000 [unknown] (/home/ahunter/git/misc/rtit-tests/pushw) pushw $0x1234
pushw 10349 [000] 10586.869237014: 401006 [unknown] (/home/ahunter/git/misc/rtit-tests/pushw) addb %al, (%rax)
pushw 10349 [000] 10586.869237014: 401008 [unknown] (/home/ahunter/git/misc/rtit-tests/pushw) addb %cl, %ch
pushw 10349 [000] 10586.869237014: 40100a [unknown] (/home/ahunter/git/misc/rtit-tests/pushw) addb $0x2e, (%rax)
instruction trace error type 1 time 10586.869237224 cpu 0 pid 10349 tid 10349 ip 0x40100d code 6: Trace doesn't match instructionAfter:
$ perf script --insn-trace=disasm
pushw 10349 [000] 10586.869237014: 401000 [unknown] (./pushw) pushw $0x1234
pushw 10349 [000] 10586.869237014: 401004 [unknown] (./pushw) movl $1, %eax--- arch/x86/lib/x86-opcode-map.txt | 2 +- tools/arch/x86/lib/x86-opcode-map.txt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/x86/lib/x86-opcode-map.txt +1 -1
@@ -148,7 +148,7 @@ AVXcode: 65: SEG=GS (Prefix) 66: Operand-Size (Prefix) 67: Address-Size (Prefix) -68: PUSH Iz (d64) +68: PUSH Iz 69: IMUL Gv,Ev,Iz 6a: PUSH Ib (d64) 6b: IMUL Gv,Ev,Ib
tools/arch/x86/lib/x86-opcode-map.txt +1 -1
@@ -148,7 +148,7 @@ AVXcode: 65: SEG=GS (Prefix) 66: Operand-Size (Prefix) 67: Address-Size (Prefix) -68: PUSH Iz (d64) +68: PUSH Iz 69: IMUL Gv,Ev,Iz 6a: PUSH Ib (d64) 6b: IMUL Gv,Ev,Ib
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 360/744 x86/insn: Add VEX versions of VPDPBUSD, VPDPBUSDS, VPDPWSSD and VPDPWSSDS
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Adrian Hunter <[email protected]>
[ Upstream commit b8000264348979b60dbe479255570a40e1b3a097 ]
The x86 instruction decoder is used not only for decoding kernel instructions. It is also used by perf uprobes (user space probes) and by perf tools Intel Processor Trace decoding. Consequently, it needs to support instructions executed by user space also.
Intel Architecture Instruction Set Extensions and Future Features manual number 319433-044 of May 2021, documented VEX versions of instructions VPDPBUSD, VPDPBUSDS, VPDPWSSD and VPDPWSSDS, but the opcode map has them listed as EVEX only.
Remove EVEX-only (ev) annotation from instructions VPDPBUSD, VPDPBUSDS, VPDPWSSD and VPDPWSSDS, which allows them to be decoded with either a VEX or EVEX prefix.
--- arch/x86/lib/x86-opcode-map.txt | 8 ++++---- tools/arch/x86/lib/x86-opcode-map.txt | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-)
arch/x86/lib/x86-opcode-map.txt +4 -4
@@ -698,10 +698,10 @@ AVXcode: 2 4d: vrcp14ss/d Vsd,Hpd,Wsd (66),(ev) 4e: vrsqrt14ps/d Vpd,Wpd (66),(ev) 4f: vrsqrt14ss/d Vsd,Hsd,Wsd (66),(ev) -50: vpdpbusd Vx,Hx,Wx (66),(ev) -51: vpdpbusds Vx,Hx,Wx (66),(ev) -52: vdpbf16ps Vx,Hx,Wx (F3),(ev) | vpdpwssd Vx,Hx,Wx (66),(ev) | vp4dpwssd Vdqq,Hdqq,Wdq (F2),(ev) -53: vpdpwssds Vx,Hx,Wx (66),(ev) | vp4dpwssds Vdqq,Hdqq,Wdq (F2),(ev) +50: vpdpbusd Vx,Hx,Wx (66) +51: vpdpbusds Vx,Hx,Wx (66) +52: vdpbf16ps Vx,Hx,Wx (F3),(ev) | vpdpwssd Vx,Hx,Wx (66) | vp4dpwssd Vdqq,Hdqq,Wdq (F2),(ev) +53: vpdpwssds Vx,Hx,Wx (66) | vp4dpwssds Vdqq,Hdqq,Wdq (F2),(ev) 54: vpopcntb/w Vx,Wx (66),(ev) 55: vpopcntd/q Vx,Wx (66),(ev) 58: vpbroadcastd Vx,Wx (66),(v)
tools/arch/x86/lib/x86-opcode-map.txt +4 -4
@@ -698,10 +698,10 @@ AVXcode: 2 4d: vrcp14ss/d Vsd,Hpd,Wsd (66),(ev) 4e: vrsqrt14ps/d Vpd,Wpd (66),(ev) 4f: vrsqrt14ss/d Vsd,Hsd,Wsd (66),(ev) -50: vpdpbusd Vx,Hx,Wx (66),(ev) -51: vpdpbusds Vx,Hx,Wx (66),(ev) -52: vdpbf16ps Vx,Hx,Wx (F3),(ev) | vpdpwssd Vx,Hx,Wx (66),(ev) | vp4dpwssd Vdqq,Hdqq,Wdq (F2),(ev) -53: vpdpwssds Vx,Hx,Wx (66),(ev) | vp4dpwssds Vdqq,Hdqq,Wdq (F2),(ev) +50: vpdpbusd Vx,Hx,Wx (66) +51: vpdpbusds Vx,Hx,Wx (66) +52: vdpbf16ps Vx,Hx,Wx (F3),(ev) | vpdpwssd Vx,Hx,Wx (66) | vp4dpwssd Vdqq,Hdqq,Wdq (F2),(ev) +53: vpdpwssds Vx,Hx,Wx (66) | vp4dpwssds Vdqq,Hdqq,Wdq (F2),(ev) 54: vpopcntb/w Vx,Wx (66),(ev) 55: vpopcntd/q Vx,Wx (66),(ev) 58: vpbroadcastd Vx,Wx (66),(v)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 361/744 ext4: avoid excessive credit estimate in ext4_tmpfile()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Kara <[email protected]>
[ Upstream commit 35a1f12f0ca857fee1d7a04ef52cbd5f1f84de13 ]
A user with minimum journal size (1024 blocks these days) complained about the following error triggered by generic/697 test in ext4_tmpfile():
run fstests generic/697 at 2024-02-28 05:34:46
JBD2: vfstest wants too many credits credits:260 rsv_credits:0 max:256 EXT4-fs error (device loop0) in __ext4_new_inode:1083: error 28
Indeed the credit estimate in ext4_tmpfile() is huge. EXT4_MAXQUOTAS_INIT_BLOCKS() is 219, then 10 credits from ext4_tmpfile() itself and then ext4_xattr_credits_for_new_inode() adds more credits needed for security attributes and ACLs. Now the EXT4_MAXQUOTAS_INIT_BLOCKS() is in fact unnecessary because we've already initialized quotas with dquot_init() shortly before and so EXT4_MAXQUOTAS_TRANS_BLOCKS() is enough (which boils down to 3 credits).
--- fs/ext4/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ext4/namei.c +1 -1
@@ -2901,7 +2901,7 @@ static int ext4_tmpfile(struct mnt_idmap *idmap, struct inode *dir, inode =ext4_new_inode_start_handle (idmap, dir, mode,NULL ,0 ,NULL ,EXT4_HT_DIR , -EXT4_MAXQUOTAS_INIT_BLOCKS (dir->i_sb) + +EXT4_MAXQUOTAS_TRANS_BLOCKS (dir->i_sb) +4 +EXT4_XATTR_TRANS_BLOCKS ); handle =ext4_journal_current_handle (); err =PTR_ERR (inode);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 362/744 virt: acrn: stop using follow_pfn
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
[ Upstream commit 1b265da7ea1e1ae997fa119c2846bb389eb39c6b ]
Patch series "remove follow_pfn".
This series open codes follow_pfn in the only remaining caller, although the code there remains questionable. It then also moves follow_phys into the only user and simplifies it a bit.
This patch (of 3):
Switch from follow_pfn to follow_pte so that we can get rid of follow_pfn. Note that this doesn't fix any of the pre-existing raciness and lack of permission checking in the code.
Stable-dep-of: 3d6586008f7b ("drivers/virt/acrn: fix PFNMAP PTE checks in acrn_vm_ram_map()")
--- drivers/virt/acrn/mm.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/virt/acrn/mm.c +8 -2
@@ -171,18 +171,24 @@ int acrn_vm_ram_map(struct acrn_vm *vm, struct acrn_vm_memmap *memmap)mmap_read_lock (current->mm); vma =vma_lookup (current->mm, memmap->vma_base);if (vma && ((vma->vm_flags &VM_PFNMAP ) !=0 )) { +spinlock_t *ptl; +pte_t *ptep; +if ((memmap->vma_base + memmap->len) > vma->vm_end) {mmap_read_unlock (current->mm);return -EINVAL ; } - ret =follow_pfn (vma, memmap->vma_base, &pfn); -mmap_read_unlock (current->mm); + ret =follow_pte (vma->vm_mm, memmap->vma_base, &ptep, &ptl);if (ret <0 ) { +mmap_read_unlock (current->mm);dev_dbg (acrn_dev.this_device,"Failed to lookup PFN at VMA:%pK.\n" , (void *)memmap->vma_base);return ret; } + pfn =pte_pfn (ptep_get (ptep)); +pte_unmap_unlock (ptep, ptl); +mmap_read_unlock (current->mm); return acrn_mm_region_add(vm, memmap->user_vm_pa, PFN_PHYS(pfn), memmap->len,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 363/744 drivers/virt/acrn: fix PFNMAP PTE checks in acrn_vm_ram_map()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Hildenbrand <[email protected]>
[ Upstream commit 3d6586008f7b638f91f3332602592caa8b00b559 ]
Patch series "mm: follow_pte() improvements and acrn follow_pte() fixes".
Patch #1 fixes a bunch of issues I spotted in the acrn driver. It compiles, that's all I know. I'll appreciate some review and testing from acrn folks.
Patch #2+#3 improve follow_pte(), passing a VMA instead of the MM, adding more sanity checks, and improving the documentation. Gave it a quick test on x86-64 using VM_PAT that ends up using follow_pte().
This patch (of 3):
We currently miss handling various cases, resulting in a dangerous follow_pte() (previously follow_pfn()) usage.
(1) We're not checking PTE write permissions.
Maybe we should simply always require pte_write() like we do for pin_user_pages_fast(FOLL_WRITE)? Hard to tell, so let's check for ACRN_MEM_ACCESS_WRITE for now.
(2) We're not rejecting refcounted pages.
As we are not using MMU notifiers, messing with refcounted pages is dangerous and can result in use-after-free. Let's make sure to reject them.
(3) We are only looking at the first PTE of a bigger range.
We only lookup a single PTE, but memmap->len may span a larger area. Let's loop over all involved PTEs and make sure the PFN range is actually contiguous. Reject everything else: it couldn't have worked either way, and rather made use access PFNs we shouldn't be accessing.
--- drivers/virt/acrn/mm.c | 63 +++++++++++++++++++++++++++++++----------- 1 file changed, 47 insertions(+), 16 deletions(-)
drivers/virt/acrn/mm.c +47 -16
@@ -155,23 +155,29 @@ int acrn_vm_memseg_unmap(struct acrn_vm *vm, struct acrn_vm_memmap *memmap)int acrn_vm_ram_map (struct acrn_vm *vm,struct acrn_vm_memmap *memmap) {struct vm_memory_region_batch *regions_info; -int nr_pages, i =0 , order, nr_regions =0 ; +int nr_pages, i, order, nr_regions =0 ;struct vm_memory_mapping *region_mapping;struct vm_memory_region_op *vm_region;struct page **pages =NULL , *page;void *remap_vaddr;int ret, pinned;u64 user_vm_pa; -unsigned long pfn;struct vm_area_struct *vma;if (!vm || !memmap)return -EINVAL ; +/* Get the page number of the map region */ + nr_pages = memmap->len >>PAGE_SHIFT ; +if (!nr_pages) +return -EINVAL ; +mmap_read_lock (current->mm); vma =vma_lookup (current->mm, memmap->vma_base);if (vma && ((vma->vm_flags &VM_PFNMAP ) !=0 )) { +unsigned long start_pfn, cur_pfn;spinlock_t *ptl; +bool writable;pte_t *ptep;if ((memmap->vma_base + memmap->len) > vma->vm_end) {
@@ -179,25 +185,53 @@ int acrn_vm_ram_map(struct acrn_vm *vm, struct acrn_vm_memmap *memmap)return -EINVAL ; } - ret =follow_pte (vma->vm_mm, memmap->vma_base, &ptep, &ptl); -if (ret <0 ) { -mmap_read_unlock (current->mm); +for (i =0 ; i < nr_pages; i++) { + ret =follow_pte (vma->vm_mm, + memmap->vma_base + i *PAGE_SIZE , + &ptep, &ptl); +if (ret) +break ; + + cur_pfn =pte_pfn (ptep_get (ptep)); +if (i ==0 ) + start_pfn = cur_pfn; + writable = !!pte_write (ptep_get (ptep)); +pte_unmap_unlock (ptep, ptl); + +/* Disallow write access if the PTE is not writable. */ +if (!writable && + (memmap->attr &ACRN_MEM_ACCESS_WRITE )) { + ret = -EFAULT ; +break ; + } + +/* Disallow refcounted pages. */ +if (pfn_valid (cur_pfn) && + !PageReserved (pfn_to_page (cur_pfn))) { + ret = -EFAULT ; +break ; + } + +/* Disallow non-contiguous ranges. */ +if (cur_pfn != start_pfn + i) { + ret = -EINVAL ; +break ; + } + } +mmap_read_unlock (current->mm); + +if (ret) {dev_dbg (acrn_dev.this_device,"Failed to lookup PFN at VMA:%pK.\n" , (void *)memmap->vma_base);return ret; } - pfn =pte_pfn (ptep_get (ptep)); -pte_unmap_unlock (ptep, ptl); -mmap_read_unlock (current->mm);return acrn_mm_region_add (vm, memmap->user_vm_pa, -PFN_PHYS (pfn), memmap->len, +PFN_PHYS (start_pfn), memmap->len,ACRN_MEM_TYPE_WB , memmap->attr); }mmap_read_unlock (current->mm); -/* Get the page number of the map region */ - nr_pages = memmap->len >>PAGE_SHIFT ; pages =vzalloc (array_size (nr_pages,sizeof (*pages)));if (!pages)return -ENOMEM ;
@@ -241,12 +275,11 @@ int acrn_vm_ram_map(struct acrn_vm *vm, struct acrn_vm_memmap *memmap)mutex_unlock (&vm->regions_mapping_lock);/* Calculate count of vm_memory_region_op */ -while (i < nr_pages) { +for (i =0 ; i < nr_pages; i +=1 << order) { page = pages[i];VM_BUG_ON_PAGE (PageTail (page), page); order =compound_order (page); nr_regions++; - i +=1 << order; }/* Prepare the vm_memory_region_batch */
@@ -263,8 +296,7 @@ int acrn_vm_ram_map(struct acrn_vm *vm, struct acrn_vm_memmap *memmap) regions_info->regions_num = nr_regions; regions_info->regions_gpa =virt_to_phys (vm_region); user_vm_pa = memmap->user_vm_pa; - i =0 ; -while (i < nr_pages) { +for (i =0 ; i < nr_pages; i +=1 << order) {u32 region_size; page = pages[i];
@@ -280,7 +312,6 @@ int acrn_vm_ram_map(struct acrn_vm *vm, struct acrn_vm_memmap *memmap) vm_region++; user_vm_pa += region_size; - i +=1 << order; }/* Inform the ACRN Hypervisor to set up EPT mappings */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 364/744 sunrpc: removed redundant procp check
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksandr Aprelkov <[email protected]>
[ Upstream commit a576f36971ab4097b6aa76433532aa1fb5ee2d3b ]
since vs_proc pointer is dereferenced before getting it's address there's no need to check for NULL.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- net/sunrpc/svc.c | 2 -- 1 file changed, 2 deletions(-)
net/sunrpc/svc.c +0 -2
@@ -1265,8 +1265,6 @@ svc_generic_init_request(struct svc_rqst *rqstp,if (rqstp->rq_proc >= versp->vs_nproc) goto err_bad_proc; rqstp->rq_procinfo = procp = &versp->vs_proc[rqstp->rq_proc]; -if (!procp) - goto err_bad_proc;/* Initialize storage for argp and resp */ memset (rqstp->rq_argp,0 , procp->pc_argzero);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 365/744 ext4: fix potential unnitialized variable
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
[ Upstream commit 3f4830abd236d0428e50451e1ecb62e14c365e9b ]
Smatch complains "err" can be uninitialized in the caller.
fs/ext4/indirect.c:349 ext4_alloc_branch()
error: uninitialized symbol 'err'.
Set the error to zero on the success path.
--- fs/ext4/mballoc.c | 1 + 1 file changed, 1 insertion(+)
fs/ext4/mballoc.c +1 -0
@@ -6144,6 +6144,7 @@ ext4_mb_new_blocks_simple(struct ext4_allocation_request *ar, int *errp)ext4_mb_mark_bb (sb, block,1 ,1 ); ar->len =1 ; + *errp =0 ;return block; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 366/744 ext4: remove the redundant folio_wait_stable()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Yi <[email protected]>
[ Upstream commit df0b5afc62f3368d657a8fe4a8d393ac481474c2 ]
__filemap_get_folio() with FGP_WRITEBEGIN parameter has already wait for stable folio, so remove the redundant folio_wait_stable() in ext4_da_write_begin(), it was left over from the commit cc883236b792 ("ext4: drop unnecessary journal handle in delalloc write") that removed the retry getting page logic.
--- fs/ext4/inode.c | 3 --- 1 file changed, 3 deletions(-)
fs/ext4/inode.c +0 -3
@@ -2895,9 +2895,6 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping,if (IS_ERR (folio))return PTR_ERR (folio); -/* In case writeback began while the folio was unlocked */ -folio_wait_stable (folio); -#ifdef CONFIG_FS_ENCRYPTION ret =ext4_block_write_begin (folio, pos, len, ext4_da_get_block_prep);#else
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 367/744 of: module: add buffer overflow check in of_modalias()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sergey Shtylyov <[email protected]>
[ Upstream commit cf7385cb26ac4f0ee6c7385960525ad534323252 ]
In of_modalias(), if the buffer happens to be too small even for the 1st snprintf() call, the len parameter will become negative and str parameter (if not NULL initially) will point beyond the buffer's end. Add the buffer overflow check after the 1st snprintf() call and fix such check after the strlen() call (accounting for the terminating NUL char).
--- drivers/of/module.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/of/module.c +4 -3
@@ -29,14 +29,15 @@ ssize_t of_modalias(const struct device_node *np, char *str, ssize_t len) csize =snprintf (str, len,"of:N%pOFn%c%s" , np,'T' ,of_node_get_device_type (np)); tsize = csize; +if (csize >= len) + csize = len >0 ? len -1 :0 ; len -= csize; -if (str) - str += csize; + str += csize;of_property_for_each_string (np,"compatible" , p, compat) { csize =strlen (compat) +1 ; tsize += csize; -if (csize > len) +if (csize >= len)continue ; csize =snprintf (str, len,"C%s" , compat);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 368/744 RDMA/bnxt_re: Refactor the queue index update
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandramohan Akula <[email protected]>
[ Upstream commit 3a4304d82695015d0703ee0c3331458d22e3ba7c ]
The queue index wrap around logic is based on power of 2 size depth. All queues are created with power of 2 depth. This increases the memory usage by the driver. This change is required for the next patches that avoids the power of 2 depth requirement for each of the queues.
Update the function that increments producer index and consumer index during wrap around. Also, changes the index handling across multiple functions.
Stable-dep-of: 78cfd17142ef ("bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq")
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 138 ++++++++++----------- drivers/infiniband/hw/bnxt_re/qplib_fp.h | 20 ++- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 17 ++- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 4 +- drivers/infiniband/hw/bnxt_re/qplib_res.c | 2 +- drivers/infiniband/hw/bnxt_re/qplib_res.h | 37 ++++-- 6 files changed, 123 insertions(+), 95 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +69 -69
@@ -237,18 +237,15 @@ static void clean_nq(struct bnxt_qplib_nq *nq, struct bnxt_qplib_cq *cq)struct bnxt_qplib_hwq *hwq = &nq->hwq;struct nq_base *nqe, **nq_ptr;int budget = nq->budget; -u32 sw_cons, raw_cons;uintptr_t q_handle;u16 type;spin_lock_bh (&hwq->lock);/* Service the NQ until empty */ - raw_cons = hwq->cons;while (budget--) { - sw_cons =HWQ_CMP (raw_cons, hwq); nq_ptr = (struct nq_base **)hwq->pbl_ptr; - nqe = &nq_ptr[NQE_PG (sw_cons)][NQE_IDX (sw_cons)]; -if (!NQE_CMP_VALID (nqe, raw_cons, hwq->max_elements)) + nqe = &nq_ptr[NQE_PG (hwq->cons)][NQE_IDX (hwq->cons)]; +if (!NQE_CMP_VALID (nqe, nq->nq_db.dbinfo.flags))break ;/*
@@ -276,7 +273,8 @@ static void clean_nq(struct bnxt_qplib_nq *nq, struct bnxt_qplib_cq *cq)default :break ; } - raw_cons++; +bnxt_qplib_hwq_incr_cons (hwq->max_elements, &hwq->cons, +1 , &nq->nq_db.dbinfo.flags); }spin_unlock_bh (&hwq->lock); }
@@ -302,18 +300,16 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t)struct bnxt_qplib_hwq *hwq = &nq->hwq;struct bnxt_qplib_cq *cq;int budget = nq->budget; -u32 sw_cons, raw_cons;struct nq_base *nqe;uintptr_t q_handle; +u32 hw_polled =0 ;u16 type;spin_lock_bh (&hwq->lock);/* Service the NQ until empty */ - raw_cons = hwq->cons;while (budget--) { - sw_cons =HWQ_CMP (raw_cons, hwq); - nqe =bnxt_qplib_get_qe (hwq, sw_cons,NULL ); -if (!NQE_CMP_VALID (nqe, raw_cons, hwq->max_elements)) + nqe =bnxt_qplib_get_qe (hwq, hwq->cons,NULL ); +if (!NQE_CMP_VALID (nqe, nq->nq_db.dbinfo.flags))break ;/*
@@ -372,12 +368,12 @@ static void bnxt_qplib_service_nq(struct tasklet_struct *t) "nqe with type = 0x%x not handled\n", type);break ; } - raw_cons++; + hw_polled++; +bnxt_qplib_hwq_incr_cons (hwq->max_elements, &hwq->cons, +1 , &nq->nq_db.dbinfo.flags); } -if (hwq->cons != raw_cons) { - hwq->cons = raw_cons; +if (hw_polled)bnxt_qplib_ring_nq_db (&nq->nq_db.dbinfo, nq->res->cctx, true); - }spin_unlock_bh (&hwq->lock); }
@@ -505,6 +501,7 @@ static int bnxt_qplib_map_nq_db(struct bnxt_qplib_nq *nq, u32 reg_offt) pdev = nq->pdev; nq_db = &nq->nq_db; + nq_db->dbinfo.flags =0 ; nq_db->reg.bar_id =NQ_CONS_PCI_BAR_REGION ; nq_db->reg.bar_base =pci_resource_start (pdev, nq_db->reg.bar_id);if (!nq_db->reg.bar_base) {
@@ -649,7 +646,7 @@ int bnxt_qplib_create_srq(struct bnxt_qplib_res *res, rc = -ENOMEM ; goto fail; } - + srq->dbinfo.flags =0 ;bnxt_qplib_rcfw_cmd_prep ((struct cmdq_base *)&req,CMDQ_BASE_OPCODE_CREATE_SRQ ,sizeof (req));
@@ -703,13 +700,9 @@ int bnxt_qplib_modify_srq(struct bnxt_qplib_res *res, struct bnxt_qplib_srq *srq) {struct bnxt_qplib_hwq *srq_hwq = &srq->hwq; -u32 sw_prod, sw_cons, count =0 ; - - sw_prod =HWQ_CMP (srq_hwq->prod, srq_hwq); - sw_cons =HWQ_CMP (srq_hwq->cons, srq_hwq); +u32 count; - count = sw_prod > sw_cons ? sw_prod - sw_cons : - srq_hwq->max_elements - sw_cons + sw_prod; + count =__bnxt_qplib_get_avail (srq_hwq);if (count > srq->threshold) { srq->arm_req = false;bnxt_qplib_srq_arm_db (&srq->dbinfo, srq->threshold);
@@ -762,7 +755,7 @@ int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq,struct bnxt_qplib_hwq *srq_hwq = &srq->hwq;struct rq_wqe *srqe;struct sq_sge *hw_sge; -u32 sw_prod, sw_cons, count =0 ; +u32 count =0 ;int i, next;spin_lock (&srq_hwq->lock);
@@ -776,8 +769,7 @@ int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq, srq->start_idx = srq->swq[next].next_idx;spin_unlock (&srq_hwq->lock); - sw_prod =HWQ_CMP (srq_hwq->prod, srq_hwq); - srqe =bnxt_qplib_get_qe (srq_hwq, sw_prod,NULL ); + srqe =bnxt_qplib_get_qe (srq_hwq, srq_hwq->prod,NULL );memset (srqe,0 , srq->wqe_size);/* Calculate wqe_size16 and data_len */ for (i = 0, hw_sge = (struct sq_sge *)srqe->data;
@@ -793,17 +785,10 @@ int bnxt_qplib_post_srq_recv(struct bnxt_qplib_srq *srq, srqe->wr_id[0 ] =cpu_to_le32 ((u32 )next); srq->swq[next].wr_id = wqe->wr_id; - srq_hwq->prod++; +bnxt_qplib_hwq_incr_prod (&srq->dbinfo, srq_hwq, srq->dbinfo.max_slot);spin_lock (&srq_hwq->lock); - sw_prod =HWQ_CMP (srq_hwq->prod, srq_hwq); -/* retaining srq_hwq->cons for this logic -* actually the lock is only required to -* read srq_hwq->cons. -*/ - sw_cons =HWQ_CMP (srq_hwq->cons, srq_hwq); - count = sw_prod > sw_cons ? sw_prod - sw_cons : - srq_hwq->max_elements - sw_cons + sw_prod; + count =__bnxt_qplib_get_avail (srq_hwq);spin_unlock (&srq_hwq->lock);/* Ring DB */ bnxt_qplib_ring_prod_db (&srq->dbinfo,DBC_DBC_TYPE_SRQ );
@@ -850,6 +835,7 @@ int bnxt_qplib_create_qp1(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)u32 tbl_indx;int rc; + sq->dbinfo.flags =0 ;bnxt_qplib_rcfw_cmd_prep ((struct cmdq_base *)&req,CMDQ_BASE_OPCODE_CREATE_QP1 ,sizeof (req));
@@ -886,6 +872,7 @@ int bnxt_qplib_create_qp1(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)/* RQ */ if (rq->max_wqe) { + rq->dbinfo.flags =0 ; hwq_attr.res = res; hwq_attr.sginfo = &rq->sg_info; hwq_attr.stride =sizeof (struct sq_sge );
@@ -993,6 +980,7 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)u32 tbl_indx;u16 nsge; + sq->dbinfo.flags =0 ;bnxt_qplib_rcfw_cmd_prep ((struct cmdq_base *)&req,CMDQ_BASE_OPCODE_CREATE_QP ,sizeof (req));
@@ -1041,6 +1029,7 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)/* RQ */ if (!qp->srq) { + rq->dbinfo.flags =0 ; hwq_attr.res = res; hwq_attr.sginfo = &rq->sg_info; hwq_attr.stride =sizeof (struct sq_sge );
@@ -1455,12 +1444,15 @@ int bnxt_qplib_query_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)static void __clean_cq (struct bnxt_qplib_cq *cq,u64 qp) {struct bnxt_qplib_hwq *cq_hwq = &cq->hwq; +u32 peek_flags, peek_cons;struct cq_base *hw_cqe;int i; + peek_flags = cq->dbinfo.flags; + peek_cons = cq_hwq->cons;for (i =0 ; i < cq_hwq->max_elements; i++) { - hw_cqe =bnxt_qplib_get_qe (cq_hwq, i,NULL ); -if (!CQE_CMP_VALID (hw_cqe, i, cq_hwq->max_elements)) + hw_cqe =bnxt_qplib_get_qe (cq_hwq, peek_cons,NULL ); +if (!CQE_CMP_VALID (hw_cqe, peek_flags))continue ;/* * The valid test of the entry must be done first before
@@ -1490,6 +1482,8 @@ static void __clean_cq(struct bnxt_qplib_cq *cq, u64 qp)default :break ; } +bnxt_qplib_hwq_incr_cons (cq_hwq->max_elements, &peek_cons, +1 , &peek_flags); } }
@@ -1962,7 +1956,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp,bnxt_qplib_fill_psn_search (qp, wqe, swq); queue_err:bnxt_qplib_swq_mod_start (sq, wqe_idx); -bnxt_qplib_hwq_incr_prod (hwq, swq->slots); +bnxt_qplib_hwq_incr_prod (&sq->dbinfo, hwq, swq->slots); qp->wqe_cnt++; done:if (sch_handler) {
@@ -2050,7 +2044,7 @@ int bnxt_qplib_post_recv(struct bnxt_qplib_qp *qp, base_hdr->wr_id[0 ] =cpu_to_le32 (wqe_idx); queue_err:bnxt_qplib_swq_mod_start (rq, wqe_idx); -bnxt_qplib_hwq_incr_prod (hwq, swq->slots); +bnxt_qplib_hwq_incr_prod (&rq->dbinfo, hwq, swq->slots); done:if (sch_handler) { nq_work =kzalloc (sizeof (*nq_work),GFP_ATOMIC );
@@ -2087,6 +2081,7 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq)return -EINVAL ; } + cq->dbinfo.flags =0 ; hwq_attr.res = res; hwq_attr.depth = cq->max_wqe; hwq_attr.stride =sizeof (struct cq_base );
@@ -2102,7 +2097,7 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) req.dpi =cpu_to_le32 (cq->dpi->dpi); req.cq_handle =cpu_to_le64 (cq->cq_handle); - req.cq_size =cpu_to_le32 (cq->hwq.max_elements); + req.cq_size =cpu_to_le32 (cq->max_wqe); pbl = &cq->hwq.pbl[PBL_LVL_0 ]; pg_sz_lvl = (bnxt_qplib_base_pg_size (&cq->hwq) <<CMDQ_CREATE_CQ_PG_SIZE_SFT );
@@ -2145,6 +2140,8 @@ void bnxt_qplib_resize_cq_complete(struct bnxt_qplib_res *res, {bnxt_qplib_free_hwq (res, &cq->hwq);memcpy (&cq->hwq, &cq->resize_hwq,sizeof (cq->hwq)); +/* Reset only the cons bit in the flags */ + cq->dbinfo.flags &= ~(1UL <<BNXT_QPLIB_FLAG_EPOCH_CONS_SHIFT ); } int bnxt_qplib_resize_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq,
@@ -2241,7 +2238,8 @@ static int __flush_sq(struct bnxt_qplib_q *sq, struct bnxt_qplib_qp *qp, cqe++; (*budget)--; skip_compl: -bnxt_qplib_hwq_incr_cons (&sq->hwq, sq->swq[last].slots); +bnxt_qplib_hwq_incr_cons (sq->hwq.max_elements, &sq->hwq.cons, + sq->swq[last].slots, &sq->dbinfo.flags); sq->swq_last = sq->swq[last].next_idx; } *pcqe = cqe;
@@ -2288,7 +2286,8 @@ static int __flush_rq(struct bnxt_qplib_q *rq, struct bnxt_qplib_qp *qp, cqe->wr_id = rq->swq[last].wr_id; cqe++; (*budget)--; -bnxt_qplib_hwq_incr_cons (&rq->hwq, rq->swq[last].slots); +bnxt_qplib_hwq_incr_cons (rq->hwq.max_elements, &rq->hwq.cons, + rq->swq[last].slots, &rq->dbinfo.flags); rq->swq_last = rq->swq[last].next_idx; } *pcqe = cqe;
@@ -2317,7 +2316,7 @@ void bnxt_qplib_mark_qp_error(void *qp_handle)static int do_wa9060 (struct bnxt_qplib_qp *qp,struct bnxt_qplib_cq *cq,u32 cq_cons,u32 swq_last,u32 cqe_sq_cons) { -u32 peek_sw_cq_cons, peek_raw_cq_cons, peek_sq_cons_idx; +u32 peek_sw_cq_cons, peek_sq_cons_idx, peek_flags;struct bnxt_qplib_q *sq = &qp->sq;struct cq_req *peek_req_hwcqe;struct bnxt_qplib_qp *peek_qp;
@@ -2348,16 +2347,14 @@ static int do_wa9060(struct bnxt_qplib_qp *qp, struct bnxt_qplib_cq *cq, }if (sq->condition) {/* Peek at the completions */ - peek_raw_cq_cons = cq->hwq.cons; + peek_flags = cq->dbinfo.flags; peek_sw_cq_cons = cq_cons; i = cq->hwq.max_elements;while (i--) { - peek_sw_cq_cons =HWQ_CMP ((peek_sw_cq_cons), &cq->hwq); peek_hwcqe =bnxt_qplib_get_qe (&cq->hwq, peek_sw_cq_cons,NULL );/* If the next hwcqe is VALID */ -if (CQE_CMP_VALID (peek_hwcqe, peek_raw_cq_cons, - cq->hwq.max_elements)) { +if (CQE_CMP_VALID (peek_hwcqe, peek_flags)) {/* * The valid test of the entry must be done first before * reading any further.
@@ -2400,8 +2397,9 @@ static int do_wa9060(struct bnxt_qplib_qp *qp, struct bnxt_qplib_cq *cq, rc = -EINVAL ; goto out; } - peek_sw_cq_cons++; - peek_raw_cq_cons++; +bnxt_qplib_hwq_incr_cons (cq->hwq.max_elements, + &peek_sw_cq_cons, +1 , &peek_flags); } dev_err(&cq->hwq.pdev->dev, "Should not have come here! cq_cons=0x%x qp=0x%x sq cons sw=0x%x hw=0x%x\n",
@@ -2488,7 +2486,8 @@ static int bnxt_qplib_cq_process_req(struct bnxt_qplib_cq *cq, } } skip: -bnxt_qplib_hwq_incr_cons (&sq->hwq, swq->slots); +bnxt_qplib_hwq_incr_cons (sq->hwq.max_elements, &sq->hwq.cons, + swq->slots, &sq->dbinfo.flags); sq->swq_last = swq->next_idx;if (sq->single)break ;
@@ -2515,7 +2514,8 @@ static void bnxt_qplib_release_srqe(struct bnxt_qplib_srq *srq, u32 tag) srq->swq[srq->last_idx].next_idx = (int )tag; srq->last_idx = (int )tag; srq->swq[srq->last_idx].next_idx =-1 ; - srq->hwq.cons++;/* Support for SRQE counter */ +bnxt_qplib_hwq_incr_cons (srq->hwq.max_elements, &srq->hwq.cons, + srq->dbinfo.max_slot, &srq->dbinfo.flags);spin_unlock (&srq->hwq.lock); }
@@ -2584,7 +2584,8 @@ static int bnxt_qplib_cq_process_res_rc(struct bnxt_qplib_cq *cq, cqe->wr_id = swq->wr_id; cqe++; (*budget)--; -bnxt_qplib_hwq_incr_cons (&rq->hwq, swq->slots); +bnxt_qplib_hwq_incr_cons (rq->hwq.max_elements, &rq->hwq.cons, + swq->slots, &rq->dbinfo.flags); rq->swq_last = swq->next_idx; *pcqe = cqe;
@@ -2670,7 +2671,8 @@ static int bnxt_qplib_cq_process_res_ud(struct bnxt_qplib_cq *cq, cqe->wr_id = swq->wr_id; cqe++; (*budget)--; -bnxt_qplib_hwq_incr_cons (&rq->hwq, swq->slots); +bnxt_qplib_hwq_incr_cons (rq->hwq.max_elements, &rq->hwq.cons, + swq->slots, &rq->dbinfo.flags); rq->swq_last = swq->next_idx; *pcqe = cqe;
@@ -2687,14 +2689,11 @@ static int bnxt_qplib_cq_process_res_ud(struct bnxt_qplib_cq *cq,bool bnxt_qplib_is_cq_empty (struct bnxt_qplib_cq *cq) {struct cq_base *hw_cqe; -u32 sw_cons, raw_cons;bool rc = true; - raw_cons = cq->hwq.cons; - sw_cons =HWQ_CMP (raw_cons, &cq->hwq); - hw_cqe =bnxt_qplib_get_qe (&cq->hwq, sw_cons,NULL ); + hw_cqe =bnxt_qplib_get_qe (&cq->hwq, cq->hwq.cons,NULL );/* Check for Valid bit. If the CQE is valid, return false */ - rc = !CQE_CMP_VALID (hw_cqe, raw_cons, cq->hwq.max_elements); + rc = !CQE_CMP_VALID (hw_cqe, cq->dbinfo.flags);return rc; }
@@ -2776,7 +2775,8 @@ static int bnxt_qplib_cq_process_res_raweth_qp1(struct bnxt_qplib_cq *cq, cqe->wr_id = swq->wr_id; cqe++; (*budget)--; -bnxt_qplib_hwq_incr_cons (&rq->hwq, swq->slots); +bnxt_qplib_hwq_incr_cons (rq->hwq.max_elements, &rq->hwq.cons, + swq->slots, &rq->dbinfo.flags); rq->swq_last = swq->next_idx; *pcqe = cqe;
@@ -2849,7 +2849,8 @@ static int bnxt_qplib_cq_process_terminal(struct bnxt_qplib_cq *cq, cqe++; (*budget)--; } -bnxt_qplib_hwq_incr_cons (&sq->hwq, sq->swq[swq_last].slots); +bnxt_qplib_hwq_incr_cons (sq->hwq.max_elements, &sq->hwq.cons, + sq->swq[swq_last].slots, &sq->dbinfo.flags); sq->swq_last = sq->swq[swq_last].next_idx; } *pcqe = cqe;
@@ -2934,19 +2935,17 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe, int num_cqes, struct bnxt_qplib_qp **lib_qp) { struct cq_base *hw_cqe; -u32 sw_cons, raw_cons;int budget, rc =0 ; +u32 hw_polled =0 ;u8 type; - raw_cons = cq->hwq.cons; budget = num_cqes;while (budget) { - sw_cons =HWQ_CMP (raw_cons, &cq->hwq); - hw_cqe =bnxt_qplib_get_qe (&cq->hwq, sw_cons,NULL ); + hw_cqe =bnxt_qplib_get_qe (&cq->hwq, cq->hwq.cons,NULL );/* Check for Valid bit */ -if (!CQE_CMP_VALID (hw_cqe, raw_cons, cq->hwq.max_elements)) +if (!CQE_CMP_VALID (hw_cqe, cq->dbinfo.flags))break ;/*
@@ -2961,7 +2960,7 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe, rc =bnxt_qplib_cq_process_req (cq, (struct cq_req *)hw_cqe, &cqe, &budget, - sw_cons, lib_qp); + cq->hwq.cons, lib_qp);break ;case CQ_BASE_CQE_TYPE_RES_RC : rc = bnxt_qplib_cq_process_res_rc(cq,
@@ -3007,12 +3006,13 @@ int bnxt_qplib_poll_cq(struct bnxt_qplib_cq *cq, struct bnxt_qplib_cqe *cqe,dev_err (&cq->hwq.pdev->dev,"process_cqe error rc = 0x%x\n" , rc); } - raw_cons++; + hw_polled++; +bnxt_qplib_hwq_incr_cons (cq->hwq.max_elements, &cq->hwq.cons, +1 , &cq->dbinfo.flags); + } -if (cq->hwq.cons != raw_cons) { - cq->hwq.cons = raw_cons; +if (hw_polled)bnxt_qplib_ring_db (&cq->dbinfo,DBC_DBC_TYPE_CQ ); - } exit:return num_cqes - budget; }
drivers/infiniband/hw/bnxt_re/qplib_fp.h +16 -4
@@ -348,9 +348,21 @@ struct bnxt_qplib_qp {#define CQE_IDX (x) ((x) & CQE_MAX_IDX_PER_PG)#define ROCE_CQE_CMP_V 0 -#define CQE_CMP_VALID (hdr, raw_cons, cp_bit) \ +#define CQE_CMP_VALID (hdr, pass) \ (!!((hdr)->cqe_type_toggle & CQ_BASE_TOGGLE) == \ - !((raw_cons) & (cp_bit))) + !((pass) & BNXT_QPLIB_FLAG_EPOCH_CONS_MASK)) + +static inline u32 __bnxt_qplib_get_avail (struct bnxt_qplib_hwq *hwq) +{ +int cons, prod, avail; + + cons = hwq->cons; + prod = hwq->prod; + avail = cons - prod; +if (cons <= prod) + avail += hwq->depth; +return avail; +}static inline bool bnxt_qplib_queue_full (struct bnxt_qplib_q *que,u8 slots)
@@ -443,9 +455,9 @@ struct bnxt_qplib_cq {#define NQE_PG (x) (((x) & ~NQE_MAX_IDX_PER_PG) / NQE_CNT_PER_PG)#define NQE_IDX (x) ((x) & NQE_MAX_IDX_PER_PG) -#define NQE_CMP_VALID (hdr, raw_cons, cp_bit) \ +#define NQE_CMP_VALID (hdr, pass) \ (!!(le32_to_cpu((hdr)->info63_v[0]) & NQ_BASE_V) == \ - !((raw_cons) & (cp_bit))) + !((pass) & BNXT_QPLIB_FLAG_EPOCH_CONS_MASK))#define BNXT_QPLIB_NQE_MAX_CNT (128 * 1024)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +8 -9
@@ -734,17 +734,15 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t)u32 type, budget =CREQ_ENTRY_POLL_BUDGET ;struct bnxt_qplib_hwq *hwq = &creq->hwq;struct creq_base *creqe; -u32 sw_cons, raw_cons;unsigned long flags;u32 num_wakeup =0 ; +u32 hw_polled =0 ;/* Service the CREQ until budget is over */ spin_lock_irqsave (&hwq->lock, flags); - raw_cons = hwq->cons;while (budget >0 ) { - sw_cons =HWQ_CMP (raw_cons, hwq); - creqe =bnxt_qplib_get_qe (hwq, sw_cons,NULL ); -if (!CREQ_CMP_VALID (creqe, raw_cons, hwq->max_elements)) + creqe =bnxt_qplib_get_qe (hwq, hwq->cons,NULL ); +if (!CREQ_CMP_VALID (creqe, creq->creq_db.dbinfo.flags))break ;/* The valid test of the entry must be done first before * reading any further.
@@ -775,15 +773,15 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t) type);break ; } - raw_cons++; budget--; + hw_polled++; +bnxt_qplib_hwq_incr_cons (hwq->max_elements, &hwq->cons, +1 , &creq->creq_db.dbinfo.flags); } -if (hwq->cons != raw_cons) { - hwq->cons = raw_cons; +if (hw_polled)bnxt_qplib_ring_nq_db (&creq->creq_db.dbinfo, rcfw->res->cctx, true); - }spin_unlock_irqrestore (&hwq->lock, flags);if (num_wakeup)wake_up_nr (&rcfw->cmdq.waitq, num_wakeup);
@@ -1113,6 +1111,7 @@ static int bnxt_qplib_map_creq_db(struct bnxt_qplib_rcfw *rcfw, u32 reg_offt) pdev = rcfw->pdev; creq_db = &rcfw->creq.creq_db; + creq_db->dbinfo.flags =0 ; creq_db->reg.bar_id =RCFW_COMM_CONS_PCI_BAR_REGION ; creq_db->reg.bar_base =pci_resource_start (pdev, creq_db->reg.bar_id);if (!creq_db->reg.bar_id)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +2 -2
@@ -141,9 +141,9 @@ struct bnxt_qplib_crsbe {/* Allocate 1 per QP for async error notification for now */ #define BNXT_QPLIB_CREQE_MAX_CNT (64 * 1024)#define BNXT_QPLIB_CREQE_UNITS 16/* 16-Bytes per prod unit */ -#define CREQ_CMP_VALID (hdr, raw_cons, cp_bit) \ +#define CREQ_CMP_VALID (hdr, pass) \ (!!((hdr)->v & CREQ_BASE_V) == \ - !((raw_cons) & (cp_bit))) + !((pass) & BNXT_QPLIB_FLAG_EPOCH_CONS_MASK))#define CREQ_ENTRY_POLL_BUDGET 0x100/* HWQ */
drivers/infiniband/hw/bnxt_re/qplib_res.c +1 -1
@@ -343,7 +343,7 @@ int bnxt_qplib_alloc_init_hwq(struct bnxt_qplib_hwq *hwq, hwq->cons =0 ; hwq->pdev = pdev; hwq->depth = hwq_attr->depth; - hwq->max_elements = depth; + hwq->max_elements = hwq->depth; hwq->element_size = stride; hwq->qe_ppg = pg_size / stride;/* For direct access to the elements */
drivers/infiniband/hw/bnxt_re/qplib_res.h +27 -10
@@ -186,6 +186,14 @@ struct bnxt_qplib_db_info {struct bnxt_qplib_hwq *hwq;u32 xid;u32 max_slot; +u32 flags; +}; + +enum bnxt_qplib_db_info_flags_mask { +BNXT_QPLIB_FLAG_EPOCH_CONS_SHIFT =0x0UL , +BNXT_QPLIB_FLAG_EPOCH_PROD_SHIFT =0x1UL , +BNXT_QPLIB_FLAG_EPOCH_CONS_MASK =0x1UL , +BNXT_QPLIB_FLAG_EPOCH_PROD_MASK =0x2UL , };/* Tables */
@@ -396,24 +404,34 @@ void bnxt_qplib_unmap_db_bar(struct bnxt_qplib_res *res);int bnxt_qplib_determine_atomics (struct pci_dev *dev); -static inline void bnxt_qplib_hwq_incr_prod (struct bnxt_qplib_hwq *hwq,u32 cnt) +static inline void bnxt_qplib_hwq_incr_prod (struct bnxt_qplib_db_info *dbinfo, +struct bnxt_qplib_hwq *hwq,u32 cnt) { - hwq->prod = (hwq->prod + cnt) % hwq->depth; +/* move prod and update toggle/epoch if wrap around */ + hwq->prod += cnt; +if (hwq->prod >= hwq->depth) { + hwq->prod %= hwq->depth; + dbinfo->flags ^=1UL <<BNXT_QPLIB_FLAG_EPOCH_PROD_SHIFT ; + } } -static inline void bnxt_qplib_hwq_incr_cons (struct bnxt_qplib_hwq *hwq, -u32 cnt) +static inline void bnxt_qplib_hwq_incr_cons (u32 max_elements,u32 *cons,u32 cnt, +u32 *dbinfo_flags) { - hwq->cons = (hwq->cons + cnt) % hwq->depth; +/* move cons and update toggle/epoch if wrap around */ + *cons += cnt; +if (*cons >= max_elements) { + *cons %= max_elements; + *dbinfo_flags ^=1UL <<BNXT_QPLIB_FLAG_EPOCH_CONS_SHIFT ; + } }static inline void bnxt_qplib_ring_db32 (struct bnxt_qplib_db_info *info,bool arm) { -u32 key; +u32 key =0 ; - key = info->hwq->cons & (info->hwq->max_elements -1 ); - key |= (CMPL_DOORBELL_IDX_VALID | + key |= info->hwq->cons | (CMPL_DOORBELL_IDX_VALID | (CMPL_DOORBELL_KEY_CMPL &CMPL_DOORBELL_KEY_MASK ));if (!arm) key |=CMPL_DOORBELL_MASK ;
@@ -427,8 +445,7 @@ static inline void bnxt_qplib_ring_db(struct bnxt_qplib_db_info *info, key = (info->xid &DBC_DBC_XID_MASK ) |DBC_DBC_PATH_ROCE | type; key <<=32 ; - key |= (info->hwq->cons & (info->hwq->max_elements -1 )) & -DBC_DBC_INDEX_MASK ; + key |= (info->hwq->cons &DBC_DBC_INDEX_MASK );writeq (key, info->db); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 369/744 RDMA/bnxt_re: Remove roundup_pow_of_two depth for all hardware queue resources
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chandramohan Akula <[email protected]>
[ Upstream commit 48f996d4adf15a0a0af8b8184d3ec6042a684ea4 ]
Rounding up the queue depth to power of two is not a hardware requirement. In order to optimize the per connection memory usage, removing drivers implementation which round up to the queue depths to the power of 2.
Implements a mask to maintain backward compatibility with older library.
Stable-dep-of: 78cfd17142ef ("bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq")
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 57 ++++++++++++++++-------- drivers/infiniband/hw/bnxt_re/ib_verbs.h | 7 +++ include/uapi/rdma/bnxt_re-abi.h | 9 ++++ 3 files changed, 54 insertions(+), 19 deletions(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +38 -19
@@ -1184,7 +1184,8 @@ static struct bnxt_re_qp *bnxt_re_create_shadow_qp }static int bnxt_re_init_rq_attr (struct bnxt_re_qp *qp, -struct ib_qp_init_attr *init_attr) +struct ib_qp_init_attr *init_attr, +struct bnxt_re_ucontext *uctx) {struct bnxt_qplib_dev_attr *dev_attr;struct bnxt_qplib_qp *qplqp;
@@ -1213,7 +1214,7 @@ static int bnxt_re_init_rq_attr(struct bnxt_re_qp *qp,/* Allocate 1 more than what's provided so posting max doesn't * mean empty. */ - entries =roundup_pow_of_two (init_attr->cap.max_recv_wr +1 ); + entries =bnxt_re_init_depth (init_attr->cap.max_recv_wr +1 , uctx); rq->max_wqe =min_t (u32, entries, dev_attr->max_qp_wqes +1 ); rq->q_full_delta =0 ; rq->sg_info.pgsize =PAGE_SIZE ;
@@ -1243,7 +1244,7 @@ static void bnxt_re_adjust_gsi_rq_attr(struct bnxt_re_qp *qp)static int bnxt_re_init_sq_attr (struct bnxt_re_qp *qp,struct ib_qp_init_attr *init_attr, -struct ib_udata *udata) +struct bnxt_re_ucontext *uctx) {struct bnxt_qplib_dev_attr *dev_attr;struct bnxt_qplib_qp *qplqp;
@@ -1272,7 +1273,7 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp,/* Allocate 128 + 1 more than what's provided */ diff = (qplqp->wqe_mode ==BNXT_QPLIB_WQE_MODE_VARIABLE ) ?0 :BNXT_QPLIB_RESERVED_QP_WRS ; - entries =roundup_pow_of_two (entries + diff +1 ); + entries =bnxt_re_init_depth (entries + diff +1 , uctx); sq->max_wqe =min_t (u32, entries, dev_attr->max_qp_wqes + diff +1 ); sq->q_full_delta = diff +1 ;/*
@@ -1288,7 +1289,8 @@ static int bnxt_re_init_sq_attr(struct bnxt_re_qp *qp, }static void bnxt_re_adjust_gsi_sq_attr (struct bnxt_re_qp *qp, -struct ib_qp_init_attr *init_attr) +struct ib_qp_init_attr *init_attr, +struct bnxt_re_ucontext *uctx) {struct bnxt_qplib_dev_attr *dev_attr;struct bnxt_qplib_qp *qplqp;
@@ -1300,7 +1302,7 @@ static void bnxt_re_adjust_gsi_sq_attr(struct bnxt_re_qp *qp, dev_attr = &rdev->dev_attr;if (!bnxt_qplib_is_chip_gen_p5 (rdev->chip_ctx)) { - entries =roundup_pow_of_two (init_attr->cap.max_send_wr +1 ); + entries =bnxt_re_init_depth (init_attr->cap.max_send_wr +1 , uctx); qplqp->sq.max_wqe =min_t (u32, entries, dev_attr->max_qp_wqes +1 ); qplqp->sq.q_full_delta = qplqp->sq.max_wqe -
@@ -1338,6 +1340,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd, struct ib_udata *udata) {struct bnxt_qplib_dev_attr *dev_attr; +struct bnxt_re_ucontext *uctx;struct bnxt_qplib_qp *qplqp;struct bnxt_re_dev *rdev;struct bnxt_re_cq *cq;
@@ -1347,6 +1350,7 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd, qplqp = &qp->qplib_qp; dev_attr = &rdev->dev_attr; + uctx = rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, ib_uctx);/* Setup misc params */ ether_addr_copy (qplqp->smac, rdev->netdev->dev_addr); qplqp->pd = &pd->qplib_pd;
@@ -1388,18 +1392,18 @@ static int bnxt_re_init_qp_attr(struct bnxt_re_qp *qp, struct bnxt_re_pd *pd, }/* Setup RQ/SRQ */ - rc =bnxt_re_init_rq_attr (qp, init_attr); + rc =bnxt_re_init_rq_attr (qp, init_attr, uctx);if (rc) goto out;if (init_attr->qp_type ==IB_QPT_GSI )bnxt_re_adjust_gsi_rq_attr (qp);/* Setup SQ */ - rc =bnxt_re_init_sq_attr (qp, init_attr, udata); + rc =bnxt_re_init_sq_attr (qp, init_attr, uctx);if (rc) goto out;if (init_attr->qp_type ==IB_QPT_GSI ) -bnxt_re_adjust_gsi_sq_attr (qp, init_attr); +bnxt_re_adjust_gsi_sq_attr (qp, init_attr, uctx);if (udata)/* This will update DPI and qp_handle */ rc =bnxt_re_init_user_qp (rdev, pd, qp, udata);
@@ -1715,6 +1719,7 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq, {struct bnxt_qplib_dev_attr *dev_attr;struct bnxt_qplib_nq *nq =NULL ; +struct bnxt_re_ucontext *uctx;struct bnxt_re_dev *rdev;struct bnxt_re_srq *srq;struct bnxt_re_pd *pd;
@@ -1739,13 +1744,14 @@ int bnxt_re_create_srq(struct ib_srq *ib_srq, goto exit; } + uctx = rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, ib_uctx); srq->rdev = rdev; srq->qplib_srq.pd = &pd->qplib_pd; srq->qplib_srq.dpi = &rdev->dpi_privileged;/* Allocate 1 more than what's provided so posting max doesn't * mean empty */ - entries =roundup_pow_of_two (srq_init_attr->attr.max_wr +1 ); + entries =bnxt_re_init_depth (srq_init_attr->attr.max_wr +1 , uctx);if (entries > dev_attr->max_srq_wqes +1 ) entries = dev_attr->max_srq_wqes +1 ; srq->qplib_srq.max_wqe = entries;
@@ -2102,6 +2108,9 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, qp->qplib_qp.max_dest_rd_atomic = qp_attr->max_dest_rd_atomic; }if (qp_attr_mask &IB_QP_CAP ) { +struct bnxt_re_ucontext *uctx = + rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, ib_uctx); + qp->qplib_qp.modify_flags |=CMDQ_MODIFY_QP_MODIFY_MASK_SQ_SIZE | CMDQ_MODIFY_QP_MODIFY_MASK_RQ_SIZE |
@@ -2118,7 +2127,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, "Create QP failed - max exceeded");return -EINVAL ; } - entries =roundup_pow_of_two (qp_attr->cap.max_send_wr); + entries =bnxt_re_init_depth (qp_attr->cap.max_send_wr, uctx); qp->qplib_qp.sq.max_wqe =min_t (u32, entries, dev_attr->max_qp_wqes +1 ); qp->qplib_qp.sq.q_full_delta = qp->qplib_qp.sq.max_wqe -
@@ -2131,7 +2140,7 @@ int bnxt_re_modify_qp(struct ib_qp *ib_qp, struct ib_qp_attr *qp_attr, qp->qplib_qp.sq.q_full_delta -=1 ; qp->qplib_qp.sq.max_sge = qp_attr->cap.max_send_sge;if (qp->qplib_qp.rq.max_wqe) { - entries =roundup_pow_of_two (qp_attr->cap.max_recv_wr); + entries =bnxt_re_init_depth (qp_attr->cap.max_recv_wr, uctx); qp->qplib_qp.rq.max_wqe =min_t (u32, entries, dev_attr->max_qp_wqes +1 ); qp->qplib_qp.rq.q_full_delta = qp->qplib_qp.rq.max_wqe -
@@ -2919,9 +2928,11 @@ int bnxt_re_destroy_cq(struct ib_cq *ib_cq, struct ib_udata *udata)int bnxt_re_create_cq (struct ib_cq *ibcq,const struct ib_cq_init_attr *attr,struct ib_udata *udata) { + struct bnxt_re_cq *cq = container_of(ibcq, struct bnxt_re_cq, ib_cq);struct bnxt_re_dev *rdev =to_bnxt_re_dev (ibcq->device, ibdev); +struct bnxt_re_ucontext *uctx = + rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, ib_uctx);struct bnxt_qplib_dev_attr *dev_attr = &rdev->dev_attr; - struct bnxt_re_cq *cq = container_of(ibcq, struct bnxt_re_cq, ib_cq);int rc, entries;int cqe = attr->cqe;struct bnxt_qplib_nq *nq =NULL ;
@@ -2940,7 +2951,7 @@ int bnxt_re_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, cq->rdev = rdev; cq->qplib_cq.cq_handle = (u64 )(unsigned long )(&cq->qplib_cq); - entries =roundup_pow_of_two (cqe +1 ); + entries =bnxt_re_init_depth (cqe +1 , uctx);if (entries > dev_attr->max_cq_wqes +1 ) entries = dev_attr->max_cq_wqes +1 ;
@@ -2948,8 +2959,6 @@ int bnxt_re_create_cq(struct ib_cq *ibcq, const struct ib_cq_init_attr *attr, cq->qplib_cq.sg_info.pgshft =PAGE_SHIFT ;if (udata) {struct bnxt_re_cq_req req; -struct bnxt_re_ucontext *uctx =rdma_udata_to_drv_context ( - udata, struct bnxt_re_ucontext, ib_uctx);if (ib_copy_from_udata (&req, udata,sizeof (req))) { rc = -EFAULT ; goto fail;
@@ -3071,12 +3080,11 @@ int bnxt_re_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)return -EINVAL ; } - entries =roundup_pow_of_two (cqe +1 ); + uctx = rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, ib_uctx); + entries =bnxt_re_init_depth (cqe +1 , uctx);if (entries > dev_attr->max_cq_wqes +1 ) entries = dev_attr->max_cq_wqes +1 ; - uctx = rdma_udata_to_drv_context(udata, struct bnxt_re_ucontext, - ib_uctx);/* uverbs consumer */ if (ib_copy_from_udata (&req, udata,sizeof (req))) { rc = -EFAULT ;
@@ -4107,6 +4115,7 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ib_udata *udata)struct bnxt_qplib_dev_attr *dev_attr = &rdev->dev_attr;struct bnxt_re_user_mmap_entry *entry;struct bnxt_re_uctx_resp resp = {}; +struct bnxt_re_uctx_req ureq = {};u32 chip_met_rev_num =0 ;int rc;
@@ -4156,6 +4165,16 @@ int bnxt_re_alloc_ucontext(struct ib_ucontext *ctx, struct ib_udata *udata)if (rdev->pacing.dbr_pacing) resp.comp_mask |=BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED ; +if (udata->inlen >=sizeof (ureq)) { + rc =ib_copy_from_udata (&ureq, udata,min (udata->inlen,sizeof (ureq))); +if (rc) + goto cfail; +if (ureq.comp_mask &BNXT_RE_COMP_MASK_REQ_UCNTX_POW2_SUPPORT ) { + resp.comp_mask |=BNXT_RE_UCNTX_CMASK_POW2_DISABLED ; + uctx->cmask |=BNXT_RE_UCNTX_CMASK_POW2_DISABLED ; + } + } + rc =ib_copy_to_udata (udata, &resp,min (udata->outlen,sizeof (resp)));if (rc) {ibdev_err (ibdev,"Failed to copy user context" );
drivers/infiniband/hw/bnxt_re/ib_verbs.h +7 -0
@@ -140,6 +140,7 @@ struct bnxt_re_ucontext {void *shpg;spinlock_t sh_lock;/* protect shpg */ struct rdma_user_mmap_entry *shpage_mmap; +u64 cmask; };enum bnxt_re_mmap_flag {
@@ -167,6 +168,12 @@ static inline u16 bnxt_re_get_rwqe_size(int nsge)return sizeof (struct rq_wqe_hdr ) + (nsge *sizeof (struct sq_sge )); } +static inline u32 bnxt_re_init_depth (u32 ent,struct bnxt_re_ucontext *uctx) +{ +return uctx ? (uctx->cmask &BNXT_RE_UCNTX_CMASK_POW2_DISABLED ) ? + ent :roundup_pow_of_two (ent) : ent; +} +int bnxt_re_query_device (struct ib_device *ibdev,struct ib_device_attr *ib_attr,struct ib_udata *udata);
include/uapi/rdma/bnxt_re-abi.h +9 -0
@@ -54,6 +54,7 @@ enum {BNXT_RE_UCNTX_CMASK_HAVE_MODE =0x02ULL ,BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED =0x04ULL ,BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED =0x08ULL , + BNXT_RE_UCNTX_CMASK_POW2_DISABLED = 0x10ULL, }; enum bnxt_re_wqe_mode {
@@ -62,6 +63,14 @@ enum bnxt_re_wqe_mode { BNXT_QPLIB_WQE_MODE_INVALID = 0x02, }; +enum { +BNXT_RE_COMP_MASK_REQ_UCNTX_POW2_SUPPORT =0x01 , +}; + +struct bnxt_re_uctx_req { +__aligned_u64 comp_mask; +}; +struct bnxt_re_uctx_resp {__u32 dev_id;__u32 max_qp;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 370/744 RDMA/bnxt_re: Update the HW interface definitions
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <[email protected]>
[ Upstream commit 880a5dd1880a296575e92dec9816a7f35a7011d1 ]
Adds HW interface definitions to support the new
chip revision.
Stable-dep-of: 78cfd17142ef ("bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq")
--- drivers/infiniband/hw/bnxt_re/roce_hsi.h | 67 ++++++++++++++++++++---- 1 file changed, 57 insertions(+), 10 deletions(-)
drivers/infiniband/hw/bnxt_re/roce_hsi.h +57 -10
@@ -555,7 +555,12 @@ struct cmdq_modify_qp {__le16 flags;__le16 cookie;u8 resp_size; -u8 reserved8; +u8 qp_type; +#define CMDQ_MODIFY_QP_QP_TYPE_RC 0x2UL +#define CMDQ_MODIFY_QP_QP_TYPE_UD 0x4UL +#define CMDQ_MODIFY_QP_QP_TYPE_RAW_ETHERTYPE 0x6UL +#define CMDQ_MODIFY_QP_QP_TYPE_GSI 0x7UL +#define CMDQ_MODIFY_QP_QP_TYPE_LAST CMDQ_MODIFY_QP_QP_TYPE_GSI__le64 resp_addr;__le32 modify_mask;#define CMDQ_MODIFY_QP_MODIFY_MASK_STATE 0x1UL
@@ -611,14 +616,12 @@ struct cmdq_modify_qp {#define CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6 (0x3UL << 6)#define CMDQ_MODIFY_QP_NETWORK_TYPE_LAST CMDQ_MODIFY_QP_NETWORK_TYPE_ROCEV2_IPV6u8 access; -#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK \ - 0xffUL -#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT \ - 0 -#define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE 0x1UL -#define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE 0x2UL -#define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ 0x4UL -#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC 0x8UL +#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_MASK 0xffUL +#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC_REMOTE_READ_REMOTE_WRITE_LOCAL_WRITE_SFT 0 +#define CMDQ_MODIFY_QP_ACCESS_LOCAL_WRITE 0x1UL +#define CMDQ_MODIFY_QP_ACCESS_REMOTE_WRITE 0x2UL +#define CMDQ_MODIFY_QP_ACCESS_REMOTE_READ 0x4UL +#define CMDQ_MODIFY_QP_ACCESS_REMOTE_ATOMIC 0x8UL__le16 pkey;__le32 qkey;__le32 dgid[4 ];
@@ -673,6 +676,13 @@ struct cmdq_modify_qp {#define CMDQ_MODIFY_QP_VLAN_PCP_SFT 13__le64 irrq_addr;__le64 orrq_addr; +__le32 ext_modify_mask; +#define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_EXT_STATS_CTX 0x1UL +#define CMDQ_MODIFY_QP_EXT_MODIFY_MASK_SCHQ_ID_VALID 0x2UL +__le32 ext_stats_ctx_id; +__le16 schq_id; +__le16 unused_0; +__le32 reserved32; };/* creq_modify_qp_resp (size:128b/16B) */
@@ -3017,6 +3027,17 @@ struct sq_psn_search_ext {__le32 reserved32; }; +/* sq_msn_search (size:64b/8B) */ +struct sq_msn_search { +__le64 start_idx_next_psn_start_psn; +#define SQ_MSN_SEARCH_START_PSN_MASK 0xffffffUL +#define SQ_MSN_SEARCH_START_PSN_SFT 0 +#define SQ_MSN_SEARCH_NEXT_PSN_MASK 0xffffff000000ULL +#define SQ_MSN_SEARCH_NEXT_PSN_SFT 24 +#define SQ_MSN_SEARCH_START_IDX_MASK 0xffff000000000000ULL +#define SQ_MSN_SEARCH_START_IDX_SFT 48 +}; +/* sq_send (size:1024b/128B) */ struct sq_send {u8 wqe_type;
@@ -3705,13 +3726,35 @@ struct cq_base {#define CQ_BASE_CQE_TYPE_RES_UD (0x2UL << 1)#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1 (0x3UL << 1)#define CQ_BASE_CQE_TYPE_RES_UD_CFA (0x4UL << 1) +#define CQ_BASE_CQE_TYPE_REQ_V3 (0x8UL << 1) +#define CQ_BASE_CQE_TYPE_RES_RC_V3 (0x9UL << 1) +#define CQ_BASE_CQE_TYPE_RES_UD_V3 (0xaUL << 1) +#define CQ_BASE_CQE_TYPE_RES_RAWETH_QP1_V3 (0xbUL << 1) +#define CQ_BASE_CQE_TYPE_RES_UD_CFA_V3 (0xcUL << 1)#define CQ_BASE_CQE_TYPE_NO_OP (0xdUL << 1)#define CQ_BASE_CQE_TYPE_TERMINAL (0xeUL << 1)#define CQ_BASE_CQE_TYPE_CUT_OFF (0xfUL << 1)#define CQ_BASE_CQE_TYPE_LAST CQ_BASE_CQE_TYPE_CUT_OFFu8 status; +#define CQ_BASE_STATUS_OK 0x0UL +#define CQ_BASE_STATUS_BAD_RESPONSE_ERR 0x1UL +#define CQ_BASE_STATUS_LOCAL_LENGTH_ERR 0x2UL +#define CQ_BASE_STATUS_HW_LOCAL_LENGTH_ERR 0x3UL +#define CQ_BASE_STATUS_LOCAL_QP_OPERATION_ERR 0x4UL +#define CQ_BASE_STATUS_LOCAL_PROTECTION_ERR 0x5UL +#define CQ_BASE_STATUS_LOCAL_ACCESS_ERROR 0x6UL +#define CQ_BASE_STATUS_MEMORY_MGT_OPERATION_ERR 0x7UL +#define CQ_BASE_STATUS_REMOTE_INVALID_REQUEST_ERR 0x8UL +#define CQ_BASE_STATUS_REMOTE_ACCESS_ERR 0x9UL +#define CQ_BASE_STATUS_REMOTE_OPERATION_ERR 0xaUL +#define CQ_BASE_STATUS_RNR_NAK_RETRY_CNT_ERR 0xbUL +#define CQ_BASE_STATUS_TRANSPORT_RETRY_CNT_ERR 0xcUL +#define CQ_BASE_STATUS_WORK_REQUEST_FLUSHED_ERR 0xdUL +#define CQ_BASE_STATUS_HW_FLUSH_ERR 0xeUL +#define CQ_BASE_STATUS_OVERFLOW_ERR 0xfUL +#define CQ_BASE_STATUS_LAST CQ_BASE_STATUS_OVERFLOW_ERR__le16 reserved16; -__le32 reserved32; +__le32 opaque; };/* cq_req (size:256b/32B) */
@@ -4326,6 +4369,8 @@ struct cq_cutoff {#define CQ_CUTOFF_CQE_TYPE_SFT 1#define CQ_CUTOFF_CQE_TYPE_CUT_OFF (0xfUL << 1)#define CQ_CUTOFF_CQE_TYPE_LAST CQ_CUTOFF_CQE_TYPE_CUT_OFF +#define CQ_CUTOFF_RESIZE_TOGGLE_MASK 0x60UL +#define CQ_CUTOFF_RESIZE_TOGGLE_SFT 5u8 status;#define CQ_CUTOFF_STATUS_OK 0x0UL#define CQ_CUTOFF_STATUS_LAST CQ_CUTOFF_STATUS_OK
@@ -4377,6 +4422,8 @@ struct nq_srq_event {#define NQ_SRQ_EVENT_TYPE_SFT 0#define NQ_SRQ_EVENT_TYPE_SRQ_EVENT 0x32UL#define NQ_SRQ_EVENT_TYPE_LAST NQ_SRQ_EVENT_TYPE_SRQ_EVENT +#define NQ_SRQ_EVENT_TOGGLE_MASK 0xc0UL +#define NQ_SRQ_EVENT_TOGGLE_SFT 6u8 event;#define NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT 0x1UL#define NQ_SRQ_EVENT_EVENT_LAST NQ_SRQ_EVENT_EVENT_SRQ_THRESHOLD_EVENT
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 371/744 RDMA/bnxt_re: Adds MSN table capability for Gen P7 adapters
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Selvin Xavier <[email protected]>
[ Upstream commit 07f830ae4913d0b986c8c0ff88a7d597948b9bd8 ]
GenP7 HW expects an MSN table instead of PSN table. Check for the HW retransmission capability and populate the MSN table if HW retansmission is supported.
Stable-dep-of: 78cfd17142ef ("bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq")
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 67 ++++++++++++++++++++-- drivers/infiniband/hw/bnxt_re/qplib_fp.h | 14 +++++ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 2 + drivers/infiniband/hw/bnxt_re/qplib_res.h | 9 +++ include/uapi/rdma/bnxt_re-abi.h | 1 + 5 files changed, 87 insertions(+), 6 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +61 -6
@@ -980,6 +980,9 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp)u32 tbl_indx;u16 nsge; +if (res->dattr) + qp->dev_cap_flags = res->dattr->dev_cap_flags; + sq->dbinfo.flags =0 ; bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req, CMDQ_BASE_OPCODE_CREATE_QP,
@@ -995,6 +998,11 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) psn_sz =bnxt_qplib_is_chip_gen_p5 (res->cctx) ?sizeof (struct sq_psn_search_ext ) :sizeof (struct sq_psn_search ); + +if (BNXT_RE_HW_RETX (qp->dev_cap_flags)) { + psn_sz =sizeof (struct sq_msn_search ); + qp->msn =0 ; + } } hwq_attr.res = res;
@@ -1003,6 +1011,13 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) hwq_attr.depth =bnxt_qplib_get_depth (sq); hwq_attr.aux_stride = psn_sz; hwq_attr.aux_depth =bnxt_qplib_set_sq_size (sq, qp->wqe_mode); +/* Update msn tbl size */ +if (BNXT_RE_HW_RETX (qp->dev_cap_flags) && psn_sz) { + hwq_attr.aux_depth =roundup_pow_of_two (bnxt_qplib_set_sq_size (sq, qp->wqe_mode)); + qp->msn_tbl_sz = hwq_attr.aux_depth; + qp->msn =0 ; + } + hwq_attr.type =HWQ_TYPE_QUEUE ; rc =bnxt_qplib_alloc_init_hwq (&sq->hwq, &hwq_attr);if (rc)
@@ -1585,6 +1600,27 @@ void *bnxt_qplib_get_qp1_rq_buf(struct bnxt_qplib_qp *qp,return NULL ; } +/* Fil the MSN table into the next psn row */ +static void bnxt_qplib_fill_msn_search (struct bnxt_qplib_qp *qp, +struct bnxt_qplib_swqe *wqe, +struct bnxt_qplib_swq *swq) +{ +struct sq_msn_search *msns; +u32 start_psn, next_psn; +u16 start_idx; + + msns = (struct sq_msn_search *)swq->psn_search; + msns->start_idx_next_psn_start_psn =0 ; + + start_psn = swq->start_psn; + next_psn = swq->next_psn; + start_idx = swq->slot_idx; + msns->start_idx_next_psn_start_psn |= +bnxt_re_update_msn_tbl (start_idx, next_psn, start_psn); + qp->msn++; + qp->msn %= qp->msn_tbl_sz; +} +static void bnxt_qplib_fill_psn_search (struct bnxt_qplib_qp *qp,struct bnxt_qplib_swqe *wqe,struct bnxt_qplib_swq *swq)
@@ -1596,6 +1632,12 @@ static void bnxt_qplib_fill_psn_search(struct bnxt_qplib_qp *qp,if (!swq->psn_search)return ; +/* Handle MSN differently on cap flags */ +if (BNXT_RE_HW_RETX (qp->dev_cap_flags)) { +bnxt_qplib_fill_msn_search (qp, wqe, swq); +return ; + } + psns = (struct sq_psn_search *)swq->psn_search; psns = swq->psn_search; psns_ext = swq->psn_ext;
@@ -1704,8 +1746,8 @@ static u16 bnxt_qplib_required_slots(struct bnxt_qplib_qp *qp,return slot; } -static void bnxt_qplib_pull_psn_buff (struct bnxt_qplib_q *sq, -struct bnxt_qplib_swq *swq) +static void bnxt_qplib_pull_psn_buff (struct bnxt_qplib_qp *qp,struct bnxt_qplib_q *sq, +struct bnxt_qplib_swq *swq,bool hw_retx) {struct bnxt_qplib_hwq *hwq;u32 pg_num, pg_indx;
@@ -1716,6 +1758,11 @@ static void bnxt_qplib_pull_psn_buff(struct bnxt_qplib_q *sq,if (!hwq->pad_pg)return ; tail = swq->slot_idx / sq->dbinfo.max_slot; +if (hw_retx) { +/* For HW retx use qp msn index */ + tail = qp->msn; + tail %= qp->msn_tbl_sz; + } pg_num = (tail + hwq->pad_pgofft) / (PAGE_SIZE / hwq->pad_stride); pg_indx = (tail + hwq->pad_pgofft) % (PAGE_SIZE / hwq->pad_stride); buff = (void *)(hwq->pad_pg[pg_num] + pg_indx * hwq->pad_stride);
@@ -1740,6 +1787,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp,struct bnxt_qplib_swq *swq;bool sch_handler = false;u16 wqe_sz, qdf =0 ; +bool msn_update;void *base_hdr;void *ext_hdr;__le32 temp32;
@@ -1767,7 +1815,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, } swq =bnxt_qplib_get_swqe (sq, &wqe_idx); -bnxt_qplib_pull_psn_buff (sq, swq); +bnxt_qplib_pull_psn_buff (qp, sq, swq,BNXT_RE_HW_RETX (qp->dev_cap_flags)); idx =0 ; swq->slot_idx = hwq->prod;
@@ -1799,6 +1847,8 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, &idx);if (data_len <0 ) goto queue_err; +/* Make sure we update MSN table only for wired wqes */ + msn_update = true;/* Specifics */ switch (wqe->type) {case BNXT_QPLIB_SWQE_TYPE_SEND :
@@ -1839,6 +1889,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, SQ_SEND_DST_QP_MASK); ext_sqe->avid =cpu_to_le32 (wqe->send.avid &SQ_SEND_AVID_MASK ); + msn_update = false; }else { sqe->length =cpu_to_le32 (data_len);if (qp->mtu)
@@ -1896,7 +1947,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, sqe->wqe_type = wqe->type; sqe->flags = wqe->flags; sqe->inv_l_key =cpu_to_le32 (wqe->local_inv.inv_l_key); - + msn_update = false;break ; }case BNXT_QPLIB_SWQE_TYPE_FAST_REG_MR :
@@ -1928,6 +1979,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, PTU_PTE_VALID); ext_sqe->pblptr =cpu_to_le64 (wqe->frmr.pbl_dma_ptr); ext_sqe->va =cpu_to_le64 (wqe->frmr.va); + msn_update = false;break ; }
@@ -1945,6 +1997,7 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, sqe->l_key =cpu_to_le32 (wqe->bind.r_key); ext_sqe->va =cpu_to_le64 (wqe->bind.va); ext_sqe->length_lo =cpu_to_le32 (wqe->bind.length); + msn_update = false;break ; }default :
@@ -1952,8 +2005,10 @@ int bnxt_qplib_post_send(struct bnxt_qplib_qp *qp, rc = -EINVAL ; goto done; } - swq->next_psn = sq->psn &BTH_PSN_MASK ; -bnxt_qplib_fill_psn_search (qp, wqe, swq); +if (!BNXT_RE_HW_RETX (qp->dev_cap_flags) || msn_update) { + swq->next_psn = sq->psn &BTH_PSN_MASK ; +bnxt_qplib_fill_psn_search (qp, wqe, swq); + } queue_err:bnxt_qplib_swq_mod_start (sq, wqe_idx);bnxt_qplib_hwq_incr_prod (&sq->dbinfo, hwq, swq->slots);
drivers/infiniband/hw/bnxt_re/qplib_fp.h +14 -0
@@ -338,6 +338,9 @@ struct bnxt_qplib_qp {dma_addr_t rq_hdr_buf_map;struct list_head sq_flush;struct list_head rq_flush; +u32 msn; +u32 msn_tbl_sz; +u16 dev_cap_flags; };#define BNXT_QPLIB_MAX_CQE_ENTRY_SIZE sizeof(struct cq_base)
@@ -626,4 +629,15 @@ static inline u16 bnxt_qplib_calc_ilsize(struct bnxt_qplib_swqe *wqe, u16 max) return size; } + +/* MSN table update inlin */ +static inline uint64_t bnxt_re_update_msn_tbl (u32 st_idx,u32 npsn,u32 start_psn) +{ +return cpu_to_le64 ((((u64)(st_idx) <<SQ_MSN_SEARCH_START_IDX_SFT ) & +SQ_MSN_SEARCH_START_IDX_MASK ) | + (((u64)(npsn) <<SQ_MSN_SEARCH_NEXT_PSN_SFT ) & +SQ_MSN_SEARCH_NEXT_PSN_MASK ) | + (((start_psn) <<SQ_MSN_SEARCH_START_PSN_SFT ) & +SQ_MSN_SEARCH_START_PSN_MASK )); +}#endif /* __BNXT_QPLIB_FP_H__ */
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +2 -0
@@ -905,6 +905,8 @@ int bnxt_qplib_init_rcfw(struct bnxt_qplib_rcfw *rcfw, req.max_gid_per_vf =cpu_to_le32 (ctx->vf_res.max_gid_per_vf); skip_ctx_setup: +if (BNXT_RE_HW_RETX (rcfw->res->dattr->dev_cap_flags)) + req.flags |=CMDQ_INITIALIZE_FW_FLAGS_HW_REQUESTER_RETX_SUPPORTED ; req.stat_ctx_id =cpu_to_le32 (ctx->stats.fw_id);bnxt_qplib_fill_cmdqmsg (&msg, &req, &resp,NULL ,sizeof (req),sizeof (resp),0 ); rc =bnxt_qplib_rcfw_send_message (rcfw, &msg);
drivers/infiniband/hw/bnxt_re/qplib_res.h +9 -0
@@ -500,6 +500,15 @@ static inline bool _is_ext_stats_supported(u16 dev_cap_flags)CREQ_QUERY_FUNC_RESP_SB_EXT_STATS ; } +static inline bool _is_hw_retx_supported (u16 dev_cap_flags) +{ +return dev_cap_flags & + (CREQ_QUERY_FUNC_RESP_SB_HW_REQUESTER_RETX_ENABLED | +CREQ_QUERY_FUNC_RESP_SB_HW_RESPONDER_RETX_ENABLED ); +} + +#define BNXT_RE_HW_RETX (a) _is_hw_retx_supported((a)) +static inline u8 bnxt_qplib_dbr_pacing_en (struct bnxt_qplib_chip_ctx *cctx) {return cctx->modes.dbr_pacing;
include/uapi/rdma/bnxt_re-abi.h +1 -0
@@ -55,6 +55,7 @@ enum {BNXT_RE_UCNTX_CMASK_WC_DPI_ENABLED =0x04ULL ,BNXT_RE_UCNTX_CMASK_DBR_PACING_ENABLED =0x08ULL ,BNXT_RE_UCNTX_CMASK_POW2_DISABLED =0x10ULL , + BNXT_RE_COMP_MASK_UCNTX_HW_RETX_ENABLED = 0x40, }; enum bnxt_re_wqe_mode {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 372/744 bnxt_re: avoid shift undefined behavior in bnxt_qplib_alloc_init_hwq
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michal Schmidt <[email protected]>
[ Upstream commit 78cfd17142ef70599d6409cbd709d94b3da58659 ]
Undefined behavior is triggered when bnxt_qplib_alloc_init_hwq is called with hwq_attr->aux_depth != 0 and hwq_attr->aux_stride == 0. In that case, "roundup_pow_of_two(hwq_attr->aux_stride)" gets called. roundup_pow_of_two is documented as undefined for 0.
Fix it in the one caller that had this combination.
The undefined behavior was detected by UBSAN:
UBSAN: shift-out-of-bounds in ./include/linux/log2.h:57:13 shift exponent 64 is too large for 64-bit type 'long unsigned int' CPU: 24 PID: 1075 Comm: (udev-worker) Not tainted 6.9.0-rc6+ #4 Hardware name: Abacus electric, s.r.o. - [email protected] Super Server/H12SSW-iN, BIOS 2.7 10/25/2023 Call Trace: <TASK> dump_stack_lvl+0x5d/0x80 ubsan_epilogue+0x5/0x30 __ubsan_handle_shift_out_of_bounds.cold+0x61/0xec __roundup_pow_of_two+0x25/0x35 [bnxt_re] bnxt_qplib_alloc_init_hwq+0xa1/0x470 [bnxt_re] bnxt_qplib_create_qp+0x19e/0x840 [bnxt_re] bnxt_re_create_qp+0x9b1/0xcd0 [bnxt_re] ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 ? __kmalloc+0x1b6/0x4f0 ? create_qp.part.0+0x128/0x1c0 [ib_core] ? __pfx_bnxt_re_create_qp+0x10/0x10 [bnxt_re] create_qp.part.0+0x128/0x1c0 [ib_core] ib_create_qp_kernel+0x50/0xd0 [ib_core] create_mad_qp+0x8e/0xe0 [ib_core] ? __pfx_qp_event_handler+0x10/0x10 [ib_core] ib_mad_init_device+0x2be/0x680 [ib_core] add_client_context+0x10d/0x1a0 [ib_core] enable_device_and_get+0xe0/0x1d0 [ib_core] ib_register_device+0x53c/0x630 [ib_core] ? srso_alias_return_thunk+0x5/0xfbef5 bnxt_re_probe+0xbd8/0xe50 [bnxt_re] ? __pfx_bnxt_re_probe+0x10/0x10 [bnxt_re] auxiliary_bus_probe+0x49/0x80 ? driver_sysfs_add+0x57/0xc0 really_probe+0xde/0x340 ? pm_runtime_barrier+0x54/0x90 ? __pfx___driver_attach+0x10/0x10 __driver_probe_device+0x78/0x110 driver_probe_device+0x1f/0xa0 __driver_attach+0xba/0x1c0 bus_for_each_dev+0x8f/0xe0 bus_add_driver+0x146/0x220 driver_register+0x72/0xd0 __auxiliary_driver_register+0x6e/0xd0 ? __pfx_bnxt_re_mod_init+0x10/0x10 [bnxt_re] bnxt_re_mod_init+0x3e/0xff0 [bnxt_re] ? __pfx_bnxt_re_mod_init+0x10/0x10 [bnxt_re] do_one_initcall+0x5b/0x310 do_init_module+0x90/0x250 init_module_from_file+0x86/0xc0 idempotent_init_module+0x121/0x2b0 __x64_sys_finit_module+0x5e/0xb0 do_syscall_64+0x82/0x160 ? srso_alias_return_thunk+0x5/0xfbef5 ? syscall_exit_to_user_mode_prepare+0x149/0x170 ? srso_alias_return_thunk+0x5/0xfbef5 ? syscall_exit_to_user_mode+0x75/0x230 ? srso_alias_return_thunk+0x5/0xfbef5 ? do_syscall_64+0x8e/0x160 ? srso_alias_return_thunk+0x5/0xfbef5 ? __count_memcg_events+0x69/0x100 ? srso_alias_return_thunk+0x5/0xfbef5 ? count_memcg_events.constprop.0+0x1a/0x30 ? srso_alias_return_thunk+0x5/0xfbef5 ? handle_mm_fault+0x1f0/0x300 ? srso_alias_return_thunk+0x5/0xfbef5 ? do_user_addr_fault+0x34e/0x640 ? srso_alias_return_thunk+0x5/0xfbef5 ? srso_alias_return_thunk+0x5/0xfbef5 entry_SYSCALL_64_after_hwframe+0x76/0x7e RIP: 0033:0x7f4e5132821d Code: ff c3 66 2e 0f 1f 84 00 00 00 00 00 90 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d e3 db 0c 00 f7 d8 64 89 01 48 RSP: 002b:00007ffca9c906a8 EFLAGS: 00000246 ORIG_RAX: 0000000000000139 RAX: ffffffffffffffda RBX: 0000563ec8a8f130 RCX: 00007f4e5132821d RDX: 0000000000000000 RSI: 00007f4e518fa07d RDI: 000000000000003b RBP: 00007ffca9c90760 R08: 00007f4e513f6b20 R09: 00007ffca9c906f0 R10: 0000563ec8a8faa0 R11: 0000000000000246 R12: 00007f4e518fa07d R13: 0000000000020000 R14: 0000563ec8409e90 R15: 0000563ec8a8fa60 </TASK> ---[ end trace ]---
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -1
@@ -1010,7 +1010,8 @@ int bnxt_qplib_create_qp(struct bnxt_qplib_res *res, struct bnxt_qplib_qp *qp) hwq_attr.stride =sizeof (struct sq_sge ); hwq_attr.depth =bnxt_qplib_get_depth (sq); hwq_attr.aux_stride = psn_sz; - hwq_attr.aux_depth =bnxt_qplib_set_sq_size (sq, qp->wqe_mode); + hwq_attr.aux_depth = psn_sz ?bnxt_qplib_set_sq_size (sq, qp->wqe_mode) + :0 ;/* Update msn tbl size */ if (BNXT_RE_HW_RETX (qp->dev_cap_flags) && psn_sz) { hwq_attr.aux_depth =roundup_pow_of_two (bnxt_qplib_set_sq_size (sq, qp->wqe_mode));
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 373/744 SUNRPC: Fix gss_free_in_token_pages()
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chuck Lever <[email protected]>
[ Upstream commit bafa6b4d95d97877baa61883ff90f7e374427fae ]
Dan Carpenter says:
Quoted 19 lines
Commit
5866efa8cbfb("SUNRPC: Fixsvcauth_gss_proxy_init()") from Oct 24, 2019 (linux-next), leads to the following Smatch static checker warning:net/sunrpc/auth_gss/svcauth_gss.c:1039 gss_free_in_token_pages() warn: iterator 'i' not incremented
net/sunrpc/auth_gss/svcauth_gss.c1034 static void gss_free_in_token_pages(struct gssp_in_token *in_token) 1035 { 1036 u32 inlen; 1037 int i; 1038 --> 1039 i = 0; 1040 inlen = in_token->page_len; 1041 while (inlen) { 1042 if (in_token->pages[i]) 1043 put_page(in_token->pages[i]); ^
Quoted 8 lines
This puts page zero over and over.
1044 inlen -= inlen > PAGE_SIZE ? PAGE_SIZE : inlen; 1045 } 1046 1047 kfree(in_token->pages); 1048 in_token->pages = NULL; 1049 }
Based on the way that the ->pages[] array is constructed in gss_read_proxy_verf(), we know that once the loop encounters a NULL page pointer, the remaining array elements must also be NULL.
--- net/sunrpc/auth_gss/svcauth_gss.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-)
net/sunrpc/auth_gss/svcauth_gss.c +2 -8
@@ -1043,17 +1043,11 @@ svcauth_gss_proc_init_verf(struct cache_detail *cd, struct svc_rqst *rqstp,static void gss_free_in_token_pages (struct gssp_in_token *in_token) { -u32 inlen;int i; i =0 ; - inlen = in_token->page_len; -while (inlen) { -if (in_token->pages[i]) -put_page (in_token->pages[i]); - inlen -= inlen >PAGE_SIZE ?PAGE_SIZE : inlen; - } - +while (in_token->pages[i]) +put_page (in_token->pages[i++]);kfree (in_token->pages); in_token->pages =NULL ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 374/744 selftests/kcmp: remove unused open mode
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Edward Liaw <[email protected]>
[ Upstream commit eb59a58113717df04b8a8229befd8ab1e5dbf86e ]
Android bionic warns that open modes are ignored if O_CREAT or O_TMPFILE aren't specified. The permissions for the file are set above:
fd1 = open(kpath, O_RDWR | O_CREAT | O_TRUNC, 0644);
--- tools/testing/selftests/kcmp/kcmp_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/kcmp/kcmp_test.c +1 -1
@@ -91,7 +91,7 @@ int main(int argc, char **argv)ksft_print_header ();ksft_set_plan (3 ); - fd2 =open (kpath,O_RDWR ,0644 ); + fd2 =open (kpath,O_RDWR );if (fd2 <0 ) {perror ("Can't open file" );ksft_exit_fail ();
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 375/744 RDMA/IPoIB: Fix format truncation compilation errors
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Leon Romanovsky <[email protected]>
[ Upstream commit 49ca2b2ef3d003402584c68ae7b3055ba72e750a ]
Truncate the device name to store IPoIB VLAN name.
[leonro@5b4e8fba4ddd kernel]$ make -s -j 20 allmodconfig [leonro@5b4e8fba4ddd kernel]$ make -s -j 20 W=1 drivers/infiniband/ulp/ipoib/ drivers/infiniband/ulp/ipoib/ipoib_vlan.c: In function ‘ipoib_vlan_add’:drivers/infiniband/ulp/ipoib/ipoib_vlan.c:187:52: error: ‘%04x’ directive output may be truncated writing 4 bytes into a region of size between 0 and 15 [-Werror=format-truncation=]
187 | snprintf(intf_name, sizeof(intf_name), "%s.%04x",
| ^~~~drivers/infiniband/ulp/ipoib/ipoib_vlan.c:187:48: note: directive argument in the range [0, 65535]
187 | snprintf(intf_name, sizeof(intf_name), "%s.%04x",
| ^~~~~~~~~drivers/infiniband/ulp/ipoib/ipoib_vlan.c:187:9: note: ‘snprintf’ output between 6 and 21 bytes into a destination of size 16
187 | snprintf(intf_name, sizeof(intf_name), "%s.%04x",
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
188 | ppriv->dev->name, pkey);
| ~~~~~~~~~~~~~~~~~~~~~~~cc1: all warnings being treated as errors
make[6]: *** [scripts/Makefile.build:244: drivers/infiniband/ulp/ipoib/ipoib_vlan.o] Error 1 make[6]: *** Waiting for unfinished jobs....
--- drivers/infiniband/ulp/ipoib/ipoib_vlan.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/infiniband/ulp/ipoib/ipoib_vlan.c +6 -2
@@ -184,8 +184,12 @@ int ipoib_vlan_add(struct net_device *pdev, unsigned short pkey) ppriv =ipoib_priv (pdev); -snprintf (intf_name,sizeof (intf_name),"%s.%04x" , - ppriv->dev->name, pkey); +/* If you increase IFNAMSIZ, update snprintf below +* to allow longer names. +*/ +BUILD_BUG_ON (IFNAMSIZ !=16 ); +snprintf (intf_name,sizeof (intf_name),"%.10s.%04x" , ppriv->dev->name, + pkey); ndev =ipoib_intf_alloc (ppriv->ca, ppriv->port, intf_name);if (IS_ERR (ndev)) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 376/744 RDMA/cma: Fix kmemleak in rdma_core observed during blktests nvme/rdma use siw
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhu Yanjun <[email protected]>
[ Upstream commit 9c0731832d3b7420cbadba6a7f334363bc8dfb15 ]
When running blktests nvme/rdma, the following kmemleak issue will appear.
kmemleak: Kernel memory leak detector initialized (mempool available:36041)
kmemleak: Automatic memory scanning thread started
kmemleak: 2 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
kmemleak: 8 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
kmemleak: 17 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
kmemleak: 4 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
unreferenced object 0xffff88855da53400 (size 192):
comm "rdma", pid 10630, jiffies 4296575922 hex dump (first 32 bytes):
37 00 00 00 00 00 00 00 c0 ff ff ff 1f 00 00 00 7...............
10 34 a5 5d 85 88 ff ff 10 34 a5 5d 85 88 ff ff .4.].....4.]....
backtrace (crc 47f66721):
[<ffffffff911251bd>] kmalloc_trace+0x30d/0x3b0
[<ffffffffc2640ff7>] alloc_gid_entry+0x47/0x380 [ib_core]
[<ffffffffc2642206>] add_modify_gid+0x166/0x930 [ib_core]
[<ffffffffc2643468>] ib_cache_update.part.0+0x6d8/0x910 [ib_core]
[<ffffffffc2644e1a>] ib_cache_setup_one+0x24a/0x350 [ib_core]
[<ffffffffc263949e>] ib_register_device+0x9e/0x3a0 [ib_core]
[<ffffffffc2a3d389>] 0xffffffffc2a3d389
[<ffffffffc2688cd8>] nldev_newlink+0x2b8/0x520 [ib_core]
[<ffffffffc2645fe3>] rdma_nl_rcv_msg+0x2c3/0x520 [ib_core]
[<ffffffffc264648c>]
rdma_nl_rcv_skb.constprop.0.isra.0+0x23c/0x3a0 [ib_core]
[<ffffffff9270e7b5>] netlink_unicast+0x445/0x710
[<ffffffff9270f1f1>] netlink_sendmsg+0x761/0xc40
[<ffffffff9249db29>] __sys_sendto+0x3a9/0x420
[<ffffffff9249dc8c>] __x64_sys_sendto+0xdc/0x1b0
[<ffffffff92db0ad3>] do_syscall_64+0x93/0x180
[<ffffffff92e00126>] entry_SYSCALL_64_after_hwframe+0x71/0x79The root cause: rdma_put_gid_attr is not called when sgid_attr is set to ERR_PTR(-ENODEV).
--- drivers/infiniband/core/cma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/core/cma.c +3 -1
@@ -715,8 +715,10 @@ cma_validate_port(struct ib_device *device, u32 port,rcu_read_lock (); ndev =rcu_dereference (sgid_attr->ndev);if (!net_eq (dev_net (ndev), dev_addr->net) || - ndev->ifindex != bound_if_index) + ndev->ifindex != bound_if_index) { +rdma_put_gid_attr (sgid_attr); sgid_attr =ERR_PTR (-ENODEV ); + }rcu_read_unlock (); goto out; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 377/744 tracing/user_events: Allow events to persist for perfmon_capable users
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beau Belgrave <[email protected]>
[ Upstream commit 5dbd04eddb2c0841d1b3930e0a9944a2343c9cac ]
There are several scenarios that have come up where having a user_event persist even if the process that registered it exits. The main one is having a daemon create events on bootup that shouldn't get deleted if the daemon has to exit or reload. Another is within OpenTelemetry exporters, they wish to potentially check if a user_event exists on the system to determine if exporting the data out should occur. The user_event in this case must exist even in the absence of the owning process running (such as the above daemon case).
Expose the previously internal flag USER_EVENT_REG_PERSIST to user processes. Upon register or delete of events with this flag, ensure the user is perfmon_capable to prevent random user processes with access to tracefs from creating events that persist after exit.
Stable-dep-of: bd125a084091 ("tracing/user_events: Fix non-spaced field matching")
--- include/uapi/linux/user_events.h | 11 +++++++++- kernel/trace/trace_events_user.c | 36 +++++++++++++++++++------------- 2 files changed, 32 insertions(+), 15 deletions(-)
include/uapi/linux/user_events.h +10 -1
@@ -17,6 +17,15 @@/* Create dynamic location entry within a 32-bit value */ #define DYN_LOC (offset, size) ((size) << 16 | (offset)) +/* List of supported registration flags */ +enum user_reg_flag { +/* Event will not delete upon last reference closing */ +USER_EVENT_REG_PERSIST =1U <<0 , + +/* This value or above is currently non-ABI */ +USER_EVENT_REG_MAX =1U <<1 , +}; +/* * Describes an event registration and stores the results of the registration. * This structure is passed to the DIAG_IOCSREG ioctl, callers at a minimum
@@ -33,7 +42,7 @@ struct user_reg {/* Input: Enable size in bytes at address */ __u8 enable_size; -/* Input: Flags for future use, set to 0 */ +/* Input: Flags to use, if any */ __u16 flags;/* Input: Address to update when enabled */
kernel/trace/trace_events_user.c +22 -14
@@ -49,18 +49,6 @@#define EVENT_STATUS_PERF BIT(1)#define EVENT_STATUS_OTHER BIT(7) -/* -* User register flags are not allowed yet, keep them here until we are -* ready to expose them out to the user ABI. -*/ -enum user_reg_flag { -/* Event will not delete upon last reference closing */ -USER_EVENT_REG_PERSIST =1U <<0 , - -/* This value or above is currently non-ABI */ -USER_EVENT_REG_MAX =1U <<1 , -}; -/* * Stores the system name, tables, and locks for a group of events. This * allows isolation for events by various means.
@@ -220,6 +208,17 @@ static u32 user_event_key(char *name)return jhash (name,strlen (name),0 ); } +static bool user_event_capable (u16 reg_flags) +{ +/* Persistent events require CAP_PERFMON / CAP_SYS_ADMIN */ +if (reg_flags &USER_EVENT_REG_PERSIST ) { +if (!perfmon_capable ()) +return false; + } + +return true; +} +static struct user_event *user_event_get (struct user_event *user) {refcount_inc (&user->refcnt);
@@ -1811,6 +1810,9 @@ static int user_event_free(struct dyn_event *ev)if (!user_event_last_ref (user))return -EBUSY ; +if (!user_event_capable (user->reg_flags)) +return -EPERM ; +return destroy_user_event (user); }
@@ -1926,10 +1928,13 @@ static int user_event_parse(struct user_event_group *group, char *name,int argc =0 ;char **argv; -/* User register flags are not ready yet */ -if (reg_flags !=0 || flags !=NULL ) +/* Currently don't support any text based flags */ +if (flags !=NULL )return -EINVAL ; +if (!user_event_capable (reg_flags)) +return -EPERM ; +/* Prevent dyn_event from racing */ mutex_lock (&event_mutex); user =find_user_event (group, name, &key);
@@ -2062,6 +2067,9 @@ static int delete_user_event(struct user_event_group *group, char *name)if (!user_event_last_ref (user))return -EBUSY ; +if (!user_event_capable (user->reg_flags)) +return -EPERM ; +return destroy_user_event (user); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 378/744 tracing/user_events: Prepare find/delete for same name events
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beau Belgrave <[email protected]>
[ Upstream commit 1e953de9e9b4ca77a9ce0fc17a0778eba3a4ca64 ]
The current code for finding and deleting events assumes that there will never be cases when user_events are registered with the same name, but different formats. Scenarios exist where programs want to use the same name but have different formats. An example is multiple versions of a program running side-by-side using the same event name, but with updated formats in each version.
This change does not yet allow for multi-format events. If user_events are registered with the same name but different arguments the programs see the same return values as before. This change simply makes it possible to easily accommodate for this.
Update find_user_event() to take in argument parameters and register flags to accommodate future multi-format event scenarios. Have find validate argument matching and return error pointers to cover when an existing event has the same name but different format. Update callers to handle error pointer logic.
Move delete_user_event() to use hash walking directly now that find_user_event() has changed. Delete all events found that match the register name, stop if an error occurs and report back to the user.
Update user_fields_match() to cover list_empty() scenarios now that find_user_event() uses it directly. This makes the logic consistent across several callsites.
Stable-dep-of: bd125a084091 ("tracing/user_events: Fix non-spaced field matching")
--- kernel/trace/trace_events_user.c | 107 +++++++++++++++++-------------- 1 file changed, 59 insertions(+), 48 deletions(-)
kernel/trace/trace_events_user.c +59 -48
@@ -202,6 +202,8 @@ static struct user_event_mm *user_event_mm_get(struct user_event_mm *mm);static struct user_event_mm *user_event_mm_get_all (struct user_event *user);static void user_event_mm_put (struct user_event_mm *mm);static int destroy_user_event (struct user_event *user); +static bool user_fields_match (struct user_event *user,int argc, +const char **argv);static u32 user_event_key (char *name) {
@@ -1493,17 +1495,24 @@ static int destroy_user_event(struct user_event *user) }static struct user_event *find_user_event (struct user_event_group *group, -char *name,u32 *outkey) +char *name,int argc,const char **argv, +u32 flags,u32 *outkey) {struct user_event *user;u32 key =user_event_key (name); *outkey = key; -hash_for_each_possible (group->register_table, user, node, key) -if (!strcmp (EVENT_NAME (user), name)) +hash_for_each_possible (group->register_table, user, node, key) { +if (strcmp (EVENT_NAME (user), name)) +continue ; + +if (user_fields_match (user, argc, argv))return user_event_get (user); +return ERR_PTR (-EADDRINUSE ); + } +return NULL ; }
@@ -1860,6 +1869,9 @@ static bool user_fields_match(struct user_event *user, int argc,struct list_head *head = &user->fields;int i =0 ; +if (argc ==0 ) +return list_empty (head); +list_for_each_entry_reverse (field, head, link) {if (!user_field_match (field, argc, argv, &i))return false;
@@ -1880,10 +1892,8 @@ static bool user_event_match(const char *system, const char *event, match =strcmp (EVENT_NAME (user), event) ==0 && (!system ||strcmp (system,USER_EVENTS_SYSTEM ) ==0 ); -if (match && argc >0 ) +if (match) match =user_fields_match (user, argc, argv); -else if (match && argc ==0 ) - match =list_empty (&user->fields);return match; }
@@ -1922,11 +1932,11 @@ static int user_event_parse(struct user_event_group *group, char *name, char *args, char *flags, struct user_event **newuser, int reg_flags) { - int ret; -u32 key; struct user_event *user; +char **argv =NULL ;int argc =0 ; -char **argv; +int ret; +u32 key;/* Currently don't support any text based flags */ if (flags !=NULL )
@@ -1935,41 +1945,34 @@ static int user_event_parse(struct user_event_group *group, char *name,if (!user_event_capable (reg_flags))return -EPERM ; +if (args) { + argv =argv_split (GFP_KERNEL , args, &argc); + +if (!argv) +return -ENOMEM ; + } +/* Prevent dyn_event from racing */ mutex_lock (&event_mutex); - user =find_user_event (group, name, &key); + user =find_user_event (group, name, argc, (const char **)argv, + reg_flags, &key);mutex_unlock (&event_mutex); -if (user) { -if (args) { - argv =argv_split (GFP_KERNEL , args, &argc); -if (!argv) { - ret = -ENOMEM ; - goto error; - } +if (argv) +argv_free (argv); - ret =user_fields_match (user, argc, (const char **)argv); -argv_free (argv); - - }else - ret =list_empty (&user->fields); - -if (ret) { - *newuser = user; -/* -* Name is allocated by caller, free it since it already exists. -* Caller only worries about failure cases for freeing. -*/ -kfree (name); - }else { - ret = -EADDRINUSE ; - goto error; - } +if (IS_ERR (user)) +return PTR_ERR (user); + +if (user) { + *newuser = user; +/* +* Name is allocated by caller, free it since it already exists. +* Caller only worries about failure cases for freeing. +*/ +kfree (name);return 0 ; -error: -user_event_put (user, false); -return ret; } user =kzalloc (sizeof (*user),GFP_KERNEL_ACCOUNT );
@@ -2052,25 +2055,33 @@ static int user_event_parse(struct user_event_group *group, char *name, }/* -* Deletes a previously created event if it is no longer being used. +* Deletes previously created events if they are no longer being used. */ static int delete_user_event (struct user_event_group *group,char *name) { -u32 key; -struct user_event *user =find_user_event (group, name, &key); +struct user_event *user; +struct hlist_node *tmp; +u32 key =user_event_key (name); +int ret = -ENOENT ; -if (!user) -return -ENOENT ; +/* Attempt to delete all event(s) with the name passed in */ +hash_for_each_possible_safe (group->register_table, user, tmp, node, key) { +if (strcmp (EVENT_NAME (user), name)) +continue ; -user_event_put (user, true); +if (!user_event_last_ref (user)) +return -EBUSY ; -if (!user_event_last_ref (user)) -return -EBUSY ; +if (!user_event_capable (user->reg_flags)) +return -EPERM ; -if (!user_event_capable (user->reg_flags)) -return -EPERM ; + ret =destroy_user_event (user); -return destroy_user_event (user); +if (ret) + goto out; + } +out: +return ret; }/*
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 379/744 tracing/user_events: Fix non-spaced field matching
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Beau Belgrave <[email protected]>
[ Upstream commit bd125a084091396f3e796bb3dc009940d9771811 ]
When the ABI was updated to prevent same name w/different args, it missed an important corner case when fields don't end with a space. Typically, space is used for fields to help separate them, like "u8 field1; u8 field2". If no spaces are used, like
"u8 field1;u8 field2", then the parsing works for the first time. However, the match check fails on a subsequent register, leading to confusion.
This is because the match check uses argv_split() and assumes that all fields will be split upon the space. When spaces are used, we get back { "u8", "field1;" }, without spaces we get back { "u8", "field1;u8" }. This causes a mismatch, and the user program gets back -EADDRINUSE.
Add a method to detect this case before calling argv_split(). If found force a space after the field separator character ';'. This ensures all cases work properly for matching.
With this fix, the following are all treated as matching:
u8 field1;u8 field2
u8 field1; u8 field2
u8 field1;\tu8 field2
u8 field1;\nu8 field2
--- kernel/trace/trace_events_user.c | 76 +++++++++++++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-)
kernel/trace/trace_events_user.c +75 -1
@@ -1923,6 +1923,80 @@ static int user_event_trace_register(struct user_event *user)return ret; } +/* +* Counts how many ';' without a trailing space are in the args. +*/ +static int count_semis_no_space (char *args) +{ +int count =0 ; + +while ((args =strchr (args,';' ))) { + args++; + +if (!isspace (*args)) + count++; + } + +return count; +} + +/* +* Copies the arguments while ensuring all ';' have a trailing space. +*/ +static char *insert_space_after_semis (char *args,int count) +{ +char *fixed, *pos; +int len; + + len =strlen (args) + count; + fixed =kmalloc (len +1 ,GFP_KERNEL ); + +if (!fixed) +return NULL ; + + pos = fixed; + +/* Insert a space after ';' if there is no trailing space. */ +while (*args) { + *pos = *args++; + +if (*pos++ ==';' && !isspace (*args)) + *pos++ =' ' ; + } + + *pos ='\0' ; + +return fixed; +} + +static char **user_event_argv_split (char *args,int *argc) +{ +char **split; +char *fixed; +int count; + +/* Count how many ';' without a trailing space */ + count =count_semis_no_space (args); + +/* No fixup is required */ +if (!count) +return argv_split (GFP_KERNEL , args, argc); + +/* We must fixup 'field;field' to 'field; field' */ + fixed =insert_space_after_semis (args, count); + +if (!fixed) +return NULL ; + +/* We do a normal split afterwards */ + split =argv_split (GFP_KERNEL , fixed, argc); + +/* We can free since argv_split makes a copy */ +kfree (fixed); + +return split; +} +/* * Parses the event name, arguments and flags then registers if successful. * The name buffer lifetime is owned by this method for success cases only.
@@ -1946,7 +2020,7 @@ static int user_event_parse(struct user_event_group *group, char *name,return -EPERM ;if (args) { - argv =argv_split (GFP_KERNEL , args, &argc); + argv =user_event_argv_split (args, &argc);if (!argv)return -ENOMEM ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 380/744 modules: Drop the .export_symbol section from the final modules
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wang Yao <[email protected]>
[ Upstream commit 8fe51b45c5645c259f759479c374648e9dfeaa03 ]
Commit ddb5cdbafaaa ("kbuild: generate KSYMTAB entries by modpost") forget drop the .export_symbol section from the final modules.
--- scripts/module.lds.S | 1 + 1 file changed, 1 insertion(+)
scripts/module.lds.S +1 -0
@@ -13,6 +13,7 @@ SECTIONS { /DISCARD/ : { *(.discard) *(.discard.*) + *(.export_symbol) } __ksymtab 0 : { *(SORT(___ksymtab+*)) }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 381/744 net: bridge: xmit: make sure we have at least eth header len bytes
In reply to Greg Kroah-Hartman6.6-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nikolay Aleksandrov <[email protected]>
[ Upstream commit 8bd67ebb50c0145fd2ca8681ab65eb7e8cde1afc ]
syzbot triggered an uninit value[1] error in bridge device's xmit path by sending a short (less than ETH_HLEN bytes) skb. To fix it check if we can actually pull that amount instead of assuming.
Tested with dropwatch:
drop at: br_dev_xmit+0xb93/0x12d0 [bridge] (0xffffffffc06739b3)
origin: software
timestamp: Mon May 13 11:31:53 2024 778214037 nsec
protocol: 0x88a8
length: 2
original length: 2
drop reason: PKT_TOO_SMALL
[1]
BUG: KMSAN: uninit-value in br_dev_xmit+0x61d/0x1cb0 net/bridge/br_device.c:65 br_dev_xmit+0x61d/0x1cb0 net/bridge/br_device.c:65 __netdev_start_xmit include/linux/netdevice.h:4903 [inline] netdev_start_xmit include/linux/netdevice.h:4917 [inline] xmit_one net/core/dev.c:3531 [inline] dev_hard_start_xmit+0x247/0xa20 net/core/dev.c:3547 __dev_queue_xmit+0x34db/0x5350 net/core/dev.c:4341 dev_queue_xmit include/linux/netdevice.h:3091 [inline] __bpf_tx_skb net/core/filter.c:2136 [inline] __bpf_redirect_common net/core/filter.c:2180 [inline] __bpf_redirect+0x14a6/0x1620 net/core/filter.c:2187 ____bpf_clone_redirect net/core/filter.c:2460 [inline] bpf_clone_redirect+0x328/0x470 net/core/filter.c:2432 ___bpf_prog_run+0x13fe/0xe0f0 kernel/bpf/core.c:1997 __bpf_prog_run512+0xb5/0xe0 kernel/bpf/core.c:2238 bpf_dispatcher_nop_func include/linux/bpf.h:1234 [inline] __bpf_prog_run include/linux/filter.h:657 [inline] bpf_prog_run include/linux/filter.h:664 [inline] bpf_test_run+0x499/0xc30 net/bpf/test_run.c:425 bpf_prog_test_run_skb+0x14ea/0x1f20 net/bpf/test_run.c:1058 bpf_prog_test_run+0x6b7/0xad0 kernel/bpf/syscall.c:4269 __sys_bpf+0x6aa/0xd90 kernel/bpf/syscall.c:5678 __do_sys_bpf kernel/bpf/syscall.c:5767 [inline] __se_sys_bpf kernel/bpf/syscall.c:5765 [inline] __x64_sys_bpf+0xa0/0xe0 kernel/bpf/syscall.c:5765 x64_sys_call+0x96b/0x3b50 arch/x86/include/generated/asm/syscalls_64.h:322 do_syscall_x64 arch/x86/entry/common.c:52 [inline] do_syscall_64+0xcf/0x1e0 arch/x86/entry/common.c:83 entry_SYSCALL_64_after_hwframe+0x77/0x7f
--- net/bridge/br_device.c | 6 ++++++ 1 file changed, 6 insertions(+)
net/bridge/br_device.c +6 -0
@@ -27,6 +27,7 @@ EXPORT_SYMBOL_GPL(nf_br_ops);/* net device transmit always called with BH disabled */ netdev_tx_t br_dev_xmit (struct sk_buff *skb,struct net_device *dev) { +enum skb_drop_reason reason =pskb_may_pull_reason (skb,ETH_HLEN );struct net_bridge_mcast_port *pmctx_null =NULL ;struct net_bridge *br =netdev_priv (dev);struct net_bridge_mcast *brmctx = &br->multicast_ctx;
@@ -38,6 +39,11 @@ netdev_tx_t br_dev_xmit(struct sk_buff *skb, struct net_device *dev)const unsigned char *dest;u16 vid =0 ; +if (unlikely (reason !=SKB_NOT_DROPPED_YET )) { +kfree_skb_reason (skb, reason); +return NETDEV_TX_OK ; + } +memset (skb->cb,0 ,sizeof (struct br_input_skb_cb ));br_tc_skb_miss_set (skb, false);
Signature · 1 line
2.43.0