6.1.39-rc1 review
Subsystems (8)
Greg Kroah-Hartman
maintainerPATCH 118/591 wifi: iwlwifi: mvm: indicate HW decrypt for beacon protection
In reply to Greg Kroah-HartmanFrom: Johannes Berg <[email protected]>
[ Upstream commit 2db72b8a700943aa54dce0aabe6ff1b72b615162 ]
We've already done the 'decryption' here, so tell
mac80211 it need not do it again.
--- drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rxmq.c +6 -3
@@ -296,7 +296,8 @@ static void iwl_mvm_get_signal_strength(struct iwl_mvm *mvm,static int iwl_mvm_rx_mgmt_prot (struct ieee80211_sta *sta,struct ieee80211_hdr *hdr,struct iwl_rx_mpdu_desc *desc, -u32 status) +u32 status, +struct ieee80211_rx_status *stats) {struct iwl_mvm_sta *mvmsta;struct iwl_mvm_vif *mvmvif;
@@ -325,8 +326,10 @@ static int iwl_mvm_rx_mgmt_prot(struct ieee80211_sta *sta,/* good cases */ if (likely (status &IWL_RX_MPDU_STATUS_MIC_OK && - !(status &IWL_RX_MPDU_STATUS_REPLAY_ERROR ))) + !(status &IWL_RX_MPDU_STATUS_REPLAY_ERROR ))) { + stats->flag |=RX_FLAG_DECRYPTED ;return 0 ; + }if (!sta)return -1 ;
@@ -395,7 +398,7 @@ static int iwl_mvm_rx_crypto(struct iwl_mvm *mvm, struct ieee80211_sta *sta,if (unlikely (ieee80211_is_mgmt (hdr->frame_control) && !ieee80211_has_protected (hdr->frame_control))) -return iwl_mvm_rx_mgmt_prot (sta, hdr, desc, status); +return iwl_mvm_rx_mgmt_prot (sta, hdr, desc, status, stats);if (!ieee80211_has_protected (hdr->frame_control) || (status & IWL_RX_MPDU_STATUS_SEC_MASK) ==
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 119/591 wifi: ath9k: convert msecs to jiffies where needed
In reply to Greg Kroah-HartmanFrom: Dmitry Antipov <[email protected]>
[ Upstream commit 2aa083acea9f61be3280184384551178f510ff51 ]
Since 'ieee80211_queue_delayed_work()' expects timeout in jiffies and not milliseconds, 'msecs_to_jiffies()' should be used in 'ath_restart_work()' and '__ath9k_flush()'.
--- drivers/net/wireless/ath/ath9k/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/wireless/ath/ath9k/main.c +2 -2
@@ -203,7 +203,7 @@ void ath_cancel_work(struct ath_softc *sc)void ath_restart_work (struct ath_softc *sc) {ieee80211_queue_delayed_work (sc->hw, &sc->hw_check_work, -ATH_HW_CHECK_POLL_INT ); +msecs_to_jiffies (ATH_HW_CHECK_POLL_INT ));if (AR_SREV_9340 (sc->sc_ah) ||AR_SREV_9330 (sc->sc_ah)) ieee80211_queue_delayed_work(sc->hw, &sc->hw_pll_work,
@@ -2240,7 +2240,7 @@ void __ath9k_flush(struct ieee80211_hw *hw, u32 queues, bool drop, }ieee80211_queue_delayed_work (hw, &sc->hw_check_work, -ATH_HW_CHECK_POLL_INT ); +msecs_to_jiffies (ATH_HW_CHECK_POLL_INT )); }static bool ath9k_tx_frames_pending (struct ieee80211_hw *hw)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 120/591 bpf: Factor out socket lookup functions for the TC hookpoint.
In reply to Greg Kroah-HartmanFrom: Gilad Sever <[email protected]>
[ Upstream commit 6e98730bc0b44acaf86eccc75f823128aa9c9e79 ]
Change BPF helper socket lookup functions to use TC specific variants:bpf_tc_sk_lookup_tcp() / bpf_tc_sk_lookup_udp() / bpf_tc_skc_lookup_tcp() instead of sharing implementation with the cg / sk_skb hooking points. This allows introducing a separate logic for the TC flow.
The tc functions are identical to the original code.
Stable-dep-of: 9a5cb79762e0 ("bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings")
--- net/core/filter.c | 63 ++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 60 insertions(+), 3 deletions(-)
net/core/filter.c +60 -3
@@ -6646,6 +6646,63 @@ static const struct bpf_func_proto bpf_sk_lookup_udp_proto = { .arg5_type = ARG_ANYTHING, }; +BPF_CALL_5(bpf_tc_skc_lookup_tcp, struct sk_buff *, skb, + struct bpf_sock_tuple *, tuple, u32, len, u64, netns_id, u64, flags) +{ +return (unsigned long )bpf_skc_lookup (skb, tuple, len,IPPROTO_TCP , + netns_id, flags); +} + +static const struct bpf_func_proto bpf_tc_skc_lookup_tcp_proto = { + .func = bpf_tc_skc_lookup_tcp, + .gpl_only = false, + .pkt_access = true, + .ret_type =RET_PTR_TO_SOCK_COMMON_OR_NULL , + .arg1_type =ARG_PTR_TO_CTX , + .arg2_type =ARG_PTR_TO_MEM |MEM_RDONLY , + .arg3_type =ARG_CONST_SIZE , + .arg4_type =ARG_ANYTHING , + .arg5_type =ARG_ANYTHING , +}; + +BPF_CALL_5(bpf_tc_sk_lookup_tcp, struct sk_buff *, skb, + struct bpf_sock_tuple *, tuple, u32, len, u64, netns_id, u64, flags) +{ +return (unsigned long )bpf_sk_lookup (skb, tuple, len,IPPROTO_TCP , + netns_id, flags); +} + +static const struct bpf_func_proto bpf_tc_sk_lookup_tcp_proto = { + .func = bpf_tc_sk_lookup_tcp, + .gpl_only = false, + .pkt_access = true, + .ret_type =RET_PTR_TO_SOCKET_OR_NULL , + .arg1_type =ARG_PTR_TO_CTX , + .arg2_type =ARG_PTR_TO_MEM |MEM_RDONLY , + .arg3_type =ARG_CONST_SIZE , + .arg4_type =ARG_ANYTHING , + .arg5_type =ARG_ANYTHING , +}; + +BPF_CALL_5(bpf_tc_sk_lookup_udp, struct sk_buff *, skb, + struct bpf_sock_tuple *, tuple, u32, len, u64, netns_id, u64, flags) +{ +return (unsigned long )bpf_sk_lookup (skb, tuple, len,IPPROTO_UDP , + netns_id, flags); +} + +static const struct bpf_func_proto bpf_tc_sk_lookup_udp_proto = { + .func = bpf_tc_sk_lookup_udp, + .gpl_only = false, + .pkt_access = true, + .ret_type =RET_PTR_TO_SOCKET_OR_NULL , + .arg1_type =ARG_PTR_TO_CTX , + .arg2_type =ARG_PTR_TO_MEM |MEM_RDONLY , + .arg3_type =ARG_CONST_SIZE , + .arg4_type =ARG_ANYTHING , + .arg5_type =ARG_ANYTHING , +}; + BPF_CALL_1(bpf_sk_release, struct sock *, sk) {if (sk &&sk_is_refcounted (sk))
@@ -7902,9 +7959,9 @@ tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)#endif #ifdef CONFIG_INET case BPF_FUNC_sk_lookup_tcp: -return &bpf_sk_lookup_tcp_proto; +return &bpf_tc_sk_lookup_tcp_proto;case BPF_FUNC_sk_lookup_udp: -return &bpf_sk_lookup_udp_proto; +return &bpf_tc_sk_lookup_udp_proto;case BPF_FUNC_sk_release:return &bpf_sk_release_proto;case BPF_FUNC_tcp_sock:
@@ -7912,7 +7969,7 @@ tc_cls_act_func_proto(enum bpf_func_id func_id, const struct bpf_prog *prog)case BPF_FUNC_get_listener_sock:return &bpf_get_listener_sock_proto;case BPF_FUNC_skc_lookup_tcp: -return &bpf_skc_lookup_tcp_proto; +return &bpf_tc_skc_lookup_tcp_proto;case BPF_FUNC_tcp_check_syncookie:return &bpf_tcp_check_syncookie_proto;case BPF_FUNC_skb_ecn_set_ce:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 121/591 bpf: Call __bpf_sk_lookup()/__bpf_skc_lookup() directly via TC hookpoint
In reply to Greg Kroah-HartmanFrom: Gilad Sever <[email protected]>
[ Upstream commit 97fbfeb86917bdbe9c41d5143e335a929147f405 ]
skb->dev always exists in the tc flow. There is no need to use bpf_skc_lookup(), bpf_sk_lookup() from this code path.
This change facilitates fixing the tc flow to be VRF aware.
Stable-dep-of: 9a5cb79762e0 ("bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings")
--- net/core/filter.c | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-)
net/core/filter.c +18 -6
@@ -6649,8 +6649,12 @@ static const struct bpf_func_proto bpf_sk_lookup_udp_proto = { BPF_CALL_5(bpf_tc_skc_lookup_tcp, struct sk_buff *, skb, struct bpf_sock_tuple *, tuple, u32, len, u64, netns_id, u64, flags) { -return (unsigned long )bpf_skc_lookup (skb, tuple, len,IPPROTO_TCP , - netns_id, flags); +struct net *caller_net =dev_net (skb->dev); +int ifindex = skb->dev->ifindex; + +return (unsigned long )__bpf_skc_lookup (skb, tuple, len, caller_net, + ifindex,IPPROTO_TCP , netns_id, + flags); }static const struct bpf_func_proto bpf_tc_skc_lookup_tcp_proto = {
@@ -6668,8 +6672,12 @@ static const struct bpf_func_proto bpf_tc_skc_lookup_tcp_proto = { BPF_CALL_5(bpf_tc_sk_lookup_tcp, struct sk_buff *, skb, struct bpf_sock_tuple *, tuple, u32, len, u64, netns_id, u64, flags) { -return (unsigned long )bpf_sk_lookup (skb, tuple, len,IPPROTO_TCP , - netns_id, flags); +struct net *caller_net =dev_net (skb->dev); +int ifindex = skb->dev->ifindex; + +return (unsigned long )__bpf_sk_lookup (skb, tuple, len, caller_net, + ifindex,IPPROTO_TCP , netns_id, + flags); }static const struct bpf_func_proto bpf_tc_sk_lookup_tcp_proto = {
@@ -6687,8 +6695,12 @@ static const struct bpf_func_proto bpf_tc_sk_lookup_tcp_proto = { BPF_CALL_5(bpf_tc_sk_lookup_udp, struct sk_buff *, skb, struct bpf_sock_tuple *, tuple, u32, len, u64, netns_id, u64, flags) { -return (unsigned long )bpf_sk_lookup (skb, tuple, len,IPPROTO_UDP , - netns_id, flags); +struct net *caller_net =dev_net (skb->dev); +int ifindex = skb->dev->ifindex; + +return (unsigned long )__bpf_sk_lookup (skb, tuple, len, caller_net, + ifindex,IPPROTO_UDP , netns_id, + flags); }static const struct bpf_func_proto bpf_tc_sk_lookup_udp_proto = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 122/591 bpf: Fix bpf socket lookup from tc/xdp to respect socket VRF bindings
In reply to Greg Kroah-HartmanFrom: Gilad Sever <[email protected]>
[ Upstream commit 9a5cb79762e0eda17ca15c2a6eaca4622383c21c ]
When calling bpf_sk_lookup_tcp(), bpf_sk_lookup_udp() or bpf_skc_lookup_tcp() from tc/xdp ingress, VRF socket bindings aren't respoected, i.e. unbound sockets are returned, and bound sockets aren't found.
VRF binding is determined by the sdif argument to sk_lookup(), however when called from tc the IP SKB control block isn't initialized and thus inet{,6}_sdif() always returns 0.
Fix by calculating sdif for the tc/xdp flows by observing the device's l3 enslaved state.
The cg/sk_skb hooking points which are expected to support inet{,6}_sdif() pass sdif=-1 which makes __bpf_skc_lookup() use the existing logic.
--- include/linux/netdevice.h | 9 +++++ net/core/filter.c | 69 ++++++++++++++++++++++----------------- 2 files changed, 48 insertions(+), 30 deletions(-)
include/linux/netdevice.h +9 -0
@@ -5028,6 +5028,15 @@ static inline bool netif_is_l3_slave(const struct net_device *dev)return dev->priv_flags &IFF_L3MDEV_SLAVE ; } +static inline int dev_sdif (const struct net_device *dev) +{ +#ifdef CONFIG_NET_L3_MASTER_DEV +if (netif_is_l3_slave (dev)) +return dev->ifindex; +#endif +return 0 ; +} +static inline bool netif_is_bridge_master (const struct net_device *dev) {return dev->priv_flags &IFF_EBRIDGE ;
net/core/filter.c +39 -30
171 lines not on this page · raw message
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 123/591 can: length: fix bitstuffing count
In reply to Greg Kroah-HartmanFrom: Vincent Mailhol <[email protected]>
[ Upstream commit 9fde4c557f78ee2f3626e92b4089ce9d54a2573a ]
The Stuff Bit Count is always coded on 4 bits [1]. Update the Stuff Bit Count size accordingly.
In addition, the CRC fields of CAN FD Frames contain stuff bits at fixed positions called fixed stuff bits [2]. The CRC field starts with a fixed stuff bit and then has another fixed stuff bit after each fourth bit [2], which allows us to derive this formula:
FSB count = 1 + round_down(len(CRC field)/4)
The length of the CRC field is [1]:
len(CRC field) = len(Stuff Bit Count) + len(CRC)
= 4 + len(CRC)
with len(CRC) either 17 or 21 bits depending of the payload length.
In conclusion, for CRC17:
FSB count = 1 + round_down((4 + 17)/4)
= 6
and for CRC 21:
FSB count = 1 + round_down((4 + 21)/4)
= 7
Add a Fixed Stuff bits (FSB) field with above values and update CANFD_FRAME_OVERHEAD_SFF and CANFD_FRAME_OVERHEAD_EFF accordingly.
[1] ISO 11898-1:2015 section 10.4.2.6 "CRC field":
The CRC field shall contain the CRC sequence followed by a recessive CRC delimiter. For FD Frames, the CRC field shall also contain the stuff count.
Stuff count
If FD Frames, the stuff count shall be at the beginning of the CRC field. It shall consist of the stuff bit count modulo 8 in a 3-bit gray code followed by a parity bit [...]
[2] ISO 11898-1:2015 paragraph 10.5 "Frame coding":
In the CRC field of FD Frames, the stuff bits shall be inserted at fixed positions; they are called fixed stuff bits. There shall be a fixed stuff bit before the first bit of the stuff count, even if the last bits of the preceding field are a sequence of five consecutive bits of identical value, there shall be only the fixed stuff bit, there shall not be two consecutive stuff bits. A further fixed stuff bit shall be inserted after each fourth bit of the CRC field [...]
--- include/linux/can/length.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
include/linux/can/length.h +8 -6
@@ -69,17 +69,18 @@* Error Status Indicator (ESI) 1 * Data length code (DLC) 4 * Data field 0...512 -* Stuff Bit Count (SBC) 0...16: 4 20...64:5 +* Stuff Bit Count (SBC) 4 * CRC 0...16: 17 20...64:21 * CRC delimiter (CD) 1 +* Fixed Stuff bits (FSB) 0...16: 6 20...64:7 * ACK slot (AS) 1 * ACK delimiter (AD) 1 * End-of-frame (EOF) 7 * Inter frame spacing 3 * -* assuming CRC21, rounded up and ignoring bitstuffing +* assuming CRC21, rounded up and ignoring dynamic bitstuffing */ -#define CANFD_FRAME_OVERHEAD_SFF DIV_ROUND_UP(61, 8) +#define CANFD_FRAME_OVERHEAD_SFF DIV_ROUND_UP(67, 8)/* * Size of a CAN-FD Extended Frame
@@ -98,17 +99,18 @@* Error Status Indicator (ESI) 1 * Data length code (DLC) 4 * Data field 0...512 -* Stuff Bit Count (SBC) 0...16: 4 20...64:5 +* Stuff Bit Count (SBC) 4 * CRC 0...16: 17 20...64:21 * CRC delimiter (CD) 1 +* Fixed Stuff bits (FSB) 0...16: 6 20...64:7 * ACK slot (AS) 1 * ACK delimiter (AD) 1 * End-of-frame (EOF) 7 * Inter frame spacing 3 * -* assuming CRC21, rounded up and ignoring bitstuffing +* assuming CRC21, rounded up and ignoring dynamic bitstuffing */ -#define CANFD_FRAME_OVERHEAD_EFF DIV_ROUND_UP(80, 8) +#define CANFD_FRAME_OVERHEAD_EFF DIV_ROUND_UP(86, 8)/* * Maximum size of a Classical CAN frame
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 124/591 can: kvaser_pciefd: Add function to set skb hwtstamps
In reply to Greg Kroah-HartmanFrom: Jimmy Assarsson <[email protected]>
[ Upstream commit 2d55e9f9b4427e1ad59b974f2267767aac3788d3 ]
Add new function, kvaser_pciefd_set_skb_timestamp(), to set skb hwtstamps.
Stable-dep-of: ec681b91befa ("can: kvaser_pciefd: Set hardware timestamp on transmitted packets")
--- drivers/net/can/kvaser_pciefd.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-)
drivers/net/can/kvaser_pciefd.c +10 -17
@@ -538,6 +538,13 @@ static int kvaser_pciefd_set_tx_irq(struct kvaser_pciefd_can *can)return 0 ; } +static inline void kvaser_pciefd_set_skb_timestamp (const struct kvaser_pciefd *pcie, +struct sk_buff *skb,u64 timestamp) +{ +skb_hwtstamps (skb)->hwtstamp = +ns_to_ktime (div_u64 (timestamp *1000 , pcie->freq_to_ticks_div)); +} +static void kvaser_pciefd_setup_controller (struct kvaser_pciefd_can *can) {u32 mode;
@@ -1171,7 +1178,6 @@ static int kvaser_pciefd_handle_data_packet(struct kvaser_pciefd *pcie,struct canfd_frame *cf;struct can_priv *priv;struct net_device_stats *stats; -struct skb_shared_hwtstamps *shhwtstamps;u8 ch_id = (p->header[1 ] >>KVASER_PCIEFD_PACKET_CHID_SHIFT ) &0x7 ;if (ch_id >= pcie->nr_channels)
@@ -1214,12 +1220,7 @@ static int kvaser_pciefd_handle_data_packet(struct kvaser_pciefd *pcie, stats->rx_bytes += cf->len; } stats->rx_packets++; - - shhwtstamps =skb_hwtstamps (skb); - - shhwtstamps->hwtstamp = -ns_to_ktime (div_u64 (p->timestamp *1000 , - pcie->freq_to_ticks_div)); +kvaser_pciefd_set_skb_timestamp (pcie, skb, p->timestamp);return netif_rx (skb); }
@@ -1282,7 +1283,6 @@ static int kvaser_pciefd_rx_error_frame(struct kvaser_pciefd_can *can,struct net_device *ndev = can->can.dev;struct sk_buff *skb;struct can_frame *cf =NULL ; -struct skb_shared_hwtstamps *shhwtstamps;struct net_device_stats *stats = &ndev->stats; old_state = can->can.state;
@@ -1323,10 +1323,7 @@ static int kvaser_pciefd_rx_error_frame(struct kvaser_pciefd_can *can,return -ENOMEM ; } - shhwtstamps =skb_hwtstamps (skb); - shhwtstamps->hwtstamp = -ns_to_ktime (div_u64 (p->timestamp *1000 , - can->kv_pcie->freq_to_ticks_div)); +kvaser_pciefd_set_skb_timestamp (can->kv_pcie, skb, p->timestamp); cf->can_id |=CAN_ERR_BUSERROR |CAN_ERR_CNT ; cf->data[6 ] = bec.txerr;
@@ -1374,7 +1371,6 @@ static int kvaser_pciefd_handle_status_resp(struct kvaser_pciefd_can *can,struct net_device *ndev = can->can.dev;struct sk_buff *skb;struct can_frame *cf; -struct skb_shared_hwtstamps *shhwtstamps; skb =alloc_can_err_skb (ndev, &cf);if (!skb) {
@@ -1394,10 +1390,7 @@ static int kvaser_pciefd_handle_status_resp(struct kvaser_pciefd_can *can, cf->can_id |=CAN_ERR_RESTARTED ; } - shhwtstamps =skb_hwtstamps (skb); - shhwtstamps->hwtstamp = -ns_to_ktime (div_u64 (p->timestamp *1000 , - can->kv_pcie->freq_to_ticks_div)); +kvaser_pciefd_set_skb_timestamp (can->kv_pcie, skb, p->timestamp); cf->data[6 ] = bec.txerr; cf->data[7 ] = bec.rxerr;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 125/591 can: kvaser_pciefd: Set hardware timestamp on transmitted packets
In reply to Greg Kroah-HartmanFrom: Jimmy Assarsson <[email protected]>
[ Upstream commit ec681b91befa982477e24a150dd6452427fe6473 ]
Set hardware timestamp on transmitted packets.
--- drivers/net/can/kvaser_pciefd.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/net/can/kvaser_pciefd.c +10 -2
@@ -1519,6 +1519,7 @@ static void kvaser_pciefd_handle_nack_packet(struct kvaser_pciefd_can *can,if (skb) { cf->can_id |=CAN_ERR_BUSERROR ; +kvaser_pciefd_set_skb_timestamp (can->kv_pcie, skb, p->timestamp);netif_rx (skb); }else { stats->rx_dropped++;
@@ -1550,8 +1551,15 @@ static int kvaser_pciefd_handle_ack_packet(struct kvaser_pciefd *pcie,netdev_dbg (can->can.dev,"Packet was flushed\n" ); }else {int echo_idx = p->header[0 ] &KVASER_PCIEFD_PACKET_SEQ_MSK ; -int dlc =can_get_echo_skb (can->can.dev, echo_idx,NULL ); -u8 count =ioread32 (can->reg_base + +int dlc; +u8 count; +struct sk_buff *skb; + + skb = can->can.echo_skb[echo_idx]; +if (skb) +kvaser_pciefd_set_skb_timestamp (pcie, skb, p->timestamp); + dlc =can_get_echo_skb (can->can.dev, echo_idx,NULL ); + count =ioread32 (can->reg_base +KVASER_PCIEFD_KCAN_TX_NPACKETS_REG ) &0xff ; if (count < KVASER_PCIEFD_CAN_TX_MAX_COUNT &&
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 126/591 net: stmmac: fix double serdes powerdown
In reply to Greg Kroah-HartmanFrom: Bartosz Golaszewski <[email protected]>
[ Upstream commit c4fc88ad2a765224a648db8ab35f125e120fe41b ]
Commit 49725ffc15fc ("net: stmmac: power up/down serdes in stmmac_open/release") correctly added a call to the serdes_powerdown() callback to stmmac_release() but did not remove the one from stmmac_remove() which leads to a doubled call to serdes_powerdown().
This can lead to all kinds of problems: in the case of the qcom ethqos driver, it caused an unbalanced regulator disable splat.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 ------ 1 file changed, 6 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +0 -6
@@ -7388,12 +7388,6 @@ int stmmac_dvr_remove(struct device *dev)netif_carrier_off (ndev);unregister_netdev (ndev); -/* Serdes power down needs to happen after VLAN filter -* is deleted that is triggered by unregister_netdev(). -*/ -if (priv->plat->serdes_powerdown) - priv->plat->serdes_powerdown (ndev, priv->plat->bsp_priv); -#ifdef CONFIG_DEBUG_FS stmmac_exit_fs (ndev);#endif
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 127/591 netlink: fix potential deadlock in netlink_set_err()
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 8d61f926d42045961e6b65191c09e3678d86a9cf ]
syzbot reported a possible deadlock in netlink_set_err() [1]
A similar issue was fixed in commit 1d482e666b8e ("netlink: disable IRQs for netlink_lock_table()") in netlink_lock_table()
This patch adds IRQ safety to netlink_set_err() and __netlink_diag_dump() which were not covered by cited commit.
[1]
WARNING: possible irq lock inversion dependency detected 6.4.0-rc6-syzkaller-00240-g4e9f0ec38852 #0 Not tainted
syz-executor.2/23011 just changed the state of lock:ffffffff8e1a7a58 (nl_table_lock){.+.?}-{2:2}, at: netlink_set_err+0x2e/0x3a0 net/netlink/af_netlink.c:1612 but this lock was taken by another, SOFTIRQ-safe lock in the past:
(&local->queue_stop_reason_lock){..-.}-{2:2}
and interrupts could create inverse lock ordering between them.
other info that might help us debug this:
Possible interrupt unsafe locking scenario:
CPU0 CPU1
---- ----
lock(nl_table_lock);
local_irq_disable();
lock(&local->queue_stop_reason_lock);
lock(nl_table_lock);
<Interrupt>
lock(&local->queue_stop_reason_lock);*** DEADLOCK ***
--- net/netlink/af_netlink.c | 5 +++-- net/netlink/diag.c | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-)
net/netlink/af_netlink.c +3 -2
@@ -1589,6 +1589,7 @@ static int do_one_set_err(struct sock *sk, struct netlink_set_err_data *p)int netlink_set_err (struct sock *ssk,u32 portid,u32 group,int code) {struct netlink_set_err_data info; +unsigned long flags;struct sock *sk;int ret =0 ;
@@ -1598,12 +1599,12 @@ int netlink_set_err(struct sock *ssk, u32 portid, u32 group, int code)/* sk->sk_err wants a positive error value */ info.code = -code; -read_lock (&nl_table_lock); +read_lock_irqsave (&nl_table_lock, flags);sk_for_each_bound (sk, &nl_table[ssk->sk_protocol].mc_list) ret +=do_one_set_err (sk, &info); -read_unlock (&nl_table_lock); +read_unlock_irqrestore (&nl_table_lock, flags);return ret; }EXPORT_SYMBOL (netlink_set_err);
net/netlink/diag.c +3 -2
@@ -94,6 +94,7 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb,struct net *net =sock_net (skb->sk);struct netlink_diag_req *req;struct netlink_sock *nlsk; +unsigned long flags;struct sock *sk;int num =2 ;int ret =0 ;
@@ -152,7 +153,7 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, num++; mc_list: -read_lock (&nl_table_lock); +read_lock_irqsave (&nl_table_lock, flags);sk_for_each_bound (sk, &tbl->mc_list) {if (sk_hashed (sk))continue ;
@@ -173,7 +174,7 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, } num++; } -read_unlock (&nl_table_lock); +read_unlock_irqrestore (&nl_table_lock, flags); done: cb->args[0 ] = num;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 128/591 netlink: do not hard code device address lenth in fdb dumps
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit aa5406950726e336c5c9585b09799a734b6e77bf ]
syzbot reports that some netdev devices do not have a six bytes address [1]
Replace ETH_ALEN by dev->addr_len.
[1] (Case of a device where dev->addr_len = 4)
BUG: KMSAN: kernel-infoleak in instrument_copy_to_user include/linux/instrumented.h:114 [inline] BUG: KMSAN: kernel-infoleak in copyout+0xb8/0x100 lib/iov_iter.c:169 instrument_copy_to_user include/linux/instrumented.h:114 [inline] copyout+0xb8/0x100 lib/iov_iter.c:169 _copy_to_iter+0x6d8/0x1d00 lib/iov_iter.c:536 copy_to_iter include/linux/uio.h:206 [inline] simple_copy_to_iter+0x68/0xa0 net/core/datagram.c:513 __skb_datagram_iter+0x123/0xdc0 net/core/datagram.c:419 skb_copy_datagram_iter+0x5c/0x200 net/core/datagram.c:527 skb_copy_datagram_msg include/linux/skbuff.h:3960 [inline] netlink_recvmsg+0x4ae/0x15a0 net/netlink/af_netlink.c:1970 sock_recvmsg_nosec net/socket.c:1019 [inline] sock_recvmsg net/socket.c:1040 [inline] ____sys_recvmsg+0x283/0x7f0 net/socket.c:2722 ___sys_recvmsg+0x223/0x840 net/socket.c:2764 do_recvmmsg+0x4f9/0xfd0 net/socket.c:2858 __sys_recvmmsg net/socket.c:2937 [inline] __do_sys_recvmmsg net/socket.c:2960 [inline] __se_sys_recvmmsg net/socket.c:2953 [inline] __x64_sys_recvmmsg+0x397/0x490 net/socket.c:2953 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
Uninit was stored to memory at:
__nla_put lib/nlattr.c:1009 [inline] nla_put+0x1c6/0x230 lib/nlattr.c:1067 nlmsg_populate_fdb_fill+0x2b8/0x600 net/core/rtnetlink.c:4071 nlmsg_populate_fdb net/core/rtnetlink.c:4418 [inline] ndo_dflt_fdb_dump+0x616/0x840 net/core/rtnetlink.c:4456 rtnl_fdb_dump+0x14ff/0x1fc0 net/core/rtnetlink.c:4629 netlink_dump+0x9d1/0x1310 net/netlink/af_netlink.c:2268 netlink_recvmsg+0xc5c/0x15a0 net/netlink/af_netlink.c:1995 sock_recvmsg_nosec+0x7a/0x120 net/socket.c:1019 ____sys_recvmsg+0x664/0x7f0 net/socket.c:2720 ___sys_recvmsg+0x223/0x840 net/socket.c:2764 do_recvmmsg+0x4f9/0xfd0 net/socket.c:2858 __sys_recvmmsg net/socket.c:2937 [inline] __do_sys_recvmmsg net/socket.c:2960 [inline] __se_sys_recvmmsg net/socket.c:2953 [inline] __x64_sys_recvmmsg+0x397/0x490 net/socket.c:2953 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
Uninit was created at:
slab_post_alloc_hook+0x12d/0xb60 mm/slab.h:716 slab_alloc_node mm/slub.c:3451 [inline] __kmem_cache_alloc_node+0x4ff/0x8b0 mm/slub.c:3490 kmalloc_trace+0x51/0x200 mm/slab_common.c:1057 kmalloc include/linux/slab.h:559 [inline] __hw_addr_create net/core/dev_addr_lists.c:60 [inline] __hw_addr_add_ex+0x2e5/0x9e0 net/core/dev_addr_lists.c:118 __dev_mc_add net/core/dev_addr_lists.c:867 [inline] dev_mc_add+0x9a/0x130 net/core/dev_addr_lists.c:885 igmp6_group_added+0x267/0xbc0 net/ipv6/mcast.c:680 ipv6_mc_up+0x296/0x3b0 net/ipv6/mcast.c:2754 ipv6_mc_remap+0x1e/0x30 net/ipv6/mcast.c:2708 addrconf_type_change net/ipv6/addrconf.c:3731 [inline] addrconf_notify+0x4d3/0x1d90 net/ipv6/addrconf.c:3699 notifier_call_chain kernel/notifier.c:93 [inline] raw_notifier_call_chain+0xe4/0x430 kernel/notifier.c:461 call_netdevice_notifiers_info net/core/dev.c:1935 [inline] call_netdevice_notifiers_extack net/core/dev.c:1973 [inline] call_netdevice_notifiers+0x1ee/0x2d0 net/core/dev.c:1987 bond_enslave+0xccd/0x53f0 drivers/net/bonding/bond_main.c:1906 do_set_master net/core/rtnetlink.c:2626 [inline] rtnl_newlink_create net/core/rtnetlink.c:3460 [inline] __rtnl_newlink net/core/rtnetlink.c:3660 [inline] rtnl_newlink+0x378c/0x40e0 net/core/rtnetlink.c:3673 rtnetlink_rcv_msg+0x16a6/0x1840 net/core/rtnetlink.c:6395 netlink_rcv_skb+0x371/0x650 net/netlink/af_netlink.c:2546 rtnetlink_rcv+0x34/0x40 net/core/rtnetlink.c:6413 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0xf28/0x1230 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x122f/0x13d0 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg net/socket.c:747 [inline] ____sys_sendmsg+0x999/0xd50 net/socket.c:2503 ___sys_sendmsg+0x28d/0x3c0 net/socket.c:2557 __sys_sendmsg net/socket.c:2586 [inline] __do_sys_sendmsg net/socket.c:2595 [inline] __se_sys_sendmsg net/socket.c:2593 [inline] __x64_sys_sendmsg+0x304/0x490 net/socket.c:2593 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x41/0xc0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd
Bytes 2856-2857 of 3500 are uninitialized Memory access of size 3500 starts at ffff888018d99104 Data copied to user address 0000000020000480
--- net/core/rtnetlink.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
net/core/rtnetlink.c +4 -4
@@ -3992,7 +3992,7 @@ static int nlmsg_populate_fdb_fill(struct sk_buff *skb, ndm->ndm_ifindex = dev->ifindex; ndm->ndm_state = ndm_state; -if (nla_put (skb,NDA_LLADDR ,ETH_ALEN , addr)) +if (nla_put (skb,NDA_LLADDR , dev->addr_len, addr)) goto nla_put_failure;if (vid)if (nla_put (skb,NDA_VLAN ,sizeof (u16), &vid))
@@ -4006,10 +4006,10 @@ static int nlmsg_populate_fdb_fill(struct sk_buff *skb,return -EMSGSIZE ; } -static inline size_t rtnl_fdb_nlmsg_size (void ) +static inline size_t rtnl_fdb_nlmsg_size (const struct net_device *dev) {return NLMSG_ALIGN (sizeof (struct ndmsg )) + -nla_total_size (ETH_ALEN ) +/* NDA_LLADDR */ +nla_total_size (dev->addr_len) +/* NDA_LLADDR */ nla_total_size (sizeof (u16)) +/* NDA_VLAN */ 0 ; }
@@ -4021,7 +4021,7 @@ static void rtnl_fdb_notify(struct net_device *dev, u8 *addr, u16 vid, int type,struct sk_buff *skb;int err = -ENOBUFS ; - skb =nlmsg_new (rtnl_fdb_nlmsg_size (),GFP_ATOMIC ); + skb =nlmsg_new (rtnl_fdb_nlmsg_size (dev),GFP_ATOMIC );if (!skb) goto errout;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 129/591 bonding: do not assume skb mac_header is set
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
[ Upstream commit 6a940abdef3162e5723f1495b8a49859d1708f79 ]
Drivers must not assume in their ndo_start_xmit() that skbs have their mac_header set. skb->data is all what is needed.
bonding seems to be one of the last offender as caught by syzbot:
WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 skb_mac_offset include/linux/skbuff.h:2913 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_xmit_hash drivers/net/bonding/bond_main.c:4170 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_xmit_3ad_xor_slave_get drivers/net/bonding/bond_main.c:5149 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_3ad_xor_xmit drivers/net/bonding/bond_main.c:5186 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 __bond_start_xmit drivers/net/bonding/bond_main.c:5442 [inline] WARNING: CPU: 1 PID: 12155 at include/linux/skbuff.h:2907 bond_start_xmit+0x14ab/0x19d0 drivers/net/bonding/bond_main.c:5470 Modules linked in: CPU: 1 PID: 12155 Comm: syz-executor.3 Not tainted 6.1.30-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/25/2023 RIP: 0010:skb_mac_header include/linux/skbuff.h:2907 [inline] RIP: 0010:skb_mac_offset include/linux/skbuff.h:2913 [inline] RIP: 0010:bond_xmit_hash drivers/net/bonding/bond_main.c:4170 [inline] RIP: 0010:bond_xmit_3ad_xor_slave_get drivers/net/bonding/bond_main.c:5149 [inline] RIP: 0010:bond_3ad_xor_xmit drivers/net/bonding/bond_main.c:5186 [inline] RIP: 0010:__bond_start_xmit drivers/net/bonding/bond_main.c:5442 [inline] RIP: 0010:bond_start_xmit+0x14ab/0x19d0 drivers/net/bonding/bond_main.c:5470 Code: 8b 7c 24 30 e8 76 dd 1a 01 48 85 c0 74 0d 48 89 c3 e8 29 67 2e fe e9 15 ef ff ff e8 1f 67 2e fe e9 10 ef ff ff e8 15 67 2e fe <0f> 0b e9 45 f8 ff ff e8 09 67 2e fe e9 dc fa ff ff e8 ff 66 2e fe RSP: 0018:ffffc90002fff6e0 EFLAGS: 00010283 RAX: ffffffff835874db RBX: 000000000000ffff RCX: 0000000000040000 RDX: ffffc90004dcf000 RSI: 00000000000000b5 RDI: 00000000000000b6 RBP: ffffc90002fff8b8 R08: ffffffff83586d16 R09: ffffffff83586584 R10: 0000000000000007 R11: ffff8881599fc780 R12: ffff88811b6a7b7e R13: 1ffff110236d4f6f R14: ffff88811b6a7ac0 R15: 1ffff110236d4f76 FS: 00007f2e9eb47700(0000) GS:ffff8881f6b00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000001b2e421000 CR3: 000000010e6d4000 CR4: 00000000003526e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> [<ffffffff8471a49f>] netdev_start_xmit include/linux/netdevice.h:4925 [inline] [<ffffffff8471a49f>] __dev_direct_xmit+0x4ef/0x850 net/core/dev.c:4380 [<ffffffff851d845b>] dev_direct_xmit include/linux/netdevice.h:3043 [inline] [<ffffffff851d845b>] packet_direct_xmit+0x18b/0x300 net/packet/af_packet.c:284 [<ffffffff851c7472>] packet_snd net/packet/af_packet.c:3112 [inline] [<ffffffff851c7472>] packet_sendmsg+0x4a22/0x64d0 net/packet/af_packet.c:3143 [<ffffffff8467a4b2>] sock_sendmsg_nosec net/socket.c:716 [inline] [<ffffffff8467a4b2>] sock_sendmsg net/socket.c:736 [inline] [<ffffffff8467a4b2>] __sys_sendto+0x472/0x5f0 net/socket.c:2139 [<ffffffff8467a715>] __do_sys_sendto net/socket.c:2151 [inline] [<ffffffff8467a715>] __se_sys_sendto net/socket.c:2147 [inline] [<ffffffff8467a715>] __x64_sys_sendto+0xe5/0x100 net/socket.c:2147 [<ffffffff8553071f>] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [<ffffffff8553071f>] do_syscall_64+0x2f/0x50 arch/x86/entry/common.c:80 [<ffffffff85600087>] entry_SYSCALL_64_after_hwframe+0x63/0xcd
--- drivers/net/bonding/bond_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/bonding/bond_main.c +1 -1
@@ -4168,7 +4168,7 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb)return skb->hash;return __bond_xmit_hash (bond, skb, skb->data, skb->protocol, -skb_mac_offset (skb),skb_network_offset (skb), +0 ,skb_network_offset (skb),skb_headlen (skb)); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 130/591 selftests: rtnetlink: remove netdevsim device after ipsec offload test
In reply to Greg Kroah-HartmanFrom: Sabrina Dubroca <[email protected]>
[ Upstream commit 5f789f103671fec3733ebe756e56adf15c90c21d ]
On systems where netdevsim is built-in or loaded before the test starts, kci_test_ipsec_offload doesn't remove the netdevsim device it created during the test.
--- tools/testing/selftests/net/rtnetlink.sh | 1 + 1 file changed, 1 insertion(+)
tools/testing/selftests/net/rtnetlink.sh +1 -0
@@ -835,6 +835,7 @@ EOF fi # clean up any leftovers + echo 0 > /sys/bus/netdevsim/del_device $probed && rmmod netdevsim if [ $ret -ne 0 ]; then
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 131/591 gtp: Fix use-after-free in __gtp_encap_destroy().
In reply to Greg Kroah-HartmanFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit ce3aee7114c575fab32a5e9e939d4bbb3dcca79f ]
syzkaller reported use-after-free in __gtp_encap_destroy(). [0]
It shows the same process freed sk and touched it illegally.
Commit e198987e7dd7 ("gtp: fix suspicious RCU usage") added lock_sock() and release_sock() in __gtp_encap_destroy() to protect sk->sk_user_data, but release_sock() is called after sock_put() releases the last refcnt.
[0]:
BUG: KASAN: slab-use-after-free in instrument_atomic_read_write include/linux/instrumented.h:96 [inline] BUG: KASAN: slab-use-after-free in atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] BUG: KASAN: slab-use-after-free in queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] BUG: KASAN: slab-use-after-free in do_raw_spin_lock include/linux/spinlock.h:186 [inline] BUG: KASAN: slab-use-after-free in __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] BUG: KASAN: slab-use-after-free in _raw_spin_lock_bh+0x75/0xe0 kernel/locking/spinlock.c:178 Write of size 4 at addr ffff88800dbef398 by task syz-executor.2/2401 CPU: 1 PID: 2401 Comm: syz-executor.2 Not tainted 6.4.0-rc5-01219-gfa0e21fa4443 #2 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.16.0-0-gd239552ce722-prebuilt.qemu.org 04/01/2014 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x72/0xa0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:351 [inline] print_report+0xcc/0x620 mm/kasan/report.c:462 kasan_report+0xb2/0xe0 mm/kasan/report.c:572 check_region_inline mm/kasan/generic.c:181 [inline] kasan_check_range+0x39/0x1c0 mm/kasan/generic.c:187 instrument_atomic_read_write include/linux/instrumented.h:96 [inline] atomic_try_cmpxchg_acquire include/linux/atomic/atomic-instrumented.h:541 [inline] queued_spin_lock include/asm-generic/qspinlock.h:111 [inline] do_raw_spin_lock include/linux/spinlock.h:186 [inline] __raw_spin_lock_bh include/linux/spinlock_api_smp.h:127 [inline] _raw_spin_lock_bh+0x75/0xe0 kernel/locking/spinlock.c:178 spin_lock_bh include/linux/spinlock.h:355 [inline] release_sock+0x1f/0x1a0 net/core/sock.c:3526 gtp_encap_disable_sock drivers/net/gtp.c:651 [inline] gtp_encap_disable+0xb9/0x220 drivers/net/gtp.c:664 gtp_dev_uninit+0x19/0x50 drivers/net/gtp.c:728 unregister_netdevice_many_notify+0x97e/0x1520 net/core/dev.c:10841 rtnl_delete_link net/core/rtnetlink.c:3216 [inline] rtnl_dellink+0x3c0/0xb30 net/core/rtnetlink.c:3268 rtnetlink_rcv_msg+0x450/0xb10 net/core/rtnetlink.c:6423 netlink_rcv_skb+0x15d/0x450 net/netlink/af_netlink.c:2548 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x700/0x930 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x91c/0xe30 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0x1b7/0x200 net/socket.c:747 ____sys_sendmsg+0x75a/0x990 net/socket.c:2493 ___sys_sendmsg+0x11d/0x1c0 net/socket.c:2547 __sys_sendmsg+0xfe/0x1d0 net/socket.c:2576 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f1168b1fe5d 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 73 9f 1b 00 f7 d8 64 89 01 48 RSP: 002b:00007f1167edccc8 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00000000004bbf80 RCX: 00007f1168b1fe5d RDX: 0000000000000000 RSI: 00000000200002c0 RDI: 0000000000000003 RBP: 00000000004bbf80 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 000000000000000b R14: 00007f1168b80530 R15: 0000000000000000 </TASK> Allocated by task 1483: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 __kasan_slab_alloc+0x59/0x70 mm/kasan/common.c:328 kasan_slab_alloc include/linux/kasan.h:186 [inline] slab_post_alloc_hook mm/slab.h:711 [inline] slab_alloc_node mm/slub.c:3451 [inline] slab_alloc mm/slub.c:3459 [inline] __kmem_cache_alloc_lru mm/slub.c:3466 [inline] kmem_cache_alloc+0x16d/0x340 mm/slub.c:3475 sk_prot_alloc+0x5f/0x280 net/core/sock.c:2073 sk_alloc+0x34/0x6c0 net/core/sock.c:2132 inet6_create net/ipv6/af_inet6.c:192 [inline] inet6_create+0x2c7/0xf20 net/ipv6/af_inet6.c:119 __sock_create+0x2a1/0x530 net/socket.c:1535 sock_create net/socket.c:1586 [inline] __sys_socket_create net/socket.c:1623 [inline] __sys_socket_create net/socket.c:1608 [inline] __sys_socket+0x137/0x250 net/socket.c:1651 __do_sys_socket net/socket.c:1664 [inline] __se_sys_socket net/socket.c:1662 [inline] __x64_sys_socket+0x72/0xb0 net/socket.c:1662 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 2401: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free mm/kasan/common.c:200 [inline] __kasan_slab_free+0x10c/0x1b0 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3786 [inline] kmem_cache_free+0xb4/0x490 mm/slub.c:3808 sk_prot_free net/core/sock.c:2113 [inline] __sk_destruct+0x500/0x720 net/core/sock.c:2207 sk_destruct+0xc1/0xe0 net/core/sock.c:2222 __sk_free+0xed/0x3d0 net/core/sock.c:2233 sk_free+0x7c/0xa0 net/core/sock.c:2244 sock_put include/net/sock.h:1981 [inline] __gtp_encap_destroy+0x165/0x1b0 drivers/net/gtp.c:634 gtp_encap_disable_sock drivers/net/gtp.c:651 [inline] gtp_encap_disable+0xb9/0x220 drivers/net/gtp.c:664 gtp_dev_uninit+0x19/0x50 drivers/net/gtp.c:728 unregister_netdevice_many_notify+0x97e/0x1520 net/core/dev.c:10841 rtnl_delete_link net/core/rtnetlink.c:3216 [inline] rtnl_dellink+0x3c0/0xb30 net/core/rtnetlink.c:3268 rtnetlink_rcv_msg+0x450/0xb10 net/core/rtnetlink.c:6423 netlink_rcv_skb+0x15d/0x450 net/netlink/af_netlink.c:2548 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x700/0x930 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x91c/0xe30 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0x1b7/0x200 net/socket.c:747 ____sys_sendmsg+0x75a/0x990 net/socket.c:2493 ___sys_sendmsg+0x11d/0x1c0 net/socket.c:2547 __sys_sendmsg+0xfe/0x1d0 net/socket.c:2576 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc The buggy address belongs to the object at ffff88800dbef300 which belongs to the cache UDPv6 of size 1344
The buggy address is located 152 bytes inside of
freed 1344-byte region [ffff88800dbef300, ffff88800dbef840)
The buggy address belongs to the physical page:
page:00000000d31bfed5 refcount:1 mapcount:0 mapping:0000000000000000 index:0xffff88800dbeed40 pfn:0xdbe8 head:00000000d31bfed5 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0 memcg:ffff888008ee0801
flags: 0x100000000010200(slab|head|node=0|zone=1)page_type: 0xffffffff()
raw: 0100000000010200 ffff88800c7a3000 dead000000000122 0000000000000000
raw: ffff88800dbeed40 0000000080160015 00000001ffffffff ffff888008ee0801
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff88800dbef280: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff88800dbef300: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
>ffff88800dbef380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff88800dbef400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff88800dbef480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb--- drivers/net/gtp.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/gtp.c +2 -0
@@ -631,7 +631,9 @@ static void __gtp_encap_destroy(struct sock *sk) gtp->sk1u =NULL ;udp_sk (sk)->encap_type =0 ;rcu_assign_sk_user_data (sk,NULL ); +release_sock (sk);sock_put (sk); +return ; }release_sock (sk); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 132/591 net: axienet: Move reset before 64-bit DMA detection
In reply to Greg Kroah-HartmanFrom: Maxim Kochetkov <[email protected]>
[ Upstream commit f1bc9fc4a06de0108e0dca2a9a7e99ba1fc632f9 ]
64-bit DMA detection will fail if axienet was started before (by boot loader, boot ROM, etc). In this state axienet will not start properly. XAXIDMA_TX_CDESC_OFFSET + 4 register (MM2S_CURDESC_MSB) is used to detect 64-bit DMA capability here. But datasheet says: When DMACR.RS is 1 (axienet is in enabled state), CURDESC_PTR becomes Read Only (RO) and is used to fetch the first descriptor. So iowrite32()/ioread32() trick to this register to detect 64-bit DMA will not work.
So move axienet reset before 64-bit DMA detection.
--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +5 -5
@@ -2043,6 +2043,11 @@ static int axienet_probe(struct platform_device *pdev) goto cleanup_clk; } +/* Reset core now that clocks are enabled, prior to accessing MDIO */ + ret =__axienet_device_reset (lp); +if (ret) + goto cleanup_clk; +/* Autodetect the need for 64-bit DMA pointers. * When the IP is configured for a bus width bigger than 32 bits, * writing the MSB registers is mandatory, even if they are all 0.
@@ -2097,11 +2102,6 @@ static int axienet_probe(struct platform_device *pdev) lp->coalesce_count_tx =XAXIDMA_DFT_TX_THRESHOLD ; lp->coalesce_usec_tx =XAXIDMA_DFT_TX_USEC ; -/* Reset core now that clocks are enabled, prior to accessing MDIO */ - ret =__axienet_device_reset (lp); -if (ret) - goto cleanup_clk; - ret =axienet_mdio_setup (lp);if (ret) dev_warn(&pdev->dev,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 133/591 ocfs2: Fix use of slab data with sendpage
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit 86d7bd6e66e9925f0f04a7bcf3c92c05fdfefb5a ]
ocfs2 uses kzalloc() to allocate buffers for o2net_hand, o2net_keep_req and o2net_keep_resp and then passes these to sendpage. This isn't really allowed as the lifetime of slab objects is not controlled by page ref - though in this case it will probably work. sendmsg() with MSG_SPLICE_PAGES will, however, print a warning and give an error.
Fix it to use folio_alloc() instead to allocate a buffer for the handshake message, keepalive request and reply messages.
--- fs/ocfs2/cluster/tcp.c | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-)
fs/ocfs2/cluster/tcp.c +12 -11
@@ -2083,18 +2083,24 @@ void o2net_stop_listening(struct o2nm_node *node)int o2net_init (void ) { +struct folio *folio; +void *p;unsigned long i;o2quo_init (); -o2net_debugfs_init (); - o2net_hand =kzalloc (sizeof (struct o2net_handshake ),GFP_KERNEL ); - o2net_keep_req =kzalloc (sizeof (struct o2net_msg ),GFP_KERNEL ); - o2net_keep_resp =kzalloc (sizeof (struct o2net_msg ),GFP_KERNEL ); -if (!o2net_hand || !o2net_keep_req || !o2net_keep_resp) + folio =folio_alloc (GFP_KERNEL | __GFP_ZERO,0 ); +if (!folio) goto out; + p =folio_address (folio); + o2net_hand = p; + p +=sizeof (struct o2net_handshake ); + o2net_keep_req = p; + p +=sizeof (struct o2net_msg ); + o2net_keep_resp = p; + o2net_hand->protocol_version =cpu_to_be64 (O2NET_PROTOCOL_VERSION ); o2net_hand->connector_id =cpu_to_be64 (1 );
@@ -2120,9 +2126,6 @@ int o2net_init(void)return 0 ; out: -kfree (o2net_hand); -kfree (o2net_keep_req); -kfree (o2net_keep_resp);o2net_debugfs_exit ();o2quo_exit ();return -ENOMEM ;
@@ -2131,8 +2134,6 @@ int o2net_init(void)void o2net_exit (void ) {o2quo_exit (); -kfree (o2net_hand); -kfree (o2net_keep_req); -kfree (o2net_keep_resp);o2net_debugfs_exit (); +folio_put (virt_to_folio (o2net_hand)); }
Signature · 1 line
2.39.2
Re: [PATCH 6.1 133/591] ocfs2: Fix use of slab data with sendpage
Noticing this patch only here rather than the original post, sorry.
Quoted 2 lines · Greg Kroah-Hartman
From: David Howells <[email protected]>
...
Quoted 5 lines
[ Upstream commit
86d7bd6e66e9925f0f04a7bcf3c92c05fdfefb5a]fs/ocfs2/cluster/tcp.c +0
-4- o2net_hand =kzalloc (sizeof (struct o2net_handshake ),GFP_KERNEL ); - o2net_keep_req =kzalloc (sizeof (struct o2net_msg ),GFP_KERNEL ); - o2net_keep_resp =kzalloc (sizeof (struct o2net_msg ),GFP_KERNEL ); -if (!o2net_hand || !o2net_keep_req || !o2net_keep_resp)
fs/ocfs2/cluster/tcp.c void o2net_stop_listening(struct o2nm_node *node) · line 2102
Quoted 10 lines
fs/ocfs2/cluster/tcp.c +8
-0+ folio =folio_alloc (GFP_KERNEL | __GFP_ZERO,0 ); +if (!folio) goto out; + p =folio_address (folio); + o2net_hand = p; + p +=sizeof (struct o2net_handshake ); + o2net_keep_req = p; + p +=sizeof (struct o2net_msg ); + o2net_keep_resp = p;
Do we care that we aren't validating sizes here? The original code allocates the structures by size. This code grabs an order 0 folio and assumes the total size of these structures is smaller than a page. But while we "know" today that the handshake messages have no payload, o2net_msg.buf could theoretically be filled by more data. What if someone decided to change the code to put some payload in o2net_keep_resp.buf? Yes, we would hope they would think to add the appropriate allocation. But should we be validating this with some kind of safety check?
Thanks,
Joel
Signature · 7 lines
"I almost ran over an angel He had a nice big fat cigar. 'In a sense,' he said, 'You're alone here So if you jump, you'd best jump far.'" http://www.jlbec.org/ [email protected]
Greg Kroah-Hartman
maintainerPATCH 134/591 sfc: fix crash when reading stats while NIC is resetting
In reply to Greg Kroah-HartmanFrom: Edward Cree <[email protected]>
[ Upstream commit d1b355438b8325a486f087e506d412c4e852f37b ]
efx_net_stats() (.ndo_get_stats64) can be called during an ethtool
selftest, during which time nic_data->mc_stats is NULL as the NIC has been fini'd. In this case do not attempt to fetch the latest stats from the hardware, else we will crash on a NULL dereference:
BUG: kernel NULL pointer dereference, address: 0000000000000038
RIP efx_nic_update_stats
abridged calltrace:
efx_ef10_update_stats_pf
efx_net_stats
dev_get_stats
dev_seq_printf_statsSkipping the read is safe, we will simply give out stale stats. To ensure that the free in efx_ef10_fini_nic() does not race against
efx_ef10_update_stats_pf(), which could cause a TOCTTOU bug, take the efx->stats_lock in fini_nic (it is already held across update_stats).
--- drivers/net/ethernet/sfc/ef10.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/net/ethernet/sfc/ef10.c +10 -3
@@ -1297,8 +1297,10 @@ static void efx_ef10_fini_nic(struct efx_nic *efx) {struct efx_ef10_nic_data *nic_data = efx->nic_data; +spin_lock_bh (&efx->stats_lock);kfree (nic_data->mc_stats); nic_data->mc_stats =NULL ; +spin_unlock_bh (&efx->stats_lock); }static int efx_ef10_init_nic (struct efx_nic *efx)
@@ -1852,9 +1854,14 @@ static size_t efx_ef10_update_stats_pf(struct efx_nic *efx, u64 *full_stats,efx_ef10_get_stat_mask (efx, mask); -efx_nic_copy_stats (efx, nic_data->mc_stats); -efx_nic_update_stats (efx_ef10_stat_desc,EF10_STAT_COUNT , - mask, stats, nic_data->mc_stats, false); +/* If NIC was fini'd (probably resetting), then we can't read +* updated stats right now. +*/ +if (nic_data->mc_stats) { +efx_nic_copy_stats (efx, nic_data->mc_stats); +efx_nic_update_stats (efx_ef10_stat_desc,EF10_STAT_COUNT , + mask, stats, nic_data->mc_stats, false); + }/* Update derived statistics */ efx_nic_fix_nodesc_drop_stat(efx,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 135/591 net: nfc: Fix use-after-free caused by nfc_llcp_find_local
In reply to Greg Kroah-HartmanFrom: Lin Ma <[email protected]>
[ Upstream commit 6709d4b7bc2e079241fdef15d1160581c5261c10 ]
This commit fixes several use-after-free that caused by function nfc_llcp_find_local(). For example, one UAF can happen when below buggy time window occurs.
// nfc_genl_llc_get_params | // nfc_unregister_device
|
dev = nfc_get_device(idx); | device_lock(...)
if (!dev) | dev->shutting_down = true;
return -ENODEV; | device_unlock(...);
|
device_lock(...); | // nfc_llcp_unregister_device
| nfc_llcp_find_local()
nfc_llcp_find_local(...); |
| local_cleanup()
if (!local) { |
rc = -ENODEV; | // nfc_llcp_local_put
goto exit; | kref_put(.., local_release)
} |
| // local_release
| list_del(&local->list)
// nfc_genl_send_params | kfree()
local->dev->idx !!!UAF!!! |
|and the crash trace for the one of the discussed UAF like:
BUG: KASAN: slab-use-after-free in nfc_genl_llc_get_params+0x72f/0x780 net/nfc/netlink.c:1045 Read of size 8 at addr ffff888105b0e410 by task 20114 Call Trace: <TASK> __dump_stack lib/dump_stack.c:88 [inline] dump_stack_lvl+0x72/0xa0 lib/dump_stack.c:106 print_address_description mm/kasan/report.c:319 [inline] print_report+0xcc/0x620 mm/kasan/report.c:430 kasan_report+0xb2/0xe0 mm/kasan/report.c:536 nfc_genl_send_params net/nfc/netlink.c:999 [inline] nfc_genl_llc_get_params+0x72f/0x780 net/nfc/netlink.c:1045 genl_family_rcv_msg_doit.isra.0+0x1ee/0x2e0 net/netlink/genetlink.c:968 genl_family_rcv_msg net/netlink/genetlink.c:1048 [inline] genl_rcv_msg+0x503/0x7d0 net/netlink/genetlink.c:1065 netlink_rcv_skb+0x161/0x430 net/netlink/af_netlink.c:2548 genl_rcv+0x28/0x40 net/netlink/genetlink.c:1076 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x644/0x900 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x934/0xe70 net/netlink/af_netlink.c:1913 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0x1b6/0x200 net/socket.c:747 ____sys_sendmsg+0x6e9/0x890 net/socket.c:2501 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2555 __sys_sendmsg+0xf7/0x1d0 net/socket.c:2584 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc RIP: 0033:0x7f34640a2389 RSP: 002b:00007f3463415168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 00007f34641c1f80 RCX: 00007f34640a2389 RDX: 0000000000000000 RSI: 0000000020000240 RDI: 0000000000000006 RBP: 00007f34640ed493 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000 R13: 00007ffe38449ecf R14: 00007f3463415300 R15: 0000000000022000 </TASK> Allocated by task 20116: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 ____kasan_kmalloc mm/kasan/common.c:374 [inline] __kasan_kmalloc+0x7f/0x90 mm/kasan/common.c:383 kmalloc include/linux/slab.h:580 [inline] kzalloc include/linux/slab.h:720 [inline] nfc_llcp_register_device+0x49/0xa40 net/nfc/llcp_core.c:1567 nfc_register_device+0x61/0x260 net/nfc/core.c:1124 nci_register_device+0x776/0xb20 net/nfc/nci/core.c:1257 virtual_ncidev_open+0x147/0x230 drivers/nfc/virtual_ncidev.c:148 misc_open+0x379/0x4a0 drivers/char/misc.c:165 chrdev_open+0x26c/0x780 fs/char_dev.c:414 do_dentry_open+0x6c4/0x12a0 fs/open.c:920 do_open fs/namei.c:3560 [inline] path_openat+0x24fe/0x37e0 fs/namei.c:3715 do_filp_open+0x1ba/0x410 fs/namei.c:3742 do_sys_openat2+0x171/0x4c0 fs/open.c:1356 do_sys_open fs/open.c:1372 [inline] __do_sys_openat fs/open.c:1388 [inline] __se_sys_openat fs/open.c:1383 [inline] __x64_sys_openat+0x143/0x200 fs/open.c:1383 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc Freed by task 20115: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 kasan_set_track+0x25/0x30 mm/kasan/common.c:52 kasan_save_free_info+0x2e/0x50 mm/kasan/generic.c:521 ____kasan_slab_free mm/kasan/common.c:236 [inline] ____kasan_slab_free mm/kasan/common.c:200 [inline] __kasan_slab_free+0x10a/0x190 mm/kasan/common.c:244 kasan_slab_free include/linux/kasan.h:162 [inline] slab_free_hook mm/slub.c:1781 [inline] slab_free_freelist_hook mm/slub.c:1807 [inline] slab_free mm/slub.c:3787 [inline] __kmem_cache_free+0x7a/0x190 mm/slub.c:3800 local_release net/nfc/llcp_core.c:174 [inline] kref_put include/linux/kref.h:65 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:182 [inline] nfc_llcp_local_put net/nfc/llcp_core.c:177 [inline] nfc_llcp_unregister_device+0x206/0x290 net/nfc/llcp_core.c:1620 nfc_unregister_device+0x160/0x1d0 net/nfc/core.c:1179 virtual_ncidev_close+0x52/0xa0 drivers/nfc/virtual_ncidev.c:163 __fput+0x252/0xa20 fs/file_table.c:321 task_work_run+0x174/0x270 kernel/task_work.c:179 resume_user_mode_work include/linux/resume_user_mode.h:49 [inline] exit_to_user_mode_loop kernel/entry/common.c:171 [inline] exit_to_user_mode_prepare+0x108/0x110 kernel/entry/common.c:204 __syscall_exit_to_user_mode_work kernel/entry/common.c:286 [inline] syscall_exit_to_user_mode+0x21/0x50 kernel/entry/common.c:297 do_syscall_64+0x4c/0x90 arch/x86/entry/common.c:86 entry_SYSCALL_64_after_hwframe+0x72/0xdc Last potentially related work creation: kasan_save_stack+0x22/0x50 mm/kasan/common.c:45 __kasan_record_aux_stack+0x95/0xb0 mm/kasan/generic.c:491 kvfree_call_rcu+0x29/0xa80 kernel/rcu/tree.c:3328 drop_sysctl_table+0x3be/0x4e0 fs/proc/proc_sysctl.c:1735 unregister_sysctl_table.part.0+0x9c/0x190 fs/proc/proc_sysctl.c:1773 unregister_sysctl_table+0x24/0x30 fs/proc/proc_sysctl.c:1753 neigh_sysctl_unregister+0x5f/0x80 net/core/neighbour.c:3895 addrconf_notify+0x140/0x17b0 net/ipv6/addrconf.c:3684 notifier_call_chain+0xbe/0x210 kernel/notifier.c:87 call_netdevice_notifiers_info+0xb5/0x150 net/core/dev.c:1937 call_netdevice_notifiers_extack net/core/dev.c:1975 [inline] call_netdevice_notifiers net/core/dev.c:1989 [inline] dev_change_name+0x3c3/0x870 net/core/dev.c:1211 dev_ifsioc+0x800/0xf70 net/core/dev_ioctl.c:376 dev_ioctl+0x3d9/0xf80 net/core/dev_ioctl.c:542 sock_do_ioctl+0x160/0x260 net/socket.c:1213 sock_ioctl+0x3f9/0x670 net/socket.c:1316 vfs_ioctl fs/ioctl.c:51 [inline] __do_sys_ioctl fs/ioctl.c:870 [inline] __se_sys_ioctl fs/ioctl.c:856 [inline] __x64_sys_ioctl+0x19e/0x210 fs/ioctl.c:856 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x3f/0x90 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x72/0xdc The buggy address belongs to the object at ffff888105b0e400 which belongs to the cache kmalloc-1k of size 1024
The buggy address is located 16 bytes inside of
freed 1024-byte region [ffff888105b0e400, ffff888105b0e800)
The buggy address belongs to the physical page:
head:ffffea000416c200 order:3 entire_mapcount:0 nr_pages_mapped:0 pincount:0
flags: 0x200000000010200(slab|head|node=0|zone=2)
raw: 0200000000010200 ffff8881000430c0 ffffea00044c7010 ffffea0004510e10
raw: 0000000000000000 00000000000a000a 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffff888105b0e300: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
ffff888105b0e380: fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc fc
>ffff888105b0e400: fa fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
^
ffff888105b0e480: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
ffff888105b0e500: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fbIn summary, this patch solves those use-after-free by
1. Re-implement the nfc_llcp_find_local(). The current version does not grab the reference when getting the local from the linked list. For example, the llcp_sock_bind() gets the reference like below:
// llcp_sock_bind()
local = nfc_llcp_find_local(dev); // A
..... \
| raceable
..... /
llcp_sock->local = nfc_llcp_local_get(local); // BThere is an apparent race window that one can drop the reference and free the local object fetched in (A) before (B) gets the reference.
2. Some callers of the nfc_llcp_find_local() do not grab the reference at all. For example, the nfc_genl_llc_{{get/set}_params/sdreq} functions. We add the nfc_llcp_local_put() for them. Moreover, we add the necessary error handling function to put the reference.
3. Add the nfc_llcp_remove_local() helper. The local object is removed from the linked list in local_release() when all reference is gone. This patch removes it when nfc_llcp_unregister_device() is called.
Therefore, every caller of nfc_llcp_find_local() will get a reference even when the nfc_llcp_unregister_device() is called. This promises no use-after-free for the local object is ever possible.
--- net/nfc/llcp.h | 1 - net/nfc/llcp_commands.c | 12 +++++++--- net/nfc/llcp_core.c | 49 +++++++++++++++++++++++++++++++++++------ net/nfc/llcp_sock.c | 18 ++++++++------- net/nfc/netlink.c | 20 ++++++++++++----- net/nfc/nfc.h | 1 + 6 files changed, 77 insertions(+), 24 deletions(-)
net/nfc/llcp.h +0 -1
@@ -201,7 +201,6 @@ void nfc_llcp_sock_link(struct llcp_sock_list *l, struct sock *s);void nfc_llcp_sock_unlink (struct llcp_sock_list *l,struct sock *s);void nfc_llcp_socket_remote_param_init (struct nfc_llcp_sock *sock);struct nfc_llcp_local *nfc_llcp_find_local (struct nfc_dev *dev); -struct nfc_llcp_local *nfc_llcp_local_get (struct nfc_llcp_local *local);int nfc_llcp_local_put (struct nfc_llcp_local *local);u8 nfc_llcp_get_sdp_ssap (struct nfc_llcp_local *local,struct nfc_llcp_sock *sock);
net/nfc/llcp_commands.c +9 -3
@@ -359,6 +359,7 @@ int nfc_llcp_send_symm(struct nfc_dev *dev)struct sk_buff *skb;struct nfc_llcp_local *local;u16 size =0 ; +int err; local =nfc_llcp_find_local (dev);if (local ==NULL )
@@ -368,8 +369,10 @@ int nfc_llcp_send_symm(struct nfc_dev *dev) size += dev->tx_headroom + dev->tx_tailroom +NFC_HEADER_SIZE ; skb =alloc_skb (size,GFP_KERNEL ); -if (skb ==NULL ) -return -ENOMEM ; +if (skb ==NULL ) { + err = -ENOMEM ; + goto out; + }skb_reserve (skb, dev->tx_headroom +NFC_HEADER_SIZE );
@@ -379,8 +382,11 @@ int nfc_llcp_send_symm(struct nfc_dev *dev)nfc_llcp_send_to_raw_sock (local, skb,NFC_DIRECTION_TX ); -return nfc_data_exchange (dev, local->target_idx, skb, + err =nfc_data_exchange (dev, local->target_idx, skb, nfc_llcp_recv, local); +out: +nfc_llcp_local_put (local); +return err; }int nfc_llcp_send_connect (struct nfc_llcp_sock *sock)
net/nfc/llcp_core.c +42 -7
123 lines not on this page · raw message
net/nfc/llcp_sock.c +10 -8
@@ -99,7 +99,7 @@ static int llcp_sock_bind(struct socket *sock, struct sockaddr *addr, int alen) } llcp_sock->dev = dev; - llcp_sock->local =nfc_llcp_local_get (local); + llcp_sock->local = local; llcp_sock->nfc_protocol = llcp_addr.nfc_protocol; llcp_sock->service_name_len = min_t(unsigned int, llcp_addr.service_name_len,
@@ -186,7 +186,7 @@ static int llcp_raw_sock_bind(struct socket *sock, struct sockaddr *addr, } llcp_sock->dev = dev; - llcp_sock->local =nfc_llcp_local_get (local); + llcp_sock->local = local; llcp_sock->nfc_protocol = llcp_addr.nfc_protocol;nfc_llcp_sock_link (&local->raw_sockets, sk);
@@ -696,22 +696,22 @@ static int llcp_sock_connect(struct socket *sock, struct sockaddr *_addr,if (dev->dep_link_up == false) { ret = -ENOLINK ;device_unlock (&dev->dev); - goto put_dev; + goto sock_llcp_put_local; }device_unlock (&dev->dev);if (local->rf_mode ==NFC_RF_INITIATOR && addr->target_idx != local->target_idx) { ret = -ENOLINK ; - goto put_dev; + goto sock_llcp_put_local; } llcp_sock->dev = dev; - llcp_sock->local =nfc_llcp_local_get (local); + llcp_sock->local = local; llcp_sock->ssap =nfc_llcp_get_local_ssap (local);if (llcp_sock->ssap ==LLCP_SAP_MAX ) { ret = -ENOMEM ; - goto sock_llcp_put_local; + goto sock_llcp_nullify; } llcp_sock->reserved_ssap = llcp_sock->ssap;
@@ -757,11 +757,13 @@ static int llcp_sock_connect(struct socket *sock, struct sockaddr *_addr, sock_llcp_release:nfc_llcp_put_ssap (local, llcp_sock->ssap); -sock_llcp_put_local: -nfc_llcp_local_put (llcp_sock->local); +sock_llcp_nullify: llcp_sock->local =NULL ; llcp_sock->dev =NULL ; +sock_llcp_put_local: +nfc_llcp_local_put (local); + put_dev:nfc_put_device (dev);
net/nfc/netlink.c +15 -5
@@ -1039,11 +1039,14 @@ static int nfc_genl_llc_get_params(struct sk_buff *skb, struct genl_info *info) msg =nlmsg_new (NLMSG_DEFAULT_SIZE ,GFP_KERNEL );if (!msg) { rc = -ENOMEM ; - goto exit; + goto put_local; } rc =nfc_genl_send_params (msg, local, info->snd_portid, info->snd_seq); +put_local: +nfc_llcp_local_put (local); + exit:device_unlock (&dev->dev);
@@ -1105,7 +1108,7 @@ static int nfc_genl_llc_set_params(struct sk_buff *skb, struct genl_info *info)if (info->attrs[NFC_ATTR_LLC_PARAM_LTO ]) {if (dev->dep_link_up) { rc = -EINPROGRESS ; - goto exit; + goto put_local; } local->lto =nla_get_u8 (info->attrs[NFC_ATTR_LLC_PARAM_LTO ]);
@@ -1117,6 +1120,9 @@ static int nfc_genl_llc_set_params(struct sk_buff *skb, struct genl_info *info)if (info->attrs[NFC_ATTR_LLC_PARAM_MIUX ]) local->miux =cpu_to_be16 (miux); +put_local: +nfc_llcp_local_put (local); + exit:device_unlock (&dev->dev);
@@ -1172,7 +1178,7 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct genl_info *info)if (rc !=0 ) { rc = -EINVAL ; - goto exit; + goto put_local; }if (!sdp_attrs[NFC_SDP_ATTR_URI ])
@@ -1191,7 +1197,7 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct genl_info *info) sdreq =nfc_llcp_build_sdreq_tlv (tid, uri, uri_len);if (sdreq ==NULL ) { rc = -ENOMEM ; - goto exit; + goto put_local; } tlvs_len += sdreq->tlv_len;
@@ -1201,10 +1207,14 @@ static int nfc_genl_llc_sdreq(struct sk_buff *skb, struct genl_info *info)if (hlist_empty (&sdreq_list)) { rc = -EINVAL ; - goto exit; + goto put_local; } rc =nfc_llcp_send_snl_sdreq (local, &sdreq_list, tlvs_len); + +put_local: +nfc_llcp_local_put (local); + exit:device_unlock (&dev->dev);
net/nfc/nfc.h +1 -0
@@ -52,6 +52,7 @@ int nfc_llcp_set_remote_gb(struct nfc_dev *dev, const u8 *gb, u8 gb_len);u8 *nfc_llcp_general_bytes (struct nfc_dev *dev,size_t *general_bytes_len);int nfc_llcp_data_received (struct nfc_dev *dev,struct sk_buff *skb);struct nfc_llcp_local *nfc_llcp_find_local (struct nfc_dev *dev); +int nfc_llcp_local_put (struct nfc_llcp_local *local);int __init nfc_llcp_init (void );void nfc_llcp_exit (void );void nfc_llcp_free_sdp_tlv (struct nfc_llcp_sdp_tlv *sdp);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 136/591 lib/ts_bm: reset initial match offset for every block of text
In reply to Greg Kroah-HartmanFrom: Jeremy Sowden <[email protected]>
[ Upstream commit 6f67fbf8192da80c4db01a1800c7fceaca9cf1f9 ]
The shift variable which indicates the offset in the string at which to start matching the pattern is initialized to bm->patlen - 1, but it is not reset when a new block is retrieved. This means the implemen- tation may start looking at later and later positions in each successive block and miss occurrences of the pattern at the beginning. E.g., consider a HTTP packet held in a non-linear skb, where the HTTP request line occurs in the second block:
[... 52 bytes of packet headers ...]
GET /bmtest HTTP/1.1\r\nHost: www.example.com\r\n\r\n
and the pattern is "GET /bmtest".
Once the first block comprising the packet headers has been examined, shift will be pointing to somewhere near the end of the block, and so when the second block is examined the request line at the beginning will be missed.
Reinitialize the variable for each new block.
--- lib/ts_bm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
lib/ts_bm.c +3 -1
@@ -60,10 +60,12 @@ static unsigned int bm_find(struct ts_config *conf, struct ts_state *state)struct ts_bm *bm =ts_config_priv (conf);unsigned int i, text_len, consumed = state->offset;const u8 *text; -int shift = bm->patlen -1 , bs; +int bs;const u8 icase = conf->flags &TS_IGNORECASE ;for (;;) { +int shift = bm->patlen -1 ; + text_len = conf->get_next_block (consumed, &text, conf, state);if (unlikely (text_len ==0 ))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 137/591 netfilter: conntrack: dccp: copy entire header to stack buffer, not just basic one
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
[ Upstream commit ff0a3a7d52ff7282dbd183e7fc29a1fe386b0c30 ]
Eric Dumazet says:
nf_conntrack_dccp_packet() has an unique:
dh = skb_header_pointer(skb, dataoff, sizeof(_dh), &_dh);
And nothing more is 'pulled' from the packet, depending on the content. dh->dccph_doff, and/or dh->dccph_x ...)
So dccp_ack_seq() is happily reading stuff past the _dh buffer.
BUG: KASAN: stack-out-of-bounds in nf_conntrack_dccp_packet+0x1134/0x11c0 Read of size 4 at addr ffff000128f66e0c by task syz-executor.2/29371
[..]
Fix this by increasing the stack buffer to also include room for the extra sequence numbers and all the known dccp packet type headers, then pull again after the initial validation of the basic header.
While at it, mark packets invalid that lack 48bit sequence bit but where RFC says the type MUST use them.
Compile tested only.
v2: first skb_header_pointer() now needs to adjust the size to
only pull the generic header. (Eric)
Heads-up: I intend to remove dccp conntrack support later this year.
--- net/netfilter/nf_conntrack_proto_dccp.c | 52 +++++++++++++++++++++++-- 1 file changed, 49 insertions(+), 3 deletions(-)
net/netfilter/nf_conntrack_proto_dccp.c +49 -3
@@ -432,9 +432,19 @@ static bool dccp_error(const struct dccp_hdr *dh, struct sk_buff *skb, unsigned int dataoff, const struct nf_hook_state *state) { +static const unsigned long require_seq48 =1 <<DCCP_PKT_REQUEST | +1 <<DCCP_PKT_RESPONSE | +1 <<DCCP_PKT_CLOSEREQ | +1 <<DCCP_PKT_CLOSE | +1 <<DCCP_PKT_RESET | +1 <<DCCP_PKT_SYNC | +1 <<DCCP_PKT_SYNCACK ;unsigned int dccp_len = skb->len - dataoff;unsigned int cscov;const char *msg; +u8 type; + +BUILD_BUG_ON (DCCP_PKT_INVALID >=BITS_PER_LONG );if (dh->dccph_doff *4 <sizeof (struct dccp_hdr ) || dh->dccph_doff *4 > dccp_len) {
@@ -459,34 +469,70 @@ static bool dccp_error(const struct dccp_hdr *dh, goto out_invalid; } -if (dh->dccph_type >=DCCP_PKT_INVALID ) { + type = dh->dccph_type; +if (type >=DCCP_PKT_INVALID ) { msg ="nf_ct_dccp: reserved packet type " ; goto out_invalid; } + +if (test_bit (type, &require_seq48) && !dh->dccph_x) { + msg ="nf_ct_dccp: type lacks 48bit sequence numbers" ; + goto out_invalid; + } +return false; out_invalid:nf_l4proto_log_invalid (skb, state,IPPROTO_DCCP ,"%s" , msg);return true; } +struct nf_conntrack_dccp_buf { +struct dccp_hdr dh;/* generic header part */ +struct dccp_hdr_ext ext;/* optional depending dh->dccph_x */ +union {/* depends on header type */ +struct dccp_hdr_ack_bits ack; +struct dccp_hdr_request req; +struct dccp_hdr_response response; +struct dccp_hdr_reset rst; + } u; +}; + +static struct dccp_hdr * +dccp_header_pointer (const struct sk_buff *skb,int offset,const struct dccp_hdr *dh, +struct nf_conntrack_dccp_buf *buf) +{ +unsigned int hdrlen =__dccp_hdr_len (dh); + +if (hdrlen >sizeof (*buf)) +return NULL ; + +return skb_header_pointer (skb, offset, hdrlen, buf); +} +int nf_conntrack_dccp_packet (struct nf_conn *ct,struct sk_buff *skb,unsigned int dataoff,enum ip_conntrack_info ctinfo,const struct nf_hook_state *state) {enum ip_conntrack_dir dir =CTINFO2DIR (ctinfo); -struct dccp_hdr _dh, *dh; +struct nf_conntrack_dccp_buf _dh;u_int8_t type, old_state, new_state;enum ct_dccp_roles role;unsigned int *timeouts; +struct dccp_hdr *dh; - dh =skb_header_pointer (skb, dataoff,sizeof (_dh), &_dh); + dh =skb_header_pointer (skb, dataoff,sizeof (*dh), &_dh.dh);if (!dh)return NF_DROP ;if (dccp_error (dh, skb, dataoff, state))return -NF_ACCEPT ; +/* pull again, including possible 48 bit sequences and subtype header */ + dh =dccp_header_pointer (skb, dataoff, dh, &_dh); +if (!dh) +return NF_DROP ; + type = dh->dccph_type;if (!nf_ct_is_confirmed (ct) && !dccp_new (ct, skb, dh, state))return -NF_ACCEPT ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 138/591 netfilter: nf_conntrack_sip: fix the ct_sip_parse_numerical_param() return value.
In reply to Greg Kroah-HartmanFrom: Ilia.Gavrilov <[email protected]>
[ Upstream commit f188d30087480eab421cd8ca552fb15f55d57f4d ]
ct_sip_parse_numerical_param() returns only 0 or 1 now.
But process_register_request() and process_register_response() imply checking for a negative value if parsing of a numerical header parameter failed.
The invocation in nf_nat_sip() looks correct:
if (ct_sip_parse_numerical_param(...) > 0 &&
...) { ... }
Make the return value of the function ct_sip_parse_numerical_param() a tristate to fix all the cases
a) return 1 if value is found; *val is set
b) return 0 if value is not found; *val is unchanged
c) return -1 on error; *val is undefined
Found by InfoTeCS on behalf of Linux Verification Center (linuxtesting.org) with SVACE.
--- net/netfilter/nf_conntrack_sip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/netfilter/nf_conntrack_sip.c +1 -1
@@ -611,7 +611,7 @@ int ct_sip_parse_numerical_param(const struct nf_conn *ct, const char *dptr, start +=strlen (name); *val =simple_strtoul (start, &end,0 );if (start == end) -return 0 ; +return -1 ;if (matchoff && matchlen) { *matchoff = start - dptr; *matchlen = end - start;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 139/591 ipvlan: Fix return value of ipvlan_queue_xmit()
In reply to Greg Kroah-HartmanFrom: Cambda Zhu <[email protected]>
[ Upstream commit 8a9922e7be6d042fa00f894c376473b17a162b66 ]
ipvlan_queue_xmit() should return NET_XMIT_XXX, but ipvlan_xmit_mode_l2/l3() returns rx_handler_result_t or NET_RX_XXX in some cases. ipvlan_rcv_frame() will only return RX_HANDLER_CONSUMED in ipvlan_xmit_mode_l2/l3() because 'local' is true. It's equal to NET_XMIT_SUCCESS. But dev_forward_skb() can return NET_RX_SUCCESS or NET_RX_DROP, and returning NET_RX_DROP(NET_XMIT_DROP) will increase both ipvlan and ipvlan->phy_dev drops counter.
The skb to forward can be treated as xmitted successfully. This patch makes ipvlan_queue_xmit() return NET_XMIT_SUCCESS for forward skb.
--- drivers/net/ipvlan/ipvlan_core.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ipvlan/ipvlan_core.c +6 -3
@@ -585,7 +585,8 @@ static int ipvlan_xmit_mode_l3(struct sk_buff *skb, struct net_device *dev)consume_skb (skb);return NET_XMIT_DROP ; } -return ipvlan_rcv_frame (addr, &skb, true); +ipvlan_rcv_frame (addr, &skb, true); +return NET_XMIT_SUCCESS ; } } out:
@@ -611,7 +612,8 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)consume_skb (skb);return NET_XMIT_DROP ; } -return ipvlan_rcv_frame (addr, &skb, true); +ipvlan_rcv_frame (addr, &skb, true); +return NET_XMIT_SUCCESS ; } } skb =skb_share_check (skb,GFP_ATOMIC );
@@ -623,7 +625,8 @@ static int ipvlan_xmit_mode_l2(struct sk_buff *skb, struct net_device *dev)* the skb for the main-dev. At the RX side we just return * RX_PASS for it to be processed further on the stack. */ -return dev_forward_skb (ipvlan->phy_dev, skb); +dev_forward_skb (ipvlan->phy_dev, skb); +return NET_XMIT_SUCCESS ; }else if (is_multicast_ether_addr (eth->h_dest)) {skb_reset_mac_header (skb);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 140/591 netlink: Add __sock_i_ino() for __netlink_diag_dump().
In reply to Greg Kroah-HartmanFrom: Kuniyuki Iwashima <[email protected]>
[ Upstream commit 25a9c8a4431c364f97f75558cb346d2ad3f53fbb ]
syzbot reported a warning in __local_bh_enable_ip(). [0]
Commit 8d61f926d420 ("netlink: fix potential deadlock in netlink_set_err()") converted read_lock(&nl_table_lock) to read_lock_irqsave() in __netlink_diag_dump() to prevent a deadlock.
However, __netlink_diag_dump() calls sock_i_ino() that uses read_lock_bh() and read_unlock_bh(). If CONFIG_TRACE_IRQFLAGS=y, read_unlock_bh() finally enables IRQ even though it should stay disabled until the following read_unlock_irqrestore().
Using read_lock() in sock_i_ino() would trigger a lockdep splat in another place that was fixed in commit f064af1e500a ("net: fix a lockdep splat"), so let's add __sock_i_ino() that would be safe to use under BH disabled.
[0]:
WARNING: CPU: 0 PID: 5012 at kernel/softirq.c:376 __local_bh_enable_ip+0xbe/0x130 kernel/softirq.c:376 Modules linked in: CPU: 0 PID: 5012 Comm: syz-executor487 Not tainted 6.4.0-rc7-syzkaller-00202-g6f68fc395f49 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 05/27/2023 RIP: 0010:__local_bh_enable_ip+0xbe/0x130 kernel/softirq.c:376 Code: 45 bf 01 00 00 00 e8 91 5b 0a 00 e8 3c 15 3d 00 fb 65 8b 05 ec e9 b5 7e 85 c0 74 58 5b 5d c3 65 8b 05 b2 b6 b4 7e 85 c0 75 a2 <0f> 0b eb 9e e8 89 15 3d 00 eb 9f 48 89 ef e8 6f 49 18 00 eb a8 0f RSP: 0018:ffffc90003a1f3d0 EFLAGS: 00010046 RAX: 0000000000000000 RBX: 0000000000000201 RCX: 1ffffffff1cf5996 RDX: 0000000000000000 RSI: 0000000000000201 RDI: ffffffff8805c6f3 RBP: ffffffff8805c6f3 R08: 0000000000000001 R09: ffff8880152b03a3 R10: ffffed1002a56074 R11: 0000000000000005 R12: 00000000000073e4 R13: dffffc0000000000 R14: 0000000000000002 R15: 0000000000000000 FS: 0000555556726300(0000) GS:ffff8880b9800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000000000045ad50 CR3: 000000007c646000 CR4: 00000000003506f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: <TASK> sock_i_ino+0x83/0xa0 net/core/sock.c:2559 __netlink_diag_dump+0x45c/0x790 net/netlink/diag.c:171 netlink_diag_dump+0xd6/0x230 net/netlink/diag.c:207 netlink_dump+0x570/0xc50 net/netlink/af_netlink.c:2269 __netlink_dump_start+0x64b/0x910 net/netlink/af_netlink.c:2374 netlink_dump_start include/linux/netlink.h:329 [inline] netlink_diag_handler_dump+0x1ae/0x250 net/netlink/diag.c:238 __sock_diag_cmd net/core/sock_diag.c:238 [inline] sock_diag_rcv_msg+0x31e/0x440 net/core/sock_diag.c:269 netlink_rcv_skb+0x165/0x440 net/netlink/af_netlink.c:2547 sock_diag_rcv+0x2a/0x40 net/core/sock_diag.c:280 netlink_unicast_kernel net/netlink/af_netlink.c:1339 [inline] netlink_unicast+0x547/0x7f0 net/netlink/af_netlink.c:1365 netlink_sendmsg+0x925/0xe30 net/netlink/af_netlink.c:1914 sock_sendmsg_nosec net/socket.c:724 [inline] sock_sendmsg+0xde/0x190 net/socket.c:747 ____sys_sendmsg+0x71c/0x900 net/socket.c:2503 ___sys_sendmsg+0x110/0x1b0 net/socket.c:2557 __sys_sendmsg+0xf7/0x1c0 net/socket.c:2586 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x39/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x63/0xcd RIP: 0033:0x7f5303aaabb9 Code: 28 c3 e8 2a 14 00 00 66 2e 0f 1f 84 00 00 00 00 00 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 c7 c1 c0 ff ff ff f7 d8 64 89 01 48 RSP: 002b:00007ffc7506e548 EFLAGS: 00000246 ORIG_RAX: 000000000000002e RAX: ffffffffffffffda RBX: 0000000000000000 RCX: 00007f5303aaabb9 RDX: 0000000000000000 RSI: 0000000020000180 RDI: 0000000000000003 RBP: 00007f5303a6ed60 R08: 0000000000000000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000246 R12: 00007f5303a6edf0 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 </TASK>
--- include/net/sock.h | 1 + net/core/sock.c | 17 ++++++++++++++--- net/netlink/diag.c | 2 +- 3 files changed, 16 insertions(+), 4 deletions(-)
include/net/sock.h +1 -0
@@ -2124,6 +2124,7 @@ static inline void sock_graft(struct sock *sk, struct socket *parent) }kuid_t sock_i_uid (struct sock *sk); +unsigned long __sock_i_ino (struct sock *sk);unsigned long sock_i_ino (struct sock *sk);static inline kuid_t sock_net_uid (const struct net *net,const struct sock *sk)
net/core/sock.c +14 -3
@@ -2542,13 +2542,24 @@ kuid_t sock_i_uid(struct sock *sk) }EXPORT_SYMBOL (sock_i_uid); -unsigned long sock_i_ino (struct sock *sk) +unsigned long __sock_i_ino (struct sock *sk) {unsigned long ino; -read_lock_bh (&sk->sk_callback_lock); +read_lock (&sk->sk_callback_lock); ino = sk->sk_socket ?SOCK_INODE (sk->sk_socket)->i_ino :0 ; -read_unlock_bh (&sk->sk_callback_lock); +read_unlock (&sk->sk_callback_lock); +return ino; +} +EXPORT_SYMBOL (__sock_i_ino); + +unsigned long sock_i_ino (struct sock *sk) +{ +unsigned long ino; + +local_bh_disable (); + ino =__sock_i_ino (sk); +local_bh_enable ();return ino; }EXPORT_SYMBOL (sock_i_ino);
net/netlink/diag.c +1 -1
@@ -168,7 +168,7 @@ static int __netlink_diag_dump(struct sk_buff *skb, struct netlink_callback *cb, NETLINK_CB(cb->skb).portid, cb->nlh->nlmsg_seq, NLM_F_MULTI, - sock_i_ino(sk)) < 0) { + __sock_i_ino(sk)) < 0) { ret =1 ;break ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 141/591 drm/amd/display: Add logging for display MALL refresh setting
In reply to Greg Kroah-HartmanFrom: Wesley Chalmers <[email protected]>
[ Upstream commit cd8f067a46d34dee3188da184912ae3d64d98444 ]
[WHY]
Add log entry for when display refresh from MALL
settings are sent to SMU.
--- .../drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn30/dcn30_clk_mgr_smu_msg.c +3 -0
@@ -312,6 +312,9 @@ void dcn30_smu_set_display_refresh_from_mall(struct clk_mgr_internal *clk_mgr, b/* bits 8:7 for cache timer scale, bits 6:1 for cache timer delay, bit 0 = 1 for enable, = 0 for disable */ uint32_t param = (cache_timer_scale <<7 ) | (cache_timer_delay <<1 ) | (enable ?1 :0 ); +smu_print ("SMU Set display refresh from mall: enable = %d, cache_timer_delay = %d, cache_timer_scale = %d\n" , + enable, cache_timer_delay, cache_timer_scale); +dcn30_smu_send_msg_with_param (clk_mgr, DALSMC_MSG_SetDisplayRefreshFromMall, param,NULL ); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 142/591 radeon: avoid double free in ci_dpm_init()
In reply to Greg Kroah-HartmanFrom: Nikita Zhandarovich <[email protected]>
[ Upstream commit 20c3dffdccbd494e0dd631d1660aeecbff6775f2 ]
Several calls to ci_dpm_fini() will attempt to free resources that either have been freed before or haven't been allocated yet. This may lead to undefined or dangerous behaviour.
For instance, if r600_parse_extended_power_table() fails, it might call r600_free_extended_power_table() as will ci_dpm_fini() later during error handling.
Fix this by only freeing pointers to objects previously allocated.
Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE.
--- drivers/gpu/drm/radeon/ci_dpm.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-)
drivers/gpu/drm/radeon/ci_dpm.c +20 -8
@@ -5517,6 +5517,7 @@ static int ci_parse_power_table(struct radeon_device *rdev)u8 frev, crev;u8 *power_state_offset;struct ci_ps *ps; +int ret;if (!atom_parse_data_header (mode_info->atom_context, index,NULL , &frev, &crev, &data_offset))
@@ -5546,11 +5547,15 @@ static int ci_parse_power_table(struct radeon_device *rdev) non_clock_array_index = power_state->v2.nonClockInfoIndex; non_clock_info = (struct _ATOM_PPLIB_NONCLOCK_INFO *) &non_clock_info_array->nonClockInfo[non_clock_array_index]; -if (!rdev->pm.power_state[i].clock_info) -return -EINVAL ; +if (!rdev->pm.power_state[i].clock_info) { + ret = -EINVAL ; + goto err_free_ps; + } ps =kzalloc (sizeof (struct ci_ps ),GFP_KERNEL ); -if (ps ==NULL ) -return -ENOMEM ; +if (ps ==NULL ) { + ret = -ENOMEM ; + goto err_free_ps; + } rdev->pm.dpm.ps[i].ps_priv = ps; ci_parse_pplib_non_clock_info(rdev, &rdev->pm.dpm.ps[i], non_clock_info,
@@ -5590,6 +5595,12 @@ static int ci_parse_power_table(struct radeon_device *rdev) }return 0 ; + +err_free_ps: +for (i =0 ; i < rdev->pm.dpm.num_ps; i++) +kfree (rdev->pm.dpm.ps[i].ps_priv); +kfree (rdev->pm.dpm.ps); +return ret; } static int ci_get_vbios_boot_values(struct radeon_device *rdev,
@@ -5678,25 +5689,26 @@ int ci_dpm_init(struct radeon_device *rdev) ret =ci_get_vbios_boot_values (rdev, &pi->vbios_boot_state);if (ret) { -ci_dpm_fini (rdev); +kfree (rdev->pm.dpm.priv);return ret; } ret =r600_get_platform_caps (rdev);if (ret) { -ci_dpm_fini (rdev); +kfree (rdev->pm.dpm.priv);return ret; } ret =r600_parse_extended_power_table (rdev);if (ret) { -ci_dpm_fini (rdev); +kfree (rdev->pm.dpm.priv);return ret; } ret =ci_parse_power_table (rdev);if (ret) { -ci_dpm_fini (rdev); +kfree (rdev->pm.dpm.priv); +r600_free_extended_power_table (rdev);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 143/591 drm/amd/display: Explicitly specify update type per plane info change
In reply to Greg Kroah-HartmanFrom: Nicholas Kazlauskas <[email protected]>
[ Upstream commit 710cc1e7cd461446a9325c9bd1e9a54daa462952 ]
[Why]
The bit for flip addr is being set causing the determination for FAST vs MEDIUM to always return MEDIUM when plane info is provided as a surface update. This causes extreme stuttering for the typical atomic update path on Linux.
[How]
Don't use update_flags->raw for determining FAST vs MEDIUM. It's too fragile to changes like this.
Explicitly specify the update type per update flag instead. It's not as clever as checking the bits itself but at least it's correct.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 3 --- 1 file changed, 3 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +0 -3
@@ -2360,9 +2360,6 @@ static enum surface_update_type det_surface_update(const struct dc *dc,enum surface_update_type overall_type =UPDATE_TYPE_FAST ;union surface_update_flags *update_flags = &u->surface->update_flags; -if (u->flip_addr) - update_flags->bits.addr_update =1 ; -if (!is_surface_in_context (context, u->surface) || u->surface->force_full_update) { update_flags->raw =0xFFFFFFFF ;return UPDATE_TYPE_FULL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 144/591 drm/bridge: it6505: Move a variable assignment behind a null pointer check in receive_timing_debugfs_show()
In reply to Greg Kroah-HartmanFrom: Markus Elfring <[email protected]>
[ Upstream commit 0be05a75de2916421e88e0d64b001984f54df0bd ]
The address of a data structure member was determined before a corresponding null pointer check in the implementation of the function “receive_timing_debugfs_show”.
Thus avoid the risk for undefined behaviour by moving the assignment for the variable “vid” behind the null pointer check.
This issue was detected by using the Coccinelle software.
--- drivers/gpu/drm/bridge/ite-it6505.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/ite-it6505.c +2 -1
@@ -3085,7 +3085,7 @@ static ssize_t receive_timing_debugfs_show(struct file *file, char __user *buf, size_t len, loff_t *ppos) { struct it6505 *it6505 = file->private_data; -struct drm_display_mode *vid = &it6505->video_info; +struct drm_display_mode *vid;u8 read_buf[READ_BUFFER_SIZE ];u8 *str = read_buf, *end = read_buf +READ_BUFFER_SIZE ;ssize_t ret, count;
@@ -3094,6 +3094,7 @@ static ssize_t receive_timing_debugfs_show(struct file *file, char __user *buf,return -ENODEV ;it6505_calc_video_info (it6505); + vid = &it6505->video_info; str +=scnprintf (str, end - str,"---video timing---\n" ); str +=scnprintf (str, end - str,"PCLK:%d.%03dMHz\n" , vid->clock /1000 , vid->clock %1000 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 145/591 Input: drv260x - sleep between polling GO bit
In reply to Greg Kroah-HartmanFrom: Luca Weiss <[email protected]>
[ Upstream commit efef661dfa6bf8cbafe4cd6a97433fcef0118967 ]
When doing the initial startup there's no need to poll without any delay and spam the I2C bus.
Let's sleep 15ms between each attempt, which is the same time as used in the vendor driver.
--- drivers/input/misc/drv260x.c | 1 + 1 file changed, 1 insertion(+)
drivers/input/misc/drv260x.c +1 -0
@@ -435,6 +435,7 @@ static int drv260x_init(struct drv260x_data *haptics) } do { + usleep_range(15000, 15500); error = regmap_read(haptics->regmap, DRV260X_GO, &cal_buf); if (error) { dev_err(&haptics->client->dev,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 146/591 drm/bridge: ti-sn65dsi83: Fix enable error path
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit 8a91b29f1f50ce7742cdbe5cf11d17f128511f3f ]
If PLL locking failed, the regulator needs to be disabled again.
--- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +1 -0
@@ -478,6 +478,7 @@ static void sn65dsi83_atomic_enable(struct drm_bridge *bridge,dev_err (ctx->dev,"failed to lock PLL, ret=%i\n" , ret);/* On failure, disable PLL again and exit. */ regmap_write (ctx->regmap,REG_RC_PLL_EN ,0x00 ); +regulator_disable (ctx->vcc);return ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 147/591 drm/bridge: tc358768: always enable HS video mode
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit 75a8aeac2573ab258c53676eba9b3796ea691988 ]
Always enable HS video mode setting the TXMD bit, without this change no video output is present with DSI sinks that are setting MIPI_DSI_MODE_LPM flag (tested with LT8912B DSI-HDMI bridge).
Previously the driver was enabling HS mode only when the DSI sink was not explicitly setting the MIPI_DSI_MODE_LPM, however this is not correct.
The MIPI_DSI_MODE_LPM is supposed to indicate that the sink is willing to receive data in low power mode, however clearing the TC358768_DSI_CONTROL_TXMD bit will make the TC358768 send video in LP mode that is not the intended behavior.
--- drivers/gpu/drm/bridge/tc358768.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/bridge/tc358768.c +1 -2
@@ -867,8 +867,7 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge) val =TC358768_DSI_CONFW_MODE_SET |TC358768_DSI_CONFW_ADDR_DSI_CONTROL ; val |= (dsi_dev->lanes -1 ) <<1 ; -if (!(dsi_dev->mode_flags &MIPI_DSI_MODE_LPM )) - val |=TC358768_DSI_CONTROL_TXMD ; + val |=TC358768_DSI_CONTROL_TXMD ;if (!(mode_flags &MIPI_DSI_CLOCK_NON_CONTINUOUS )) val |=TC358768_DSI_CONTROL_HSCKMD ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 148/591 drm/bridge: tc358768: fix PLL parameters computation
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit 6a4020b4c63911977aaf8047f904a300d15de739 ]
According to Toshiba documentation the PLL input clock after the divider should be not less than 4MHz, fix the PLL parameters computation accordingly.
--- drivers/gpu/drm/bridge/tc358768.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358768.c +5 -1
@@ -335,13 +335,17 @@ static int tc358768_calc_pll(struct tc358768_priv *priv,u32 fbd;for (fbd =0 ; fbd <512 ; ++fbd) { -u32 pll, diff; +u32 pll, diff, pll_in; pll = (u32 )div_u64 ((u64 )refclk * (fbd +1 ), divisor);if (pll >= max_pll || pll < min_pll)continue ; + pll_in = (u32 )div_u64 ((u64 )refclk, prd +1 ); +if (pll_in <4000000 ) +continue ; + diff =max (pll, target_pll) -min (pll, target_pll);if (diff < best_diff) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 149/591 drm/bridge: tc358768: fix PLL target frequency
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit ffd2e4bbea626d565b9817312b0fcfb382fecb88 ]
Correctly compute the PLL target frequency, the current formula works correctly only when the input bus width is 24bit, actually to properly compute the PLL target frequency what is relevant is the bits-per-pixel on the DSI link.
No regression expected since the DSI format is currently hard-coded as MIPI_DSI_FMT_RGB888.
--- drivers/gpu/drm/bridge/tc358768.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/tc358768.c +5 -3
@@ -147,6 +147,7 @@ struct tc358768_priv {u32 pd_lines;/* number of Parallel Port Input Data Lines */ u32 dsi_lanes;/* number of DSI Lanes */ +u32 dsi_bpp;/* number of Bits Per Pixel over DSI */ /* Parameters for PLL programming */ u32 fbd;/* PLL feedback divider */
@@ -285,12 +286,12 @@ static void tc358768_hw_disable(struct tc358768_priv *priv)static u32 tc358768_pll_to_pclk (struct tc358768_priv *priv,u32 pll_clk) { -return (u32 )div_u64 ((u64 )pll_clk * priv->dsi_lanes, priv->pd_lines); +return (u32 )div_u64 ((u64 )pll_clk * priv->dsi_lanes, priv->dsi_bpp); }static u32 tc358768_pclk_to_pll (struct tc358768_priv *priv,u32 pclk) { -return (u32 )div_u64 ((u64 )pclk * priv->pd_lines, priv->dsi_lanes); +return (u32 )div_u64 ((u64 )pclk * priv->dsi_bpp, priv->dsi_lanes); } static int tc358768_calc_pll(struct tc358768_priv *priv,
@@ -427,6 +428,7 @@ static int tc358768_dsi_host_attach(struct mipi_dsi_host *host, priv->output.panel = panel; priv->dsi_lanes = dev->lanes; + priv->dsi_bpp =mipi_dsi_pixel_format_to_bpp (dev->format);/* get input ep (port0/endpoint0) */ ret = -EINVAL ;
@@ -438,7 +440,7 @@ static int tc358768_dsi_host_attach(struct mipi_dsi_host *host, }if (ret) - priv->pd_lines =mipi_dsi_pixel_format_to_bpp (dev->format); + priv->pd_lines = priv->dsi_bpp;drm_bridge_add (&priv->bridge);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 150/591 drm/bridge: tc358768: fix TCLK_ZEROCNT computation
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit f9cf811374f42fca31ac34aaf59ee2ae72b89879 ]
Correct computation of TCLK_ZEROCNT register.
This register must be set to a value that ensure that (TCLK-PREPARECNT + TCLK-ZERO) > 300ns
with the actual value of (TCLK-PREPARECNT + TCLK-ZERO) being
(1 to 2) + (TCLK_ZEROCNT + 1)) x HSByteClkCycle + (PHY output delay)
with PHY output delay being about
(2 to 3) x MIPIBitClk cycle in the BitClk conversion.
--- drivers/gpu/drm/bridge/tc358768.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/tc358768.c +4 -4
@@ -743,10 +743,10 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)/* 38ns < TCLK_PREPARE < 95ns */ val =tc358768_ns_to_cnt (65 , dsibclk_nsk) -1 ; -/* TCLK_PREPARE > 300ns */ - val2 =tc358768_ns_to_cnt (300 +tc358768_to_ns (3 * ui_nsk), - dsibclk_nsk); - val |= (val2 -tc358768_to_ns (phy_delay_nsk - dsibclk_nsk)) <<8 ; +/* TCLK_PREPARE + TCLK_ZERO > 300ns */ + val2 =tc358768_ns_to_cnt (300 -tc358768_to_ns (2 * ui_nsk), + dsibclk_nsk) -2 ; + val |= val2 <<8 ;dev_dbg (priv->dev,"TCLK_HEADERCNT: 0x%x\n" , val);tc358768_write (priv,TC358768_TCLK_HEADERCNT , val);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 151/591 drm/bridge: tc358768: Add atomic_get_input_bus_fmts() implementation
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit cec5ccef85bd0128cf895612de54a9d21d2015d0 ]
Add atomic_get_input_bus_fmts() implementation, tc358768 has a parallel RGB input interface with the actual bus format depending on the amount of parallel input data lines.
Without this change when the tc358768 is used with less than 24bit the color mapping is completely wrong.
Stable-dep-of: ee18698e212b ("drm/bridge: tc358768: fix TCLK_TRAILCNT computation")
--- drivers/gpu/drm/bridge/tc358768.c | 44 +++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+)
drivers/gpu/drm/bridge/tc358768.c +44 -0
@@ -9,6 +9,7 @@#include <linux/gpio/consumer.h> #include <linux/i2c.h> #include <linux/kernel.h> +#include <linux/media-bus-format.h> #include <linux/module.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h>
@@ -919,6 +920,44 @@ static void tc358768_bridge_enable(struct drm_bridge *bridge) } } +#define MAX_INPUT_SEL_FORMATS 1 + +static u32 * +tc358768_atomic_get_input_bus_fmts (struct drm_bridge *bridge, +struct drm_bridge_state *bridge_state, +struct drm_crtc_state *crtc_state, +struct drm_connector_state *conn_state, +u32 output_fmt, +unsigned int *num_input_fmts) +{ +struct tc358768_priv *priv =bridge_to_tc358768 (bridge); +u32 *input_fmts; + + *num_input_fmts =0 ; + + input_fmts =kcalloc (MAX_INPUT_SEL_FORMATS ,sizeof (*input_fmts), +GFP_KERNEL ); +if (!input_fmts) +return NULL ; + +switch (priv->pd_lines) { +case 16 : + input_fmts[0 ] =MEDIA_BUS_FMT_RGB565_1X16 ; +break ; +case 18 : + input_fmts[0 ] =MEDIA_BUS_FMT_RGB666_1X18 ; +break ; +default : +case 24 : + input_fmts[0 ] =MEDIA_BUS_FMT_RGB888_1X24 ; +break ; + }; + + *num_input_fmts =MAX_INPUT_SEL_FORMATS ; + +return input_fmts; +} +static const struct drm_bridge_funcs tc358768_bridge_funcs = { .attach = tc358768_bridge_attach, .mode_valid = tc358768_bridge_mode_valid,
@@ -926,6 +965,11 @@ static const struct drm_bridge_funcs tc358768_bridge_funcs = { .enable = tc358768_bridge_enable, .disable = tc358768_bridge_disable, .post_disable = tc358768_bridge_post_disable, + + .atomic_duplicate_state = drm_atomic_helper_bridge_duplicate_state, + .atomic_destroy_state = drm_atomic_helper_bridge_destroy_state, + .atomic_reset = drm_atomic_helper_bridge_reset, + .atomic_get_input_bus_fmts = tc358768_atomic_get_input_bus_fmts, };static const struct drm_bridge_timings default_tc358768_timings = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 152/591 drm/bridge: tc358768: fix TCLK_TRAILCNT computation
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit ee18698e212b1659dd0850d7e2ae0f22e16ed3d3 ]
Correct computation of TCLK_TRAILCNT register.
The driver does not implement non-continuous clock mode, so the actual value doesn't make a practical difference yet. However this change also ensures that the value does not write to reserved registers bits in case of under/overflow.
This register must be set to a value that ensures that
TCLK-TRAIL > 60ns
and
TEOT <= (105 ns + 12 x UI)
with the actual value of TCLK-TRAIL being
(TCLK_TRAILCNT + (1 to 2)) xHSByteClkCycle +
(2 + (1 to 2)) * HSBYTECLKCycle - (PHY output delay)
with PHY output delay being about
(2 to 3) x MIPIBitClk cycle in the BitClk conversion.
--- drivers/gpu/drm/bridge/tc358768.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/tc358768.c +5 -3
@@ -10,6 +10,7 @@#include <linux/i2c.h> #include <linux/kernel.h> #include <linux/media-bus-format.h> +#include <linux/minmax.h> #include <linux/module.h> #include <linux/regmap.h> #include <linux/regulator/consumer.h>
@@ -640,6 +641,7 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)struct mipi_dsi_device *dsi_dev = priv->output.dev;unsigned long mode_flags = dsi_dev->mode_flags;u32 val, val2, lptxcnt, hact, data_type; +s32 raw_val;const struct drm_display_mode *mode;u32 dsibclk_nsk, dsiclk_nsk, ui_nsk, phy_delay_nsk;u32 dsiclk, dsibclk, video_start;
@@ -751,9 +753,9 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)dev_dbg (priv->dev,"TCLK_HEADERCNT: 0x%x\n" , val);tc358768_write (priv,TC358768_TCLK_HEADERCNT , val); -/* TCLK_TRAIL > 60ns + 3*UI */ - val =60 +tc358768_to_ns (3 * ui_nsk); - val =tc358768_ns_to_cnt (val, dsibclk_nsk) -5 ; +/* TCLK_TRAIL > 60ns AND TEOT <= 105 ns + 12*UI */ + raw_val =tc358768_ns_to_cnt (60 +tc358768_to_ns (2 * ui_nsk), dsibclk_nsk) -5 ; + val =clamp (raw_val,0 ,127 );dev_dbg (priv->dev,"TCLK_TRAILCNT: 0x%x\n" , val);tc358768_write (priv,TC358768_TCLK_TRAILCNT , val);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 153/591 drm/bridge: tc358768: fix THS_ZEROCNT computation
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit 77a089328da791118af9692543a5eedc79eb5fd4 ]
Correct computation of THS_ZEROCNT register.
This register must be set to a value that ensure that THS_PREPARE + THS_ZERO > 145ns + 10*UI
with the actual value of (THS_PREPARE + THS_ZERO) being
((1 to 2) + 1 + (TCLK_ZEROCNT + 1) + (3 to 4)) x ByteClk cycle +
+ HSByteClk x (2 + (1 to 2)) + (PHY delay)
with PHY delay being about
(8 + (5 to 6)) x MIPIBitClk cycle in the BitClk conversion.
--- drivers/gpu/drm/bridge/tc358768.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/tc358768.c +4 -3
@@ -762,9 +762,10 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)/* 40ns + 4*UI < THS_PREPARE < 85ns + 6*UI */ val =50 +tc358768_to_ns (4 * ui_nsk); val =tc358768_ns_to_cnt (val, dsibclk_nsk) -1 ; -/* THS_ZERO > 145ns + 10*UI */ - val2 =tc358768_ns_to_cnt (145 -tc358768_to_ns (ui_nsk), dsibclk_nsk); - val |= (val2 -tc358768_to_ns (phy_delay_nsk)) <<8 ; +/* THS_PREPARE + THS_ZERO > 145ns + 10*UI */ + raw_val =tc358768_ns_to_cnt (145 -tc358768_to_ns (3 * ui_nsk), dsibclk_nsk) -10 ; + val2 =clamp (raw_val,0 ,127 ); + val |= val2 <<8 ;dev_dbg (priv->dev,"THS_HEADERCNT: 0x%x\n" , val);tc358768_write (priv,TC358768_THS_HEADERCNT , val);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 154/591 drm/bridge: tc358768: fix TXTAGOCNT computation
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit 3666aad8185af8d0ce164fd3c4974235417d6d0b ]
Correct computation of TXTAGOCNT register.
This register must be set to a value that ensure that the TTA-GO period = (4 x TLPX)
with the actual value of TTA-GO being
4 x (TXTAGOCNT + 1) x (HSByteClk cycle)
--- drivers/gpu/drm/bridge/tc358768.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/bridge/tc358768.c +1 -1
@@ -797,7 +797,7 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)/* TXTAGOCNT[26:16] RXTASURECNT[10:0] */ val =tc358768_to_ns ((lptxcnt +1 ) * dsibclk_nsk *4 ); - val =tc358768_ns_to_cnt (val, dsibclk_nsk) -1 ; + val =tc358768_ns_to_cnt (val, dsibclk_nsk) /4 -1 ; val2 =tc358768_ns_to_cnt (tc358768_to_ns ((lptxcnt +1 ) * dsibclk_nsk), dsibclk_nsk) -2 ; val = val <<16 | val2;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 155/591 drm/bridge: tc358768: fix THS_TRAILCNT computation
In reply to Greg Kroah-HartmanFrom: Francesco Dolcini <[email protected]>
[ Upstream commit bac7842cd179572e8e0fc2d7b5254e40c6e9e057 ]
Correct computation of THS_TRAILCNT register.
This register must be set to a value that ensure that THS_TRAIL > 60 ns + 4 x UI
andTHS_TRAIL > 8 x UI
andTHS_TRAIL < TEOT
with
TEOT = 105 ns + (12 x UI)
with the actual value of THS_TRAIL being
(1 + THS_TRAILCNT) x ByteClk cycle + ((1 to 2) + 2) xHSBYTECLK cycle +
- (PHY output delay)
with PHY output delay being about
(8 + (5 to 6)) x MIPIBitClk cycle in the BitClk conversion.
--- drivers/gpu/drm/bridge/tc358768.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/tc358768.c +4 -3
@@ -781,9 +781,10 @@ static void tc358768_bridge_pre_enable(struct drm_bridge *bridge)dev_dbg (priv->dev,"TCLK_POSTCNT: 0x%x\n" , val);tc358768_write (priv,TC358768_TCLK_POSTCNT , val); -/* 60ns + 4*UI < THS_PREPARE < 105ns + 12*UI */ - val =tc358768_ns_to_cnt (60 +tc358768_to_ns (15 * ui_nsk), - dsibclk_nsk) -5 ; +/* max(60ns + 4*UI, 8*UI) < THS_TRAILCNT < 105ns + 12*UI */ + raw_val =tc358768_ns_to_cnt (60 +tc358768_to_ns (18 * ui_nsk), + dsibclk_nsk) -4 ; + val =clamp (raw_val,0 ,15 );dev_dbg (priv->dev,"THS_TRAILCNT: 0x%x\n" , val);tc358768_write (priv,TC358768_THS_TRAILCNT , val);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 156/591 drm/vram-helper: fix function names in vram helper doc
In reply to Greg Kroah-HartmanFrom: Luc Ma <[email protected]>
[ Upstream commit b8e392245105b50706f18418054821e71e637288 ]
Refer to drmm_vram_helper_init() instead of the non-existent drmm_vram_helper_alloc_mm().
--- drivers/gpu/drm/drm_gem_vram_helper.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/drm_gem_vram_helper.c +3 -3
@@ -44,7 +44,7 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs;* the frame's scanout buffer or the cursor image. If there's no more space * left in VRAM, inactive GEM objects can be moved to system memory. * -* To initialize the VRAM helper library call drmm_vram_helper_alloc_mm(). +* To initialize the VRAM helper library call drmm_vram_helper_init(). * The function allocates and initializes an instance of &struct drm_vram_mm * in &struct drm_device.vram_mm . Use &DRM_GEM_VRAM_DRIVER to initialize * &struct drm_driver and &DRM_VRAM_MM_FILE_OPERATIONS to initialize
@@ -72,7 +72,7 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs;* // setup device, vram base and size * // ... * -* ret = drmm_vram_helper_alloc_mm(dev, vram_base, vram_size); +* ret = drmm_vram_helper_init(dev, vram_base, vram_size); * if (ret) * return ret; * return 0;
@@ -85,7 +85,7 @@ static const struct drm_gem_object_funcs drm_gem_vram_object_funcs;* to userspace. * * You don't have to clean up the instance of VRAM MM. -* drmm_vram_helper_alloc_mm() is a managed interface that installs a +* drmm_vram_helper_init() is a managed interface that installs a * clean-up handler to run during the DRM device's release. * * For drawing or scanout operations, rsp. buffer objects have to be pinned
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 157/591 ARM: dts: BCM5301X: Drop "clock-names" from the SPI node
In reply to Greg Kroah-HartmanFrom: Rafał Miłecki <[email protected]>
[ Upstream commit d3c8e2c5757153bbfad70019ec1decbca86f3def ]
There is no such property in the SPI controller binding documentation. Also Linux driver doesn't look for it.
This fixes:arch/arm/boot/dts/bcm4708-asus-rt-ac56u.dtb: spi@18029200: Unevaluated properties are not allowed ('clock-names' was unexpected)
From schema: Documentation/devicetree/bindings/spi/brcm,spi-bcm-qspi.yaml
--- arch/arm/boot/dts/bcm5301x.dtsi | 1 - 1 file changed, 1 deletion(-)
arch/arm/boot/dts/bcm5301x.dtsi +0 -1
@@ -542,7 +542,6 @@ spi@18029200 { "spi_lr_session_done", "spi_lr_overread"; clocks = <&iprocmed>; - clock-names = "iprocmed"; num-cs = <2>; #address-cells = <1>; #size-cells = <0>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 158/591 ARM: dts: meson8b: correct uart_B and uart_C clock references
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
[ Upstream commit d542ce8d4769cdef6a7bc3437e59cfed9c68f0e4 ]
With the current device tree for meson8b, uarts B (e.g. available on pins 8/10 on Odroid-C1) and C (pins 3/5 on Odroid-C1) do not work, because they are relying on incorrect clocks. Change the references of pclk to the correct CLKID, to allow use of the two uarts.
--- arch/arm/boot/dts/meson8b.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/meson8b.dtsi +2 -2
@@ -737,13 +737,13 @@ &uart_A { &uart_B { compatible = "amlogic,meson8b-uart"; - clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>; + clocks = <&xtal>, <&clkc CLKID_UART1>, <&clkc CLKID_CLK81>; clock-names = "xtal", "pclk", "baud"; }; &uart_C { compatible = "amlogic,meson8b-uart"; - clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>; + clocks = <&xtal>, <&clkc CLKID_UART2>, <&clkc CLKID_CLK81>; clock-names = "xtal", "pclk", "baud"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 159/591 mm: call arch_swap_restore() from do_swap_page()
In reply to Greg Kroah-HartmanFrom: Peter Collingbourne <[email protected]>
commit 6dca4ac6fc91fd41ea4d6c4511838d37f4e0eab2 upstream.
Commit c145e0b47c77 ("mm: streamline COW logic in do_swap_page()") moved the call to swap_free() before the call to set_pte_at(), which meant that the MTE tags could end up being freed before set_pte_at() had a chance to restore them. Fix it by adding a call to the arch_swap_restore() hook before the call to swap_free().
--- mm/memory.c | 7 +++++++ 1 file changed, 7 insertions(+)
mm/memory.c +7 -0
@@ -3981,6 +3981,13 @@ vm_fault_t do_swap_page(struct vm_fault }/* +* Some architectures may have to restore extra metadata to the page +* when reading from swap. This metadata may be indexed by swap entry +* so this must be called before swap_free(). +*/ +arch_swap_restore (entry, folio); + +/* * Remove the swap entry and conditionally try to free up the swapcache. * We're already holding a reference on the page but haven't mapped it * yet.
Greg Kroah-Hartman
maintainerPATCH 160/591 clk: vc5: Use `clamp()` to restrict PLL range
In reply to Greg Kroah-HartmanFrom: Lars-Peter Clausen <[email protected]>
[ Upstream commit 3ed741db04f58e8df0d46cec7ecfc4bfd075f047 ]
The VCO frequency needs to be within a certain range and the driver enforces this.
Make use of the clamp macro to implement this instead of open-coding it. This makes the code a bit shorter and also semanticly stronger.
Stable-dep-of: be3471c5bd9b ("clk: vc5: Fix .driver_data content in i2c_device_id")
--- drivers/clk/clk-versaclock5.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/clk/clk-versaclock5.c +1 -4
@@ -450,10 +450,7 @@ static long vc5_pll_round_rate(struct clk_hw *hw, unsigned long rate,u32 div_int;u64 div_frc; -if (rate <VC5_PLL_VCO_MIN ) - rate =VC5_PLL_VCO_MIN ; -if (rate >VC5_PLL_VCO_MAX ) - rate =VC5_PLL_VCO_MAX ; + rate =clamp (rate,VC5_PLL_VCO_MIN ,VC5_PLL_VCO_MAX );/* Determine integer part, which is 12 bit wide */ div_int = rate / *parent_rate;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 161/591 bootmem: remove the vmemmap pages from kmemleak in free_bootmem_page
In reply to Greg Kroah-HartmanFrom: Liu Shixin <[email protected]>
commit 028725e73375a1ff080bbdf9fb503306d0116f28 upstream.
commit dd0ff4d12dd2 ("bootmem: remove the vmemmap pages from kmemleak in put_page_bootmem") fix an overlaps existing problem of kmemleak. But the problem still existed when HAVE_BOOTMEM_INFO_NODE is disabled, because in this case, free_bootmem_page() will call free_reserved_page() directly.
Fix the problem by adding kmemleak_free_part() in free_bootmem_page() when HAVE_BOOTMEM_INFO_NODE is disabled.
--- include/linux/bootmem_info.h | 2 ++ 1 file changed, 2 insertions(+)
include/linux/bootmem_info.h +2 -0
@@ -3,6 +3,7 @@#define __LINUX_BOOTMEM_INFO_H#include <linux/mm.h> +#include <linux/kmemleak.h> /* * Types for free bootmem stored in page->lru.next. These have to be in
@@ -59,6 +60,7 @@ static inline void get_page_bootmem(unsistatic inline void free_bootmem_page (struct page *page) { +kmemleak_free_part (page_to_virt (page),PAGE_SIZE );free_reserved_page (page); }#endif
Greg Kroah-Hartman
maintainerPATCH 162/591 clk: vc5: Fix .driver_data content in i2c_device_id
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit be3471c5bd9b921c9adfab7948e8021611639164 ]
The .driver_data content in i2c_device_id table must match the .data content in of_device_id table, else device_get_match_data() would return bogus value on i2c_device_id match. Align the two tables.
The i2c_device_id table is now converted from of_device_id using '[email protected] = "idt,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'
--- drivers/clk/clk-versaclock5.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/clk/clk-versaclock5.c +7 -7
@@ -1255,13 +1255,13 @@ static const struct vc5_chip_info idt_5p49v6975_info = { };static const struct i2c_device_id vc5_id[] = { - {"5p49v5923" , .driver_data =IDT_VC5_5P49V5923 }, - {"5p49v5925" , .driver_data =IDT_VC5_5P49V5925 }, - {"5p49v5933" , .driver_data =IDT_VC5_5P49V5933 }, - {"5p49v5935" , .driver_data =IDT_VC5_5P49V5935 }, - {"5p49v6901" , .driver_data =IDT_VC6_5P49V6901 }, - {"5p49v6965" , .driver_data =IDT_VC6_5P49V6965 }, - {"5p49v6975" , .driver_data =IDT_VC6_5P49V6975 }, + {"5p49v5923" , .driver_data = (kernel_ulong_t)&idt_5p49v5923_info }, + {"5p49v5925" , .driver_data = (kernel_ulong_t)&idt_5p49v5925_info }, + {"5p49v5933" , .driver_data = (kernel_ulong_t)&idt_5p49v5933_info }, + {"5p49v5935" , .driver_data = (kernel_ulong_t)&idt_5p49v5935_info }, + {"5p49v6901" , .driver_data = (kernel_ulong_t)&idt_5p49v6901_info }, + {"5p49v6965" , .driver_data = (kernel_ulong_t)&idt_5p49v6965_info }, + {"5p49v6975" , .driver_data = (kernel_ulong_t)&idt_5p49v6975_info }, { } };MODULE_DEVICE_TABLE (i2c, vc5_id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 163/591 clk: vc7: Fix .driver_data content in i2c_device_id
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit b5e10beeafaa3266559c582dde7534ae3fe8cefb ]
The .driver_data content in i2c_device_id table must match the .data content in of_device_id table, else device_get_match_data() would return bogus value on i2c_device_id match. Align the two tables.
The i2c_device_id table is now converted from of_device_id using
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'
--- drivers/clk/clk-versaclock7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-versaclock7.c +1 -1
@@ -1282,7 +1282,7 @@ static const struct regmap_config vc7_regmap_config = { };static const struct i2c_device_id vc7_i2c_id[] = { - {"rc21008a" ,VC7_RC21008A }, + {"rc21008a" , .driver_data = (kernel_ulong_t)&vc7_rc21008a_info }, {} };MODULE_DEVICE_TABLE (i2c, vc7_i2c_id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 164/591 clk: rs9: Fix .driver_data content in i2c_device_id
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit ad527ca87e4ea42d7baad2ce710b44069287931b ]
The .driver_data content in i2c_device_id table must match the .data content in of_device_id table, else device_get_match_data() would return bogus value on i2c_device_id match. Align the two tables.
The i2c_device_id table is now converted from of_device_id using
'[email protected] = "renesas,\([^"]\+"\), .data = \(.*\)@"\1, .driver_data = (kernel_ulong_t)\2@'
--- drivers/clk/clk-renesas-pcie.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/clk-renesas-pcie.c +1 -1
@@ -353,7 +353,7 @@ static const struct rs9_chip_info renesas_9fgv0241_info = { };static const struct i2c_device_id rs9_id[] = { - {"9fgv0241" , .driver_data =RENESAS_9FGV0241 }, + {"9fgv0241" , .driver_data = (kernel_ulong_t)&renesas_9fgv0241_info }, { } };MODULE_DEVICE_TABLE (i2c, rs9_id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 165/591 Input: adxl34x - do not hardcode interrupt trigger type
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit e96220bce5176ed2309f77f061dcc0430b82b25e ]
Instead of hardcoding IRQ trigger type to IRQF_TRIGGER_HIGH, let's respect the settings specified in the firmware description.
--- drivers/input/misc/adxl34x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/input/misc/adxl34x.c +1 -2
@@ -811,8 +811,7 @@ struct adxl34x *adxl34x_probe(struct device *dev, int irq,AC_WRITE (ac,POWER_CTL ,0 ); err =request_threaded_irq (ac->irq,NULL , adxl34x_irq, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , -dev_name (dev), ac); +IRQF_ONESHOT ,dev_name (dev), ac);if (err) {dev_err (dev,"irq %d busy?\n" , ac->irq); goto err_free_mem;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 166/591 drm: sun4i_tcon: use devm_clk_get_enabled in `sun4i_tcon_init_clocks`
In reply to Greg Kroah-HartmanFrom: XuDong Liu <[email protected]>
[ Upstream commit 123ee07ba5b7123e0ce0e0f9d64938026c16a2ce ]
Smatch reports:drivers/gpu/drm/sun4i/sun4i_tcon.c:805 sun4i_tcon_init_clocks() warn:
'tcon->clk' from clk_prepare_enable() not released on lines: 792,801.
In the function sun4i_tcon_init_clocks(), tcon->clk and tcon->sclk0 are not disabled in the error handling, which affects the release of these variable. Although sun4i_tcon_bind(), which calls sun4i_tcon_init_clocks(), use sun4i_tcon_free_clocks to disable the variables mentioned, but the error handling branch of sun4i_tcon_init_clocks() ignores the required disable process.
To fix this issue, use the devm_clk_get_enabled to automatically balance enable and disabled calls. As original implementation use sun4i_tcon_free_clocks() to disable clk explicitly, we delete the related calls and error handling that are no longer needed.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-)
drivers/gpu/drm/sun4i/sun4i_tcon.c +4 -15
@@ -778,21 +778,19 @@ static irqreturn_t sun4i_tcon_handler(int irq, void *private)static int sun4i_tcon_init_clocks (struct device *dev,struct sun4i_tcon *tcon) { - tcon->clk =devm_clk_get (dev,"ahb" ); + tcon->clk =devm_clk_get_enabled (dev,"ahb" );if (IS_ERR (tcon->clk)) {dev_err (dev,"Couldn't get the TCON bus clock\n" );return PTR_ERR (tcon->clk); } -clk_prepare_enable (tcon->clk);if (tcon->quirks->has_channel_0) { - tcon->sclk0 =devm_clk_get (dev,"tcon-ch0" ); + tcon->sclk0 =devm_clk_get_enabled (dev,"tcon-ch0" );if (IS_ERR (tcon->sclk0)) {dev_err (dev,"Couldn't get the TCON channel 0 clock\n" );return PTR_ERR (tcon->sclk0); } } -clk_prepare_enable (tcon->sclk0);if (tcon->quirks->has_channel_1) { tcon->sclk1 =devm_clk_get (dev,"tcon-ch1" );
@@ -805,12 +803,6 @@ static int sun4i_tcon_init_clocks(struct device *dev,return 0 ; } -static void sun4i_tcon_free_clocks (struct sun4i_tcon *tcon) -{ -clk_disable_unprepare (tcon->sclk0); -clk_disable_unprepare (tcon->clk); -} -static int sun4i_tcon_init_irq (struct device *dev,struct sun4i_tcon *tcon) {
@@ -1223,14 +1215,14 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, ret =sun4i_tcon_init_regmap (dev, tcon);if (ret) {dev_err (dev,"Couldn't init our TCON regmap\n" ); - goto err_free_clocks; + goto err_assert_reset; }if (tcon->quirks->has_channel_0) { ret =sun4i_dclk_create (dev, tcon);if (ret) {dev_err (dev,"Couldn't create our TCON dot clock\n" ); - goto err_free_clocks; + goto err_assert_reset; } }
@@ -1293,8 +1285,6 @@ static int sun4i_tcon_bind(struct device *dev, struct device *master, err_free_dotclock:if (tcon->quirks->has_channel_0)sun4i_dclk_free (tcon); -err_free_clocks: -sun4i_tcon_free_clocks (tcon); err_assert_reset:reset_control_assert (tcon->lcd_rst);return ret;
@@ -1308,7 +1298,6 @@ static void sun4i_tcon_unbind(struct device *dev, struct device *master,list_del (&tcon->list);if (tcon->quirks->has_channel_0)sun4i_dclk_free (tcon); -sun4i_tcon_free_clocks (tcon); }static const struct component_ops sun4i_tcon_ops = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 167/591 drm/panel: sharp-ls043t1le01: adjust mode settings
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit dee23b2c9e3ff46d59c5d45e1436eceb878e7c9a ]
Using current settings causes panel flickering on APQ8074 dragonboard. Adjust panel settings to follow the vendor-provided mode. This also enables MIPI_DSI_MODE_VIDEO_SYNC_PULSE, which is also specified by the vendor dtsi for the mentioned dragonboard.
--- drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/panel/panel-sharp-ls043t1le01.c +6 -5
@@ -192,15 +192,15 @@ static int sharp_nt_panel_enable(struct drm_panel *panel) }static const struct drm_display_mode default_mode = { - .clock =41118 , + .clock = (540 +48 +32 +80 ) * (960 +3 +10 +15 ) *60 /1000 , .hdisplay =540 , .hsync_start =540 +48 , - .hsync_end =540 +48 +80 , - .htotal =540 +48 +80 +32 , + .hsync_end =540 +48 +32 , + .htotal =540 +48 +32 +80 , .vdisplay =960 , .vsync_start =960 +3 , - .vsync_end =960 +3 +15 , - .vtotal =960 +3 +15 +1 , + .vsync_end =960 +3 +10 , + .vtotal =960 +3 +10 +15 , }; static int sharp_nt_panel_get_modes(struct drm_panel *panel,
@@ -280,6 +280,7 @@ static int sharp_nt_panel_probe(struct mipi_dsi_device *dsi) dsi->lanes =2 ; dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->mode_flags =MIPI_DSI_MODE_VIDEO | +MIPI_DSI_MODE_VIDEO_SYNC_PULSE |MIPI_DSI_MODE_VIDEO_HSE |MIPI_DSI_CLOCK_NON_CONTINUOUS |MIPI_DSI_MODE_NO_EOT_PACKET ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 168/591 driver: soc: xilinx: use _safe loop iterator to avoid a use after free
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit c58da0ba3e5c86e51e2c1557afaf6f71e00c4533 ]
The hash_for_each_possible() loop dereferences "eve_data" to get the next item on the list. However the loop frees eve_data so it leads to a use after free. Use hash_for_each_possible_safe() instead.
--- drivers/soc/xilinx/xlnx_event_manager.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/soc/xilinx/xlnx_event_manager.c +4 -2
@@ -192,11 +192,12 @@ static int xlnx_remove_cb_for_suspend(event_cb_func_t cb_fun)struct registered_event_data *eve_data;struct agent_cb *cb_pos;struct agent_cb *cb_next; +struct hlist_node *tmp; is_need_to_unregister = false;/* Check for existing entry in hash table for given cb_type */ -hash_for_each_possible (reg_driver_map, eve_data, hentry,PM_INIT_SUSPEND_CB ) { +hash_for_each_possible_safe (reg_driver_map, eve_data, tmp, hentry,PM_INIT_SUSPEND_CB ) {if (eve_data->cb_type ==PM_INIT_SUSPEND_CB ) {/* Delete the list of callback */ list_for_each_entry_safe (cb_pos, cb_next, &eve_data->cb_list_head, list) {
@@ -228,11 +229,12 @@ static int xlnx_remove_cb_for_notify_event(const u32 node_id, const u32 event,u64 key = ((u64 )node_id <<32U ) | (u64 )event;struct agent_cb *cb_pos;struct agent_cb *cb_next; +struct hlist_node *tmp; is_need_to_unregister = false;/* Check for existing entry in hash table for given key id */ -hash_for_each_possible (reg_driver_map, eve_data, hentry, key) { +hash_for_each_possible_safe (reg_driver_map, eve_data, tmp, hentry, key) {if (eve_data->key == key) {/* Delete the list of callback */ list_for_each_entry_safe (cb_pos, cb_next, &eve_data->cb_list_head, list) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 169/591 ASoC: Intel: sof_sdw: remove SOF_SDW_TGL_HDMI for MeteorLake devices
In reply to Greg Kroah-HartmanFrom: Bard Liao <[email protected]>
[ Upstream commit 0db94947c9d3da16aa31d152b7d26fab78b02cb9 ]
Topologies support three HDMI links on MeteorLake devices only.
--- sound/soc/intel/boards/sof_sdw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/intel/boards/sof_sdw.c +1 -1
@@ -372,7 +372,7 @@ static const struct dmi_system_id sof_sdw_quirk_table[] = { .matches = { DMI_MATCH(DMI_PRODUCT_FAMILY, "Intel_mtlrvp"), }, - .driver_data = (void *)(RT711_JD1 | SOF_SDW_TGL_HDMI), + .driver_data = (void *)(RT711_JD1), }, {} };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 170/591 drm/vkms: isolate pixel conversion functionality
In reply to Greg Kroah-HartmanFrom: Maíra Canal <[email protected]>
[ Upstream commit 322d716a3e8a74fb75cd0f657647be4df253fd2f ]
Currently, the pixel conversion functions repeat the same loop to iterate the rows. Instead of repeating the same code for each pixel format, create a function to wrap the loop and isolate the pixel conversion functionality.
Stable-dep-of: ab87f558dcfb ("drm/vkms: Fix RGB565 pixel conversion")
--- drivers/gpu/drm/vkms/vkms_composer.c | 4 +- drivers/gpu/drm/vkms/vkms_drv.h | 4 +- drivers/gpu/drm/vkms/vkms_formats.c | 125 +++++++++++---------------- drivers/gpu/drm/vkms/vkms_formats.h | 2 +- drivers/gpu/drm/vkms/vkms_plane.c | 2 +- 5 files changed, 56 insertions(+), 81 deletions(-)
drivers/gpu/drm/vkms/vkms_composer.c +2 -2
@@ -99,7 +99,7 @@ static void blend(struct vkms_writeback_job *wb,if (!check_y_limit (plane[i]->frame_info, y))continue ; - plane[i]->plane_read (stage_buffer, plane[i]->frame_info, y); +vkms_compose_row (stage_buffer, plane[i], y);pre_mul_alpha_blend (plane[i]->frame_info, stage_buffer, output_buffer); }
@@ -118,7 +118,7 @@ static int check_format_funcs(struct vkms_crtc_state *crtc_state,u32 n_active_planes = crtc_state->num_active_planes;for (size_t i =0 ; i < n_active_planes; i++) -if (!planes[i]->plane_read) +if (!planes[i]->pixel_read)return -1 ;if (active_wb && !active_wb->wb_write)
drivers/gpu/drm/vkms/vkms_drv.h +2 -2
@@ -56,8 +56,7 @@ struct vkms_writeback_job {struct vkms_plane_state {struct drm_shadow_plane_state base;struct vkms_frame_info *frame_info; -void (*plane_read)(struct line_buffer *buffer, -const struct vkms_frame_info *frame_info,int y); +void (*pixel_read)(u8 *src_buffer,struct pixel_argb_u16 *out_pixel); };struct vkms_plane {
@@ -155,6 +154,7 @@ int vkms_verify_crc_source(struct drm_crtc *crtc, const char *source_name,/* Composer Support */ void vkms_composer_worker (struct work_struct *work);void vkms_set_composer (struct vkms_output *out,bool enabled); +void vkms_compose_row (struct line_buffer *stage_buffer,struct vkms_plane_state *plane,int y);/* Writeback */ int vkms_enable_writeback_connector (struct vkms_device *vkmsdev);
drivers/gpu/drm/vkms/vkms_formats.c +50 -75
157 lines not on this page · raw message
drivers/gpu/drm/vkms/vkms_formats.h +1 -1
@@ -5,7 +5,7 @@#include "vkms_drv.h" -void *get_frame_to_line_function (u32 format); +void *get_pixel_conversion_function (u32 format);void *get_line_to_frame_function (u32 format);
drivers/gpu/drm/vkms/vkms_plane.c +1 -1
@@ -123,7 +123,7 @@ static void vkms_plane_atomic_update(struct drm_plane *plane, frame_info->offset = fb->offsets[0 ]; frame_info->pitch = fb->pitches[0 ]; frame_info->cpp = fb->format->cpp[0 ]; - vkms_plane_state->plane_read =get_frame_to_line_function (fmt); + vkms_plane_state->pixel_read =get_pixel_conversion_function (fmt); } static int vkms_plane_atomic_check(struct drm_plane *plane,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 171/591 drm: Add fixed-point helper to get rounded integer values
In reply to Greg Kroah-HartmanFrom: Maíra Canal <[email protected]>
[ Upstream commit 8b25320887d7feac98875546ea0f521628b745bb ]
Create a new fixed-point helper to allow us to return the rounded value of our fixed point value.
[v2]:
* Create the function drm_fixp2int_round() (Melissa Wen).
[v3]:
* Use drm_fixp2int() instead of shifting manually (Arthur Grillo).
Stable-dep-of: ab87f558dcfb ("drm/vkms: Fix RGB565 pixel conversion")
--- include/drm/drm_fixed.h | 6 ++++++ 1 file changed, 6 insertions(+)
include/drm/drm_fixed.h +6 -0
@@ -70,6 +70,7 @@ static inline u32 dfixed_div(fixed20_12 A, fixed20_12 B) }#define DRM_FIXED_POINT 32 +#define DRM_FIXED_POINT_HALF 16#define DRM_FIXED_ONE (1ULL << DRM_FIXED_POINT)#define DRM_FIXED_DECIMAL_MASK (DRM_FIXED_ONE - 1)#define DRM_FIXED_DIGITS_MASK (~DRM_FIXED_DECIMAL_MASK)
@@ -86,6 +87,11 @@ static inline int drm_fixp2int(s64 a)return ((s64 )a) >>DRM_FIXED_POINT ; } +static inline int drm_fixp2int_round (s64 a) +{ +return drm_fixp2int (a + (1 << (DRM_FIXED_POINT_HALF -1 ))); +} +static inline int drm_fixp2int_ceil (s64 a) {if (a >0 )
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 172/591 drm/vkms: Fix RGB565 pixel conversion
In reply to Greg Kroah-HartmanFrom: Maíra Canal <[email protected]>
[ Upstream commit ab87f558dcfb2562c3497e89600dec798a446665 ]
Currently, the pixel conversion isn't rounding the fixed-point values before assigning it to the RGB coefficients, which is causing the IGT pixel-format tests to fail. So, use the drm_fixp2int_round() fixed-point helper to round the values when assigning it to the RGB coefficients.
Tested with igt@kms_plane@pixel-format and igt@kms_plane@pixel-format-source-clamping.
[v2]:
* Use drm_fixp2int_round() to fix the pixel conversion instead of casting the values to s32 (Melissa Wen).
--- drivers/gpu/drm/vkms/vkms_formats.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/vkms/vkms_formats.c +6 -6
@@ -97,9 +97,9 @@ static void RGB565_to_argb_u16(u8 *src_pixels, struct pixel_argb_u16 *out_pixel)s64 fp_b =drm_int2fixp (rgb_565 &0x1f ); out_pixel->a = (u16 )0xffff ; - out_pixel->r =drm_fixp2int (drm_fixp_mul (fp_r, fp_rb_ratio)); - out_pixel->g =drm_fixp2int (drm_fixp_mul (fp_g, fp_g_ratio)); - out_pixel->b =drm_fixp2int (drm_fixp_mul (fp_b, fp_rb_ratio)); + out_pixel->r =drm_fixp2int_round (drm_fixp_mul (fp_r, fp_rb_ratio)); + out_pixel->g =drm_fixp2int_round (drm_fixp_mul (fp_g, fp_g_ratio)); + out_pixel->b =drm_fixp2int_round (drm_fixp_mul (fp_b, fp_rb_ratio)); }void vkms_compose_row (struct line_buffer *stage_buffer,struct vkms_plane_state *plane,int y)
@@ -216,9 +216,9 @@ static void argb_u16_to_RGB565(struct vkms_frame_info *frame_info,s64 fp_g =drm_int2fixp (in_pixels[x].g);s64 fp_b =drm_int2fixp (in_pixels[x].b); -u16 r =drm_fixp2int (drm_fixp_div (fp_r, fp_rb_ratio)); -u16 g =drm_fixp2int (drm_fixp_div (fp_g, fp_g_ratio)); -u16 b =drm_fixp2int (drm_fixp_div (fp_b, fp_rb_ratio)); +u16 r =drm_fixp2int_round (drm_fixp_div (fp_r, fp_rb_ratio)); +u16 g =drm_fixp2int_round (drm_fixp_div (fp_g, fp_g_ratio)); +u16 b =drm_fixp2int_round (drm_fixp_div (fp_b, fp_rb_ratio)); *dst_pixels =cpu_to_le16 (r <<11 | g <<5 | b); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 173/591 ARM: dts: stm32: Move ethernet MAC EEPROM from SoM to carrier boards
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 9660efc2af37f3c12dc6e6a5511ad99e0addc297 ]
The ethernet MAC EEPROM is not populated on the SoM itself, it has to be populated on each carrier board. Move the EEPROM into the correct place in DTs, i.e. the carrier board DTs. Add label to the EEPROM too.
--- arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 6 ++++++ arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi | 6 ++++++ arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi | 6 ------ 3 files changed, 12 insertions(+), 6 deletions(-)
arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi +6 -0
@@ -322,6 +322,12 @@ adv7513_i2s0: endpoint { }; }; }; + + dh_mac_eeprom: eeprom@53 { + compatible = "atmel,24c02"; + reg = <0x53>; + pagesize = <16>; + }; }; <dc {
arch/arm/boot/dts/stm32mp15xx-dhcor-drc-compact.dtsi +6 -0
@@ -192,6 +192,12 @@ eeprom@50 { reg = <0x50>; pagesize = <16>; }; + + dh_mac_eeprom: eeprom@53 { + compatible = "atmel,24c02"; + reg = <0x53>; + pagesize = <16>; + }; }; &sdmmc1 { /* MicroSD */
arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi +0 -6
@@ -213,12 +213,6 @@ watchdog { status = "disabled"; }; }; - - eeprom@53 { - compatible = "atmel,24c02"; - reg = <0x53>; - pagesize = <16>; - }; }; &ipcc {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 174/591 bus: ti-sysc: Fix dispc quirk masking bool variables
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit f620596fa347170852da499e778a5736d79a4b79 ]
Fix warning drivers/bus/ti-sysc.c:1806 sysc_quirk_dispc()
warn: masking a bool.
While at it let's add a comment for what were doing to make the code a bit easier to follow.
--- drivers/bus/ti-sysc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/bus/ti-sysc.c +2 -2
@@ -1808,7 +1808,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset,if (!ddata->module_va)return -EIO ; -/* DISP_CONTROL */ +/* DISP_CONTROL, shut down lcd and digit on disable if enabled */ val =sysc_read (ddata, dispc_offset +0x40 ); lcd_en = val & lcd_en_mask; digit_en = val & digit_en_mask;
@@ -1820,7 +1820,7 @@ static u32 sysc_quirk_dispc(struct sysc *ddata, int dispc_offset,else irq_mask |=BIT (2 ) |BIT (3 );/* EVSYNC bits */ } -if (disable & (lcd_en | digit_en)) +if (disable && (lcd_en || digit_en))sysc_write (ddata, dispc_offset +0x40 , val & ~(lcd_en_mask | digit_en_mask));
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 175/591 arm64: dts: microchip: sparx5: do not use PSCI on reference boards
In reply to Greg Kroah-HartmanFrom: Robert Marko <[email protected]>
[ Upstream commit 70be83708c925b3f72c508e4756e48ad2330c830 ]
PSCI is not implemented on SparX-5 at all, there is no ATF and U-boot that is shipped does not implement it as well.
I have tried flashing the latest BSP 2022.12 U-boot which did not work. After contacting Microchip, they confirmed that there is no ATF for the SoC nor PSCI implementation which is unfortunate in 2023.
So, disable PSCI as otherwise kernel crashes as soon as it tries probing PSCI with, and the crash is only visible if earlycon is used.
Since PSCI is not implemented, switch core bringup to use spin-tables which are implemented in the vendor U-boot and actually work.
Tested on PCB134 with eMMC (VSC5640EV).
--- arch/arm64/boot/dts/microchip/sparx5.dtsi | 2 +- arch/arm64/boot/dts/microchip/sparx5_pcb_common.dtsi | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/microchip/sparx5.dtsi +1 -1
@@ -61,7 +61,7 @@ arm-pmu { interrupt-affinity = <&cpu0>, <&cpu1>; }; - psci { + psci: psci { compatible = "arm,psci-0.2"; method = "smc"; };
arch/arm64/boot/dts/microchip/sparx5_pcb_common.dtsi +12 -0
@@ -6,6 +6,18 @@ /dts-v1/; #include "sparx5.dtsi" +&psci { + status = "disabled"; +}; + +&cpu0 { + enable-method = "spin-table"; +}; + +&cpu1 { + enable-method = "spin-table"; +}; + &uart0 { status = "okay"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 176/591 drm/bridge: tc358767: Switch to devm MIPI-DSI helpers
In reply to Greg Kroah-HartmanFrom: Alexander Stein <[email protected]>
[ Upstream commit f47d6140b7a4c858d82d263e7577ff6fb5279a9c ]
DSI device registering and attaching needs to be undone upon deregistration. This fixes module unload/load.
--- drivers/gpu/drm/bridge/tc358767.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/bridge/tc358767.c +2 -2
@@ -1890,7 +1890,7 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc)if (dsi_lanes <0 )return dsi_lanes; - dsi =mipi_dsi_device_register_full (host, &info); + dsi =devm_mipi_dsi_device_register_full (dev, host, &info);if (IS_ERR (dsi))return dev_err_probe (dev,PTR_ERR (dsi),"failed to create dsi device\n" );
@@ -1901,7 +1901,7 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc) dsi->format =MIPI_DSI_FMT_RGB888 ; dsi->mode_flags =MIPI_DSI_MODE_VIDEO |MIPI_DSI_MODE_VIDEO_SYNC_PULSE ; - ret =mipi_dsi_attach (dsi); + ret =devm_mipi_dsi_attach (dev, dsi);if (ret <0 ) {dev_err (dev,"failed to attach dsi to host: %d\n" , ret);return ret;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 177/591 clk: imx: scu: use _safe list iterator to avoid a use after free
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 632c60ecd25dbacee54d5581fe3aeb834b57010a ]
This loop is freeing "clk" so it needs to use list_for_each_entry_safe(). Otherwise it dereferences a freed variable to get the next item on the loop.
--- drivers/clk/imx/clk-scu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/imx/clk-scu.c +2 -2
@@ -707,11 +707,11 @@ struct clk_hw *imx_clk_scu_alloc_dev(const char *name,void imx_clk_scu_unregister (void ) { -struct imx_scu_clk_node *clk; +struct imx_scu_clk_node *clk, *n;int i;for (i =0 ; i <IMX_SC_R_LAST ; i++) { -list_for_each_entry (clk, &imx_scu_clks[i], node) { +list_for_each_entry_safe (clk, n, &imx_scu_clks[i], node) {clk_hw_unregister (clk->hw);kfree (clk); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 178/591 hwmon: (f71882fg) prevent possible division by zero
In reply to Greg Kroah-HartmanFrom: Nikita Zhandarovich <[email protected]>
[ Upstream commit 0babf89c9cca7e074d6e59893e462e4886f481cc ]
In the unlikely event that something goes wrong with the device and its registers, the fan_from_reg() function may return 0. This value will cause a division-by-zero error in the show_pwm() function.
To prevent this, test the value of fan_from_reg(data->fan_full_speed[nr]) against 0 before performing the division. If the division-by-zero error is avoided, assign 0 to the val variable.
Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE.
--- drivers/hwmon/f71882fg.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/hwmon/f71882fg.c +5 -2
@@ -1096,8 +1096,11 @@ static ssize_t show_pwm(struct device *dev, val = data->pwm[nr]; else {/* RPM mode */ - val =255 *fan_from_reg (data->fan_target[nr]) - /fan_from_reg (data->fan_full_speed[nr]); +if (fan_from_reg (data->fan_full_speed[nr])) + val =255 *fan_from_reg (data->fan_target[nr]) + /fan_from_reg (data->fan_full_speed[nr]); +else + val =0 ; }mutex_unlock (&data->update_lock);return sprintf (buf,"%d\n" , val);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 179/591 RDMA/bnxt_re: Disable/kill tasklet only if it is enabled
In reply to Greg Kroah-HartmanFrom: Selvin Xavier <[email protected]>
[ Upstream commit ab112ee7899d6171da5acd77a7ed7ae103f488de ]
When the ulp hook to start the IRQ fails because the rings are not available, tasklets are not enabled. In this case when the driver is unloaded, driver calls CREQ tasklet_kill. This causes an indefinite hang as the tasklet is not enabled.
Driver shouldn't call tasklet_kill if it is not enabled. So using the creq->requested and nq->requested flags to identify if both tasklets/irqs are registered. Checking this flag while scheduling the tasklet from ISR. Also, added a cleanup for disabling tasklet, in case request_irq fails during start_irq.
Check for return value for bnxt_qplib_rcfw_start_irq and in case the bnxt_qplib_rcfw_start_irq fails, return bnxt_re_start_irq without attempting to start NQ IRQs.
--- drivers/infiniband/hw/bnxt_re/main.c | 12 +++++++++--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 16 ++++++++++------ drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 14 +++++++++----- 3 files changed, 28 insertions(+), 14 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +9 -3
@@ -333,15 +333,21 @@ static void bnxt_re_start_irq(void *handle, struct bnxt_msix_entry *ent)for (indx =0 ; indx < rdev->num_msix; indx++) rdev->msix_entries[indx].vector = ent[indx].vector; -bnxt_qplib_rcfw_start_irq (rcfw, msix_ent[BNXT_RE_AEQ_IDX ].vector, - false); + rc =bnxt_qplib_rcfw_start_irq (rcfw, msix_ent[BNXT_RE_AEQ_IDX ].vector, + false); +if (rc) { +ibdev_warn (&rdev->ibdev,"Failed to reinit CREQ\n" ); +return ; + }for (indx =BNXT_RE_NQ_IDX ; indx < rdev->num_msix; indx++) { nq = &rdev->nq[indx -1 ]; rc =bnxt_qplib_nq_start_irq (nq, indx -1 , msix_ent[indx].vector, false); -if (rc) +if (rc) {ibdev_warn (&rdev->ibdev,"Failed to reinit NQ index %d\n" , indx -1 ); +return ; + } } }
drivers/infiniband/hw/bnxt_re/qplib_fp.c +10 -6
@@ -405,6 +405,9 @@ static irqreturn_t bnxt_qplib_nq_irq(int irq, void *dev_instance)void bnxt_qplib_nq_stop_irq (struct bnxt_qplib_nq *nq,bool kill) { +if (!nq->requested) +return ; +tasklet_disable (&nq->nq_tasklet);/* Mask h/w interrupt */ bnxt_qplib_ring_nq_db (&nq->nq_db.dbinfo, nq->res->cctx, false);
@@ -412,11 +415,10 @@ void bnxt_qplib_nq_stop_irq(struct bnxt_qplib_nq *nq, bool kill)synchronize_irq (nq->msix_vec);if (kill)tasklet_kill (&nq->nq_tasklet); -if (nq->requested) { -irq_set_affinity_hint (nq->msix_vec,NULL ); -free_irq (nq->msix_vec, nq); - nq->requested = false; - } + +irq_set_affinity_hint (nq->msix_vec,NULL ); +free_irq (nq->msix_vec, nq); + nq->requested = false; }void bnxt_qplib_disable_nq (struct bnxt_qplib_nq *nq)
@@ -455,8 +457,10 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx,snprintf (nq->name,sizeof (nq->name),"bnxt_qplib_nq-%d" , nq_indx); rc =request_irq (nq->msix_vec, bnxt_qplib_nq_irq,0 , nq->name, nq); -if (rc) +if (rc) { +tasklet_disable (&nq->nq_tasklet);return rc; + }cpumask_clear (&nq->mask);cpumask_set_cpu (nq_indx, &nq->mask);
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +9 -5
@@ -635,6 +635,10 @@ void bnxt_qplib_rcfw_stop_irq(struct bnxt_qplib_rcfw *rcfw, bool kill)struct bnxt_qplib_creq_ctx *creq; creq = &rcfw->creq; + +if (!creq->requested) +return ; +tasklet_disable (&creq->creq_tasklet);/* Mask h/w interrupts */ bnxt_qplib_ring_nq_db (&creq->creq_db.dbinfo, rcfw->res->cctx, false);
@@ -643,10 +647,8 @@ void bnxt_qplib_rcfw_stop_irq(struct bnxt_qplib_rcfw *rcfw, bool kill)if (kill)tasklet_kill (&creq->creq_tasklet); -if (creq->requested) { -free_irq (creq->msix_vec, rcfw); - creq->requested = false; - } +free_irq (creq->msix_vec, rcfw); + creq->requested = false; }void bnxt_qplib_disable_rcfw_channel (struct bnxt_qplib_rcfw *rcfw)
@@ -692,8 +694,10 @@ int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector,tasklet_enable (&creq->creq_tasklet); rc =request_irq (creq->msix_vec, bnxt_qplib_creq_irq,0 ,"bnxt_qplib_creq" , rcfw); -if (rc) +if (rc) { +tasklet_disable (&creq->creq_tasklet);return rc; + } creq->requested = true;bnxt_qplib_ring_nq_db (&creq->creq_db.dbinfo, rcfw->res->cctx, true);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 180/591 RDMA/bnxt_re: Fix to remove unnecessary return labels
In reply to Greg Kroah-HartmanFrom: Kalesh AP <[email protected]>
[ Upstream commit 9b3ee47796f529e5bc31a355d6cb756d68a7079a ]
If there is no cleanup needed then just return directly. This cleans up the code and improve readability.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +2 -5
@@ -1605,7 +1605,7 @@ static int bnxt_qplib_put_inline(struct bnxt_qplib_qp *qp, il_src = (void *)wqe->sg_list[indx].addr; t_len += len;if (t_len > qp->max_inline_data) - goto bad; +return -ENOMEM ;while (len) {if (pull_dst) { pull_dst = false;
@@ -1629,8 +1629,6 @@ static int bnxt_qplib_put_inline(struct bnxt_qplib_qp *qp, }return t_len; -bad: -return -ENOMEM ; } static u32 bnxt_qplib_put_sges(struct bnxt_qplib_hwq *hwq,
@@ -2060,7 +2058,7 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) hwq_attr.sginfo = &cq->sg_info; rc =bnxt_qplib_alloc_init_hwq (&cq->hwq, &hwq_attr);if (rc) - goto exit; +return rc;RCFW_CMD_PREP (req,CREATE_CQ , cmd_flags);
@@ -2101,7 +2099,6 @@ int bnxt_qplib_create_cq(struct bnxt_qplib_res *res, struct bnxt_qplib_cq *cq) fail:bnxt_qplib_free_hwq (res, &cq->hwq); -exit:return rc; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 181/591 RDMA/bnxt_re: Use unique names while registering interrupts
In reply to Greg Kroah-HartmanFrom: Kalesh AP <[email protected]>
[ Upstream commit ff2e4bfd162cf66a112a81509e419805add44d64 ]
bnxt_re currently uses the names "bnxt_qplib_creq" and "bnxt_qplib_nq-0" while registering IRQs. There is no way to distinguish the IRQs of different device ports when there are multiple IB devices registered. This could make the scenarios worse where one want to pin IRQs of a device port to certain CPUs.
Fixed the code to use unique names which has PCI BDF information while registering interrupts like: "bnxt_re-nq-0@pci:0000:65:00.0" and "bnxt_re-creq@pci:0000:65:00.1".
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 ++++++++++-- drivers/infiniband/hw/bnxt_re/qplib_fp.h | 2 +- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 15 +++++++++++++-- drivers/infiniband/hw/bnxt_re/qplib_rcfw.h | 1 + 4 files changed, 25 insertions(+), 5 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +10 -2
@@ -418,6 +418,8 @@ void bnxt_qplib_nq_stop_irq(struct bnxt_qplib_nq *nq, bool kill)irq_set_affinity_hint (nq->msix_vec,NULL );free_irq (nq->msix_vec, nq); +kfree (nq->name); + nq->name =NULL ; nq->requested = false; }
@@ -444,6 +446,7 @@ void bnxt_qplib_disable_nq(struct bnxt_qplib_nq *nq)int bnxt_qplib_nq_start_irq (struct bnxt_qplib_nq *nq,int nq_indx,int msix_vector,bool need_init) { +struct bnxt_qplib_res *res = nq->res;int rc;if (nq->requested)
@@ -455,9 +458,14 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx,else tasklet_enable (&nq->nq_tasklet); -snprintf (nq->name,sizeof (nq->name),"bnxt_qplib_nq-%d" , nq_indx); + nq->name =kasprintf (GFP_KERNEL ,"bnxt_re-nq-%d@pci:%s" , + nq_indx,pci_name (res->pdev)); +if (!nq->name) +return -ENOMEM ; rc =request_irq (nq->msix_vec, bnxt_qplib_nq_irq,0 , nq->name, nq);if (rc) { +kfree (nq->name); + nq->name =NULL ;tasklet_disable (&nq->nq_tasklet);return rc; }
@@ -471,7 +479,7 @@ int bnxt_qplib_nq_start_irq(struct bnxt_qplib_nq *nq, int nq_indx, nq->msix_vec, nq_indx); } nq->requested = true; -bnxt_qplib_ring_nq_db (&nq->nq_db.dbinfo, nq->res->cctx, true); +bnxt_qplib_ring_nq_db (&nq->nq_db.dbinfo, res->cctx, true);return rc; }
drivers/infiniband/hw/bnxt_re/qplib_fp.h +1 -1
@@ -471,7 +471,7 @@ typedef int (*srqn_handler_t)(struct bnxt_qplib_nq *nq,struct bnxt_qplib_nq {struct pci_dev *pdev;struct bnxt_qplib_res *res; -char name[32 ]; +char *name;struct bnxt_qplib_hwq hwq;struct bnxt_qplib_nq_db nq_db;u16 ring_id;
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +13 -2
@@ -648,6 +648,8 @@ void bnxt_qplib_rcfw_stop_irq(struct bnxt_qplib_rcfw *rcfw, bool kill)tasklet_kill (&creq->creq_tasklet);free_irq (creq->msix_vec, rcfw); +kfree (creq->irq_name); + creq->irq_name =NULL ; creq->requested = false; }
@@ -680,9 +682,11 @@ int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector, bool need_init) {struct bnxt_qplib_creq_ctx *creq; +struct bnxt_qplib_res *res;int rc; creq = &rcfw->creq; + res = rcfw->res;if (creq->requested)return -EFAULT ;
@@ -692,15 +696,22 @@ int bnxt_qplib_rcfw_start_irq(struct bnxt_qplib_rcfw *rcfw, int msix_vector,tasklet_setup (&creq->creq_tasklet, bnxt_qplib_service_creq); else tasklet_enable(&creq->creq_tasklet); + + creq->irq_name =kasprintf (GFP_KERNEL ,"bnxt_re-creq@pci:%s" , +pci_name (res->pdev)); +if (!creq->irq_name) +return -ENOMEM ; rc =request_irq (creq->msix_vec, bnxt_qplib_creq_irq,0 , -"bnxt_qplib_creq" , rcfw); + creq->irq_name, rcfw);if (rc) { +kfree (creq->irq_name); + creq->irq_name =NULL ;tasklet_disable (&creq->creq_tasklet);return rc; } creq->requested = true; -bnxt_qplib_ring_nq_db (&creq->creq_db.dbinfo, rcfw->res->cctx, true); +bnxt_qplib_ring_nq_db (&creq->creq_db.dbinfo, res->cctx, true);return 0 ; }
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h +1 -0
@@ -174,6 +174,7 @@ struct bnxt_qplib_creq_ctx {u16 ring_id;int msix_vec;bool requested;/*irq handler installed */ +char *irq_name; };/* RCFW Communication Channels */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 182/591 RDMA/bnxt_re: Remove a redundant check inside bnxt_re_update_gid
In reply to Greg Kroah-HartmanFrom: Kalesh AP <[email protected]>
[ Upstream commit b989f90cef0af48aa5679b6a75476371705ec53c ]
The NULL check inside bnxt_re_update_gid() always return false. If sgid_tbl->tbl is not allocated, then dev_init would have failed.
--- drivers/infiniband/hw/bnxt_re/main.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/infiniband/hw/bnxt_re/main.c +1 -7
@@ -1182,12 +1182,6 @@ static int bnxt_re_update_gid(struct bnxt_re_dev *rdev)if (!ib_device_try_get (&rdev->ibdev))return 0 ; -if (!sgid_tbl) { -ibdev_err (&rdev->ibdev,"QPLIB: SGID table not allocated" ); - rc = -EINVAL ; - goto out; - } -for (index =0 ; index < sgid_tbl->active; index++) { gid_idx = sgid_tbl->hw_id[index];
@@ -1205,7 +1199,7 @@ static int bnxt_re_update_gid(struct bnxt_re_dev *rdev) rc =bnxt_qplib_update_sgid (sgid_tbl, &gid, gid_idx, rdev->qplib_res.netdev->dev_addr); } -out: +ib_device_put (&rdev->ibdev);return rc; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 183/591 RDMA/bnxt_re: Fix to remove an unnecessary log
In reply to Greg Kroah-HartmanFrom: Kalesh AP <[email protected]>
[ Upstream commit 43774bc156614346fe5dacabc8e8c229167f2536 ]
During destroy_qp, driver sets the qp handle in the existing CQEs belonging to the QP being destroyed to NULL. As a result, a poll_cq after destroy_qp can report unnecessary messages. Remove this noise from system logs.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +1 -4
@@ -2734,11 +2734,8 @@ static int bnxt_qplib_cq_process_terminal(struct bnxt_qplib_cq *cq, qp = (struct bnxt_qplib_qp *)((unsigned long )le64_to_cpu (hwcqe->qp_handle)); -if (!qp) { -dev_err (&cq->hwq.pdev->dev, -"FP: CQ Process terminal qp is NULL\n" ); +if (!qp)return -EINVAL ; - }/* Must block new posting of SQ and RQ */ qp->state =CMDQ_MODIFY_QP_NEW_STATE_ERR ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 184/591 drm/msm/dsi: dont allow enabling 14nm VCO with unprogrammed rate
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 1e0a97f84d73ea1182740f62069690c7f3271abb ]
If the dispcc uses CLK_OPS_PARENT_ENABLE (e.g. on QCM2290), CCF can try enabling VCO before the rate has been programmed. This can cause clock lockups and/or other boot issues. Program the VCO to the minimal PLL rate if the read rate is 0 Hz.
Patchwork: https://patchwork.freedesktop.org/patch/534813/
--- drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/msm/dsi/phy/dsi_phy_14nm.c +3 -0
@@ -539,6 +539,9 @@ static int dsi_pll_14nm_vco_prepare(struct clk_hw *hw)if (unlikely (pll_14nm->phy->pll_on))return 0 ; +if (dsi_pll_14nm_vco_recalc_rate (hw,VCO_REF_CLK_RATE ) ==0 ) +dsi_pll_14nm_vco_set_rate (hw, pll_14nm->phy->cfg->min_pll_rate,VCO_REF_CLK_RATE ); +dsi_phy_write (base + REG_DSI_14nm_PHY_PLL_VREF_CFG1,0x10 );dsi_phy_write (cmn_base + REG_DSI_14nm_PHY_CMN_PLL_CNTRL,1 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 185/591 drm/msm/disp/dpu: get timing engine status from intf status register
In reply to Greg Kroah-HartmanFrom: Vinod Polimera <[email protected]>
[ Upstream commit e3969eadc8ee78a5bdca65b8ed0a421a359e4090 ]
Recommended way of reading the interface timing gen status is via status register. Timing gen status register will give a reliable status of the interface especially during ON/OFF transitions. This support was added from DPU version 5.0.0.
Patchwork: https://patchwork.freedesktop.org/patch/524724/
Stable-dep-of: a7129231edf3 ("drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK")
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 3 ++- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h | 12 +++++++----- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c | 8 +++++++- 3 files changed, 16 insertions(+), 7 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +2 -1
@@ -79,7 +79,8 @@#define INTF_SDM845_MASK (0) -#define INTF_SC7180_MASK BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) +#define INTF_SC7180_MASK \ + (BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | BIT(DPU_INTF_STATUS_SUPPORTED))#define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.h +7 -5
@@ -203,17 +203,19 @@ enum {/** * INTF sub-blocks -* @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which -* pixel data arrives to this INTF -* @DPU_INTF_TE INTF block has TE configuration support -* @DPU_DATA_HCTL_EN Allows data to be transferred at different rate -than video timing +* @DPU_INTF_INPUT_CTRL Supports the setting of pp block from which +* pixel data arrives to this INTF +* @DPU_INTF_TE INTF block has TE configuration support +* @DPU_DATA_HCTL_EN Allows data to be transferred at different rate +* than video timing +* @DPU_INTF_STATUS_SUPPORTED INTF block has INTF_STATUS register * @DPU_INTF_MAX */ enum {DPU_INTF_INPUT_CTRL =0x1 ,DPU_INTF_TE ,DPU_DATA_HCTL_EN , +DPU_INTF_STATUS_SUPPORTED ,DPU_INTF_MAX };
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_intf.c +7 -1
@@ -57,6 +57,7 @@#define INTF_PROG_FETCH_START 0x170#define INTF_PROG_ROT_START 0x174#define INTF_MUX 0x25C +#define INTF_STATUS 0x26C#define INTF_CFG_ACTIVE_H_EN BIT(29)#define INTF_CFG_ACTIVE_V_EN BIT(30)
@@ -292,8 +293,13 @@ static void dpu_hw_intf_get_status( struct intf_status *s) {struct dpu_hw_blk_reg_map *c = &intf->hw; +unsigned long cap = intf->cap->features; + +if (cap &BIT (DPU_INTF_STATUS_SUPPORTED )) + s->is_en =DPU_REG_READ (c,INTF_STATUS ) &BIT (0 ); +else + s->is_en =DPU_REG_READ (c,INTF_TIMING_ENGINE_EN ); - s->is_en =DPU_REG_READ (c,INTF_TIMING_ENGINE_EN ); s->is_prog_fetch_en = !!(DPU_REG_READ (c,INTF_CONFIG ) &BIT (31 ));if (s->is_en) { s->frame_count =DPU_REG_READ (c,INTF_FRAME_COUNT );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 186/591 drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit a7129231edf329a00e92dbd2d741f6da728a4a06 ]
DPU5 and newer targets enable this unconditionally. Move it from the SC7280 mask to the SC7180 one.
Patchwork: https://patchwork.freedesktop.org/patch/538159/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +5 -2
@@ -80,9 +80,12 @@#define INTF_SDM845_MASK (0)#define INTF_SC7180_MASK \ - (BIT(DPU_INTF_INPUT_CTRL) | BIT(DPU_INTF_TE) | BIT(DPU_INTF_STATUS_SUPPORTED)) + (BIT(DPU_INTF_INPUT_CTRL) | \ + BIT(DPU_INTF_TE) | \ + BIT(DPU_INTF_STATUS_SUPPORTED) | \ + BIT(DPU_DATA_HCTL_EN)) -#define INTF_SC7280_MASK INTF_SC7180_MASK | BIT(DPU_DATA_HCTL_EN) +#define INTF_SC7280_MASK (INTF_SC7180_MASK)#define IRQ_SDM845_MASK (BIT(MDP_SSPP_TOP0_INTR) | \ BIT(MDP_SSPP_TOP0_INTR2) | \
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 187/591 iommu/virtio: Detach domain on endpoint release
In reply to Greg Kroah-HartmanFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit 809d0810e3520da669d231303608cdf5fe5c1a70 ]
When an endpoint is released, for example a PCIe VF being destroyed or a function hot-unplugged, it should be detached from its domain. Send a DETACH request.
--- drivers/iommu/virtio-iommu.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/iommu/virtio-iommu.c +24 -0
@@ -789,6 +789,29 @@ static int viommu_attach_dev(struct iommu_domain *domain, struct device *dev)return 0 ; } +static void viommu_detach_dev (struct viommu_endpoint *vdev) +{ +int i; +struct virtio_iommu_req_detach req; +struct viommu_domain *vdomain = vdev->vdomain; +struct iommu_fwspec *fwspec =dev_iommu_fwspec_get (vdev->dev); + +if (!vdomain) +return ; + + req = (struct virtio_iommu_req_detach ) { + .head.type =VIRTIO_IOMMU_T_DETACH , + .domain =cpu_to_le32 (vdomain->id), + }; + +for (i =0 ; i < fwspec->num_ids; i++) { + req.endpoint =cpu_to_le32 (fwspec->ids[i]); +WARN_ON (viommu_send_req_sync (vdev->viommu, &req,sizeof (req))); + } + vdomain->nr_endpoints--; + vdev->vdomain =NULL ; +} +static int viommu_map_pages (struct iommu_domain *domain,unsigned long iova,phys_addr_t paddr,size_t pgsize,size_t pgcount,int prot,gfp_t gfp,size_t *mapped)
@@ -991,6 +1014,7 @@ static void viommu_release_device(struct device *dev) {struct viommu_endpoint *vdev =dev_iommu_priv_get (dev); +viommu_detach_dev (vdev);iommu_put_resv_regions (dev, &vdev->resv_regions);kfree (vdev); }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 188/591 iommu/virtio: Return size mapped for a detached domain
In reply to Greg Kroah-HartmanFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit 7061b6af34686e7e2364b7240cfb061293218f2d ]
When map() is called on a detached domain, the domain does not exist in the device so we do not send a MAP request, but we do update the internal mapping tree, to be replayed on the next attach. Since this constitutes a successful iommu_map() call, return *mapped in this case too.
--- drivers/iommu/virtio-iommu.c | 33 +++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-)
drivers/iommu/virtio-iommu.c +17 -16
@@ -834,25 +834,26 @@ static int viommu_map_pages(struct iommu_domain *domain, unsigned long iova,if (ret)return ret; - map = (struct virtio_iommu_req_map ) { - .head.type =VIRTIO_IOMMU_T_MAP , - .domain =cpu_to_le32 (vdomain->id), - .virt_start =cpu_to_le64 (iova), - .phys_start =cpu_to_le64 (paddr), - .virt_end =cpu_to_le64 (end), - .flags =cpu_to_le32 (flags), - }; - -if (!vdomain->nr_endpoints) -return 0 ; +if (vdomain->nr_endpoints) { + map = (struct virtio_iommu_req_map ) { + .head.type =VIRTIO_IOMMU_T_MAP , + .domain =cpu_to_le32 (vdomain->id), + .virt_start =cpu_to_le64 (iova), + .phys_start =cpu_to_le64 (paddr), + .virt_end =cpu_to_le64 (end), + .flags =cpu_to_le32 (flags), + }; - ret =viommu_send_req_sync (vdomain->viommu, &map,sizeof (map)); -if (ret) -viommu_del_mappings (vdomain, iova, end); -else if (mapped) + ret =viommu_send_req_sync (vdomain->viommu, &map,sizeof (map)); +if (ret) { +viommu_del_mappings (vdomain, iova, end); +return ret; + } + } +if (mapped) *mapped = size; -return ret; +return 0 ; } static size_t viommu_unmap_pages(struct iommu_domain *domain, unsigned long iova,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 189/591 clk: renesas: rzg2l: Fix CPG_SIPLL5_CLK1 register write
In reply to Greg Kroah-HartmanFrom: Biju Das <[email protected]>
[ Upstream commit d1c20885d3b01e6a62e920af4b227abd294d22f3 ]
As per the RZ/G2L HW(Rev.1.30 May2023) manual, there are no "write enable" bits in the CPG_SIPLL5_CLK1 register. So fix the CPG_SIPLL5_CLK register write by removing the "write enable" bits.
--- drivers/clk/renesas/rzg2l-cpg.c | 6 ++---- drivers/clk/renesas/rzg2l-cpg.h | 3 --- 2 files changed, 2 insertions(+), 7 deletions(-)
drivers/clk/renesas/rzg2l-cpg.c +2 -4
@@ -600,10 +600,8 @@ static int rzg2l_cpg_sipll5_set_rate(struct clk_hw *hw, }/* Output clock setting 1 */ -writel (CPG_SIPLL5_CLK1_POSTDIV1_WEN |CPG_SIPLL5_CLK1_POSTDIV2_WEN | -CPG_SIPLL5_CLK1_REFDIV_WEN | (params.pl5_postdiv1 <<0 ) | - (params.pl5_postdiv2 <<4 ) | (params.pl5_refdiv <<8 ), - priv->base +CPG_SIPLL5_CLK1 ); +writel ((params.pl5_postdiv1 <<0 ) | (params.pl5_postdiv2 <<4 ) | + (params.pl5_refdiv <<8 ), priv->base +CPG_SIPLL5_CLK1 );/* Output clock setting, SSCG modulation value setting 3 */ writel ((params.pl5_fracin <<8 ), priv->base +CPG_SIPLL5_CLK3 );
drivers/clk/renesas/rzg2l-cpg.h +0 -3
@@ -32,9 +32,6 @@#define CPG_SIPLL5_STBY_RESETB_WEN BIT(16)#define CPG_SIPLL5_STBY_SSCG_EN_WEN BIT(18)#define CPG_SIPLL5_STBY_DOWNSPREAD_WEN BIT(20) -#define CPG_SIPLL5_CLK1_POSTDIV1_WEN BIT(16) -#define CPG_SIPLL5_CLK1_POSTDIV2_WEN BIT(20) -#define CPG_SIPLL5_CLK1_REFDIV_WEN BIT(24)#define CPG_SIPLL5_CLK4_RESV_LSB (0xFF)#define CPG_SIPLL5_MON_PLL5_LOCK BIT(4)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 190/591 ARM: dts: gta04: Move model property out of pinctrl node
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 4ffec92e70ac5097b9f67ec154065305b16a3b46 ]
The model property should be at the top level, let's move it out of the pinctrl node.
--- arch/arm/boot/dts/omap3-gta04a5one.dts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/arm/boot/dts/omap3-gta04a5one.dts +3 -1
@@ -5,9 +5,11 @@ #include "omap3-gta04a5.dts" -&omap3_pmx_core { +/ { model = "Goldelico GTA04A5/Letux 2804 with OneNAND"; +}; +&omap3_pmx_core { gpmc_pins: pinmux_gpmc_pins { pinctrl-single,pins = <
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 191/591 drm/bridge: anx7625: Convert to i2cs .probe_new()
In reply to Greg Kroah-HartmanFrom: Uwe Kleine-König <[email protected]>
[ Upstream commit 71450f8c824f5571d4af9e6e021b733085c8e690 ]
The probe function doesn't make use of the i2c_device_id * parameter so it can be trivially converted.
Stable-dep-of: 1464e48d69ab ("drm/bridge: anx7625: Prevent endless probe loop")
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +2 -3
@@ -2562,8 +2562,7 @@ static void anx7625_runtime_disable(void *data)pm_runtime_disable (data); } -static int anx7625_i2c_probe (struct i2c_client *client, -const struct i2c_device_id *id) +static int anx7625_i2c_probe (struct i2c_client *client) {struct anx7625_data *platform;struct anx7625_platform_data *pdata;
@@ -2756,7 +2755,7 @@ static struct i2c_driver anx7625_driver = { .of_match_table = anx_match_table, .pm = &anx7625_pm_ops, }, - .probe = anx7625_i2c_probe, + .probe_new = anx7625_i2c_probe, .remove = anx7625_i2c_remove, .id_table = anx7625_id,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 192/591 drm/bridge: anx7625: Prevent endless probe loop
In reply to Greg Kroah-HartmanFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit 1464e48d69ab7a50a377c9d39f5e5eb3cee2722e ]
During probe, the driver registers i2c dummy devices and populates the aux bus, which registers a device for the panel. After doing that, the driver can still defer probe if needed. This ordering of operations is troublesome however, because the deferred probe work will retry probing all pending devices every time a new device is registered. Therefore, if modules need to be loaded in order to satisfy the dependencies for this driver to complete probe, the kernel will stall, since it'll keep trying to probe the anx7625 driver, but never succeed, given that modules would only be loaded after the deferred probe work completes.
Two changes are required to avoid this issue:
* Move of_find_mipi_dsi_host_by_node(), which can defer probe, to before anx7625_register_i2c_dummy_clients() and devm_of_dp_aux_populate_ep_devices(), which register devices.
* Make use of the done_probing callback when populating the aux bus, so that the bridge registration is only done after the panel is probed. This is required because the panel might need to defer probe, but the aux bus population needs the i2c dummy devices working, so this call couldn't just be moved to an earlier point in probe. One caveat is that if the panel is described outside the aux bus, the probe loop issue can still happen, but we don't have a way to avoid it in that case since there's no callback available.
With this patch applied, it's possible to boot on
mt8192-asurada-spherion with
CONFIG_DRM_ANALOGIX_ANX7625=yCONFIG_MTK_MMSYS=mCONFIG_BACKLIGHT_PWM=y
and also with
CONFIG_DRM_ANALOGIX_ANX7625=yCONFIG_MTK_MMSYS=yCONFIG_BACKLIGHT_PWM=m
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 128 +++++++++++++++------- 1 file changed, 88 insertions(+), 40 deletions(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +88 -40
@@ -1689,6 +1689,14 @@ static int anx7625_parse_dt(struct device *dev,if (of_property_read_bool (np,"analogix,audio-enable" )) pdata->audio_en =1 ; +return 0 ; +} + +static int anx7625_parse_dt_panel (struct device *dev, +struct anx7625_platform_data *pdata) +{ +struct device_node *np = dev->of_node; + pdata->panel_bridge =devm_drm_of_get_bridge (dev, np,1 ,0 );if (IS_ERR (pdata->panel_bridge)) {if (PTR_ERR (pdata->panel_bridge) == -ENODEV ) {
@@ -2034,7 +2042,7 @@ static int anx7625_register_audio(struct device *dev, struct anx7625_data *ctx)return 0 ; } -static int anx7625_attach_dsi (struct anx7625_data *ctx) +static int anx7625_setup_dsi_device (struct anx7625_data *ctx) {struct mipi_dsi_device *dsi;struct device *dev = &ctx->client->dev;
@@ -2044,9 +2052,6 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx) .channel = 0, .node = NULL, }; -int ret; - -DRM_DEV_DEBUG_DRIVER (dev,"attach dsi\n" ); host =of_find_mipi_dsi_host_by_node (ctx->pdata.mipi_host_node);if (!host) {
@@ -2067,14 +2072,24 @@ static int anx7625_attach_dsi(struct anx7625_data *ctx)MIPI_DSI_MODE_VIDEO_HSE |MIPI_DSI_HS_PKT_END_ALIGNED ; - ret =devm_mipi_dsi_attach (dev, dsi); + ctx->dsi = dsi; + +return 0 ; +} + +static int anx7625_attach_dsi (struct anx7625_data *ctx) +{ +struct device *dev = &ctx->client->dev; +int ret; + +DRM_DEV_DEBUG_DRIVER (dev,"attach dsi\n" ); + + ret =devm_mipi_dsi_attach (dev, ctx->dsi);if (ret) {DRM_DEV_ERROR (dev,"fail to attach dsi to host.\n" );return ret; } - ctx->dsi = dsi; -DRM_DEV_DEBUG_DRIVER (dev,"attach dsi succeeded.\n" );return 0 ;
@@ -2562,6 +2577,40 @@ static void anx7625_runtime_disable(void *data)pm_runtime_disable (data); } +static int anx7625_link_bridge (struct drm_dp_aux *aux) +{ + struct anx7625_data *platform = container_of(aux, struct anx7625_data, aux); +struct device *dev = aux->dev; +int ret; + + ret =anx7625_parse_dt_panel (dev, &platform->pdata); +if (ret) { +DRM_DEV_ERROR (dev,"fail to parse DT for panel : %d\n" , ret); +return ret; + } + + platform->bridge.funcs = &anx7625_bridge_funcs; + platform->bridge.of_node = dev->of_node; +if (!anx7625_of_panel_on_aux_bus (dev)) + platform->bridge.ops |=DRM_BRIDGE_OP_EDID ; +if (!platform->pdata.panel_bridge) + platform->bridge.ops |=DRM_BRIDGE_OP_HPD | +DRM_BRIDGE_OP_DETECT ; + platform->bridge.type = platform->pdata.panel_bridge ? + DRM_MODE_CONNECTOR_eDP : + DRM_MODE_CONNECTOR_DisplayPort; + +drm_bridge_add (&platform->bridge); + +if (!platform->pdata.is_dpi) { + ret =anx7625_attach_dsi (platform); +if (ret) +drm_bridge_remove (&platform->bridge); + } + +return ret; +} +static int anx7625_i2c_probe (struct i2c_client *client) {struct anx7625_data *platform;
@@ -2636,6 +2685,24 @@ static int anx7625_i2c_probe(struct i2c_client *client) platform->aux.wait_hpd_asserted = anx7625_wait_hpd_asserted;drm_dp_aux_init (&platform->aux); + ret =anx7625_parse_dt (dev, pdata); +if (ret) { +if (ret != -EPROBE_DEFER ) +DRM_DEV_ERROR (dev,"fail to parse DT : %d\n" , ret); + goto free_wq; + } + +if (!platform->pdata.is_dpi) { + ret =anx7625_setup_dsi_device (platform); +if (ret <0 ) + goto free_wq; + } + +/* +* Registering the i2c devices will retrigger deferred probe, so it +* needs to be done after calls that might return EPROBE_DEFER, +* otherwise we can get an infinite loop. +*/ if (anx7625_register_i2c_dummy_clients (platform, client) !=0 ) { ret = -ENOMEM ;DRM_DEV_ERROR (dev,"fail to reserve I2C bus.\n" );
@@ -2650,13 +2717,21 @@ static int anx7625_i2c_probe(struct i2c_client *client)if (ret) goto free_wq; -devm_of_dp_aux_populate_ep_devices (&platform->aux); - - ret =anx7625_parse_dt (dev, pdata); +/* +* Populating the aux bus will retrigger deferred probe, so it needs to +* be done after calls that might return EPROBE_DEFER, otherwise we can +* get an infinite loop. +*/ + ret =devm_of_dp_aux_populate_bus (&platform->aux, anx7625_link_bridge);if (ret) { -if (ret != -EPROBE_DEFER ) -DRM_DEV_ERROR (dev,"fail to parse DT : %d\n" , ret); - goto free_wq; +if (ret != -ENODEV ) { +DRM_DEV_ERROR (dev,"failed to populate aux bus : %d\n" , ret); + goto free_wq; + } + + ret =anx7625_link_bridge (&platform->aux); +if (ret) + goto free_wq; }if (!platform->pdata.low_power_mode) {
@@ -2669,27 +2744,6 @@ static int anx7625_i2c_probe(struct i2c_client *client)if (platform->pdata.intp_irq)queue_work (platform->workqueue, &platform->work); - platform->bridge.funcs = &anx7625_bridge_funcs; - platform->bridge.of_node = client->dev.of_node; -if (!anx7625_of_panel_on_aux_bus (&client->dev)) - platform->bridge.ops |=DRM_BRIDGE_OP_EDID ; -if (!platform->pdata.panel_bridge) - platform->bridge.ops |=DRM_BRIDGE_OP_HPD | -DRM_BRIDGE_OP_DETECT ; - platform->bridge.type = platform->pdata.panel_bridge ? - DRM_MODE_CONNECTOR_eDP : - DRM_MODE_CONNECTOR_DisplayPort; - -drm_bridge_add (&platform->bridge); - -if (!platform->pdata.is_dpi) { - ret =anx7625_attach_dsi (platform); -if (ret) { -DRM_DEV_ERROR (dev,"Fail to attach to dsi : %d\n" , ret); - goto unregister_bridge; - } - } -if (platform->pdata.audio_en)anx7625_register_audio (dev, platform);
@@ -2697,12 +2751,6 @@ static int anx7625_i2c_probe(struct i2c_client *client)return 0 ; -unregister_bridge: -drm_bridge_remove (&platform->bridge); - -if (!platform->pdata.low_power_mode) -pm_runtime_put_sync_suspend (&client->dev); - free_wq:if (platform->workqueue)destroy_workqueue (platform->workqueue);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 193/591 ARM: dts: qcom: msm8974: do not use underscore in node name (again)
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 311bbc884b2edcf584b67d331be85ce43b27586f ]
Align RPM requests node with DT schema by using hyphen instead of underscore.
--- arch/arm/boot/dts/qcom-msm8974.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-msm8974.dtsi +1 -1
@@ -300,7 +300,7 @@ rpm { qcom,ipc = <&apcs 8 0>; qcom,smd-edge = <15>; - rpm_requests: rpm_requests { + rpm_requests: rpm-requests { compatible = "qcom,rpm-msm8974"; qcom,smd-channels = "rpm_requests";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 194/591 arm64: dts: qcom: msm8916: correct camss unit address
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 48798d992ce276cf0d57bf75318daf8eabd02aa4 ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc@0/camss@1b00000: simple-bus unit address format error, expected "1b0ac00"
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +1 -1
@@ -1088,7 +1088,7 @@ dsi_phy0: dsi-phy@1a98300 { }; }; - camss: camss@1b00000 { + camss: camss@1b0ac00 { compatible = "qcom,msm8916-camss"; reg = <0x01b0ac00 0x200>, <0x01b00030 0x4>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 195/591 arm64: dts: qcom: msm8916: correct MMC unit address
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 72644bc76d5145c098c268829554a0b98fab1de1 ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc@0/mmc@7824000: simple-bus unit address format error, expected "7824900" Warning (simple_bus_reg): /soc@0/mmc@7864000: simple-bus unit address format error, expected "7864900"
--- arch/arm64/boot/dts/qcom/msm8916.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/msm8916.dtsi +2 -2
@@ -1480,7 +1480,7 @@ lpass_codec: audio-codec@771c000 { #sound-dai-cells = <1>; }; - sdhc_1: mmc@7824000 { + sdhc_1: mmc@7824900 { compatible = "qcom,msm8916-sdhci", "qcom,sdhci-msm-v4"; reg = <0x07824900 0x11c>, <0x07824000 0x800>; reg-names = "hc", "core";
@@ -1498,7 +1498,7 @@ sdhc_1: mmc@7824000 { status = "disabled"; }; - sdhc_2: mmc@7864000 { + sdhc_2: mmc@7864900 { compatible = "qcom,msm8916-sdhci", "qcom,sdhci-msm-v4"; reg = <0x07864900 0x11c>, <0x07864000 0x800>; reg-names = "hc", "core";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 196/591 arm64: dts: qcom: msm8994: correct SPMI unit address
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 24f0f6a8059c7108d4ee3476c95db1e7ff4feb79 ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc/spmi@fc4c0000: simple-bus unit address format error, expected "fc4cf000"
--- arch/arm64/boot/dts/qcom/msm8994.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8994.dtsi +1 -1
@@ -746,7 +746,7 @@ restart@fc4ab000 { reg = <0xfc4ab000 0x4>; }; - spmi_bus: spmi@fc4c0000 { + spmi_bus: spmi@fc4cf000 { compatible = "qcom,spmi-pmic-arb"; reg = <0xfc4cf000 0x1000>, <0xfc4cb000 0x1000>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 197/591 arm64: dts: qcom: msm8996: correct camss unit address
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit e959ced1d0e5ef0b1f66a0c2d0e1ae80790e5ca5 ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc/camss@a00000: simple-bus unit address format error, expected "a34000"
--- arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8996.dtsi +1 -1
@@ -2045,7 +2045,7 @@ ufsphy_lane: phy@627400 { }; }; - camss: camss@a00000 { + camss: camss@a34000 { compatible = "qcom,msm8996-camss"; reg = <0x00a34000 0x1000>, <0x00a00030 0x4>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 198/591 arm64: dts: qcom: sdm630: correct camss unit address
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit c8b7faa7e9913a94444b3f00b6480e53a174fcfd ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc/camss@ca00000: simple-bus unit address format error, expected "ca00020"
--- arch/arm64/boot/dts/qcom/sdm630.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm630.dtsi +1 -1
@@ -1902,7 +1902,7 @@ pil-reloc@94c { }; }; - camss: camss@ca00000 { + camss: camss@ca00020 { compatible = "qcom,sdm660-camss"; reg = <0x0ca00020 0x10>, <0x0ca30000 0x100>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 199/591 arm64: dts: qcom: sdm845: correct camss unit address
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit a05b913a27e46926ba60ba2bcacc7ec7a8403e4c ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc@0/camss@a00000: simple-bus unit address format error, expected "acb3000"
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -1
@@ -4207,7 +4207,7 @@ videocc: clock-controller@ab00000 { #reset-cells = <1>; }; - camss: camss@a00000 { + camss: camss@acb3000 { compatible = "qcom,sdm845-camss"; reg = <0 0xacb3000 0 0x1000>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 200/591 arm64: dts: qcom: sm8350: Add GPI DMA compatible fallback
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit b561e225dee5412609fd98340ca71ba0ab2e4b36 ]
Use SM6350 as fallback for GPI DMA, to indicate devices are compatible and that drivers can bind with only one compatible.
Stable-dep-of: 41d6bca799b3 ("arm64: dts: qcom: sm8350: correct DMA controller unit address")
--- arch/arm64/boot/dts/qcom/sm8350.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +3 -3
@@ -678,7 +678,7 @@ ipcc: mailbox@408000 { }; gpi_dma2: dma-controller@800000 { - compatible = "qcom,sm8350-gpi-dma"; + compatible = "qcom,sm8350-gpi-dma", "qcom,sm6350-gpi-dma"; reg = <0 0x00800000 0 0x60000>; interrupts = <GIC_SPI 588 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 589 IRQ_TYPE_LEVEL_HIGH>,
@@ -904,7 +904,7 @@ spi19: spi@894000 { }; gpi_dma0: dma-controller@900000 { - compatible = "qcom,sm8350-gpi-dma"; + compatible = "qcom,sm8350-gpi-dma", "qcom,sm6350-gpi-dma"; reg = <0 0x09800000 0 0x60000>; interrupts = <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 245 IRQ_TYPE_LEVEL_HIGH>,
@@ -1207,7 +1207,7 @@ spi7: spi@99c000 { }; gpi_dma1: dma-controller@a00000 { - compatible = "qcom,sm8350-gpi-dma"; + compatible = "qcom,sm8350-gpi-dma", "qcom,sm6350-gpi-dma"; reg = <0 0x00a00000 0 0x60000>; interrupts = <GIC_SPI 279 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 280 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 201/591 arm64: dts: qcom: sm8350: correct DMA controller unit address
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 41d6bca799b3f40d4d3c22dd4545aeac7c210e33 ]
Match unit-address to reg entry to fix dtbs W=1 warnings:
Warning (simple_bus_reg): /soc@0/dma-controller@900000: simple-bus unit address format error, expected "9800000"
--- arch/arm64/boot/dts/qcom/sm8350.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/sm8350.dtsi +1 -1
@@ -903,7 +903,7 @@ spi19: spi@894000 { }; }; - gpi_dma0: dma-controller@900000 { + gpi_dma0: dma-controller@9800000 { compatible = "qcom,sm8350-gpi-dma", "qcom,sm6350-gpi-dma"; reg = <0 0x09800000 0 0x60000>; interrupts = <GIC_SPI 244 IRQ_TYPE_LEVEL_HIGH>,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 202/591 arm64: dts: qcom: sdm845-polaris: add missing touchscreen child node reg
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 4a0156b8862665a3e31c8280607388e3001ace3d ]
Add missing reg property to touchscreen child node to fix dtbs W=1 warnings:
Warning (unit_address_vs_reg): /soc@0/geniqup@ac0000/i2c@a98000/touchscreen@20/rmi4-f12@12: node has a unit name, but no reg or ranges property
--- arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sdm845-xiaomi-polaris.dts +1 -0
@@ -484,6 +484,7 @@ rmi4-f01@1 { }; rmi4-f12@12 { + reg = <0x12>; syna,rezero-wait-ms = <0xc8>; syna,clip-x-high = <0x438>; syna,clip-y-high = <0x870>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 203/591 arm64: dts: qcom: apq8016-sbc: Fix regulator constraints
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit e27654df20d77ad7549a3cf6739ebaa3aa59a088 ]
For some reason DB410c has completely bogus regulator constraints that actually just correspond to the programmable voltages which are already provided by the regulator driver. Some of them are not just outside the recommended operating conditions of the APQ8016E SoC but even exceed the absolute maximum ratings, potentially risking permanent device damage.
In practice it's not quite as dangerous thanks to the RPM firmware:
It turns out that it has its own voltage constraints and silently clamps all regulator requests. For example, requesting 3.3V for L5 (allowed by the current regulator constraints!) still results in 1.8V being programmed in the actual regulator hardware.
Experimentation with various voltages shows that the internal RPM voltage constraints roughly correspond to the safe "specified range" in the PM8916 Device Specification (rather than the "programmable range" used inside apq8016-sbc.dtsi right now).
Combine those together with some fixed voltages used in the old msm-3.10 device tree from Qualcomm to give DB410c some actually valid voltage constraints.
--- arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 64 ++++++++++++------------ 1 file changed, 32 insertions(+), 32 deletions(-)
arch/arm64/boot/dts/qcom/apq8016-sbc.dts +32 -32
@@ -448,21 +448,21 @@ &smd_rpm_regulators { vdd_l7-supply = <&pm8916_s4>; s3 { - regulator-min-microvolt = <375000>; - regulator-max-microvolt = <1562000>; + regulator-min-microvolt = <1250000>; + regulator-max-microvolt = <1350000>; }; s4 { - regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <1800000>; + regulator-min-microvolt = <1850000>; + regulator-max-microvolt = <2150000>; regulator-always-on; regulator-boot-on; }; l1 { - regulator-min-microvolt = <375000>; - regulator-max-microvolt = <1525000>; + regulator-min-microvolt = <1225000>; + regulator-max-microvolt = <1225000>; }; l2 {
@@ -471,13 +471,13 @@ l2 { }; l4 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <2050000>; + regulator-max-microvolt = <2050000>; }; l5 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; }; l6 {
@@ -486,45 +486,45 @@ l6 { }; l7 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; }; l8 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <2900000>; + regulator-max-microvolt = <2900000>; }; l9 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <3300000>; + regulator-max-microvolt = <3300000>; }; l10 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <2800000>; + regulator-max-microvolt = <2800000>; }; l11 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <2950000>; + regulator-max-microvolt = <2950000>; regulator-allow-set-load; regulator-system-load = <200000>; }; l12 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <2950000>; }; l13 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <3075000>; + regulator-max-microvolt = <3075000>; }; l14 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; }; /**
@@ -532,14 +532,14 @@ l14 { * for mezzanine boards */ l15 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <1800000>; regulator-always-on; }; l16 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <1800000>; + regulator-max-microvolt = <3300000>; }; l17 {
@@ -548,8 +548,8 @@ l17 { }; l18 { - regulator-min-microvolt = <1750000>; - regulator-max-microvolt = <3337000>; + regulator-min-microvolt = <2700000>; + regulator-max-microvolt = <2700000>; }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 204/591 arm64: dts: qcom: apq8016-sbc: Fix 1.8V power rail on LS expansion
In reply to Greg Kroah-HartmanFrom: Stephan Gerhold <[email protected]>
[ Upstream commit 5500f823db38db073d30557af159b77fb1f2bf26 ]
The 96Boards specification expects a 1.8V power rail on the low-speed expansion connector that is able to provide at least 0.18W / 100 mA. According to the DB410c hardware user manual this is done by connecting both L15 and L16 in parallel with up to 55mA each (for 110 mA total) [1].
Unfortunately the current regulator setup in the DB410c device tree does not implement the specification correctly and only provides 5 mA:
- Only L15 is marked always-on, so L16 is never enabled.
- Without specifying a load the regulator is put into LPM where it can only provide 5 mA.
Fix this by:
- Adding proper voltage constraints for L16.
- Making L16 always-on.
- Adding regulator-system-load for both L15 and L16. 100 mA should be available in total, so specify 50 mA for each. (The regulator hardware can only be in normal (55 mA) or low-power mode (5 mA) so this will actually result in the expected 110 mA total...)
--- arch/arm64/boot/dts/qcom/apq8016-sbc.dts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/qcom/apq8016-sbc.dts +12 -4
@@ -527,19 +527,27 @@ l14 { regulator-max-microvolt = <3300000>; }; - /** - * 1.8v required on LS expansion - * for mezzanine boards + /* + * The 96Boards specification expects a 1.8V power rail on the low-speed + * expansion connector that is able to provide at least 0.18W / 100 mA. + * L15/L16 are connected in parallel to provide 55 mA each. A minimum load + * must be specified to ensure the regulators are not put in LPM where they + * would only provide 5 mA. */ l15 { regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + regulator-system-load = <50000>; + regulator-allow-set-load; regulator-always-on; }; l16 { regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3300000>; + regulator-max-microvolt = <1800000>; + regulator-system-load = <50000>; + regulator-allow-set-load; + regulator-always-on; }; l17 {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 205/591 drm/bridge: Introduce pre_enable_prev_first to alter bridge init order
In reply to Greg Kroah-HartmanFrom: Dave Stevenson <[email protected]>
[ Upstream commit 4fb912e5e19075874379cfcf074d90bd51ebf8ea ]
DSI sink devices typically want the DSI host powered up and configured before they are powered up. pre_enable is the place this would normally happen, but they are called in reverse order from panel/connector towards the encoder, which is the "wrong" order.
Add a new flag pre_enable_prev_first that any bridge can set to swap the order of pre_enable (and post_disable) for that and the immediately previous bridge.
Should the immediately previous bridge also set the pre_enable_prev_first flag, the previous bridge to that will be called before either of those which requested pre_enable_prev_first.
eg:
- 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
Would result in pre_enable's being called as Panel, Bridge 1, Bridge 3, Bridge 2, Bridge 6, Bridge 5, Bridge 4, Encoder.
Stable-dep-of: dd9e329af723 ("drm/bridge: ti-sn65dsi83: Fix enable/disable flow to meet spec")
--- drivers/gpu/drm/drm_bridge.c | 145 +++++++++++++++++++++++++++++------ include/drm/drm_bridge.h | 8 ++ 2 files changed, 129 insertions(+), 24 deletions(-)
drivers/gpu/drm/drm_bridge.c +121 -24
@@ -691,6 +691,25 @@ void drm_atomic_bridge_chain_disable(struct drm_bridge *bridge, }EXPORT_SYMBOL (drm_atomic_bridge_chain_disable); +static void drm_atomic_bridge_call_post_disable (struct drm_bridge *bridge, +struct drm_atomic_state *old_state) +{ +if (old_state && bridge->funcs->atomic_post_disable) { +struct drm_bridge_state *old_bridge_state; + + old_bridge_state = +drm_atomic_get_old_bridge_state (old_state, + bridge); +if (WARN_ON (!old_bridge_state)) +return ; + + bridge->funcs->atomic_post_disable (bridge, + old_bridge_state); + }else if (bridge->funcs->post_disable) { + bridge->funcs->post_disable (bridge); + } +} +/** * drm_atomic_bridge_chain_post_disable - cleans up after disabling all bridges * in the encoder chain
@@ -702,36 +721,86 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_disable);* starting from the first bridge to the last. These are called after completing * &drm_encoder_helper_funcs.atomic_disable * +* If a bridge sets @pre_enable_prev_first, then the @post_disable for that +* bridge will be called before the previous one to reverse the @pre_enable +* calling direction. +* * Note: the bridge passed should be the one closest to the encoder */ void drm_atomic_bridge_chain_post_disable (struct drm_bridge *bridge,struct drm_atomic_state *old_state) {struct drm_encoder *encoder; +struct drm_bridge *next, *limit;if (!bridge)return ; encoder = bridge->encoder; +list_for_each_entry_from (bridge, &encoder->bridge_chain, chain_node) { -if (bridge->funcs->atomic_post_disable) { -struct drm_bridge_state *old_bridge_state; + limit =NULL ; + +if (!list_is_last (&bridge->chain_node, &encoder->bridge_chain)) { + next =list_next_entry (bridge, chain_node); + +if (next->pre_enable_prev_first) { +/* next bridge had requested that prev +* was enabled first, so disabled last +*/ + limit = next; + +/* Find the next bridge that has NOT requested +* prev to be enabled first / disabled last +*/ +list_for_each_entry_from (next, &encoder->bridge_chain, + chain_node) { +if (next->pre_enable_prev_first) { + next =list_prev_entry (next, chain_node); + limit = next; +break ; + } + } + +/* Call these bridges in reverse order */ +list_for_each_entry_from_reverse (next, &encoder->bridge_chain, + chain_node) { +if (next == bridge) +break ; + +drm_atomic_bridge_call_post_disable (next, + old_state); + } + } + } - old_bridge_state = -drm_atomic_get_old_bridge_state (old_state, - bridge); -if (WARN_ON (!old_bridge_state)) -return ; +drm_atomic_bridge_call_post_disable (bridge, old_state); - bridge->funcs->atomic_post_disable (bridge, - old_bridge_state); - }else if (bridge->funcs->post_disable) { - bridge->funcs->post_disable (bridge); - } +if (limit) +/* Jump all bridges that we have already post_disabled */ + bridge = limit; } }EXPORT_SYMBOL (drm_atomic_bridge_chain_post_disable); +static void drm_atomic_bridge_call_pre_enable (struct drm_bridge *bridge, +struct drm_atomic_state *old_state) +{ +if (old_state && bridge->funcs->atomic_pre_enable) { +struct drm_bridge_state *old_bridge_state; + + old_bridge_state = +drm_atomic_get_old_bridge_state (old_state, + bridge); +if (WARN_ON (!old_bridge_state)) +return ; + + bridge->funcs->atomic_pre_enable (bridge, old_bridge_state); + }else if (bridge->funcs->pre_enable) { + bridge->funcs->pre_enable (bridge); + } +} +/** * drm_atomic_bridge_chain_pre_enable - prepares for enabling all bridges in * the encoder chain
@@ -743,32 +812,60 @@ EXPORT_SYMBOL(drm_atomic_bridge_chain_post_disable);* starting from the last bridge to the first. These are called before calling * &drm_encoder_helper_funcs.atomic_enable * +* If a bridge sets @pre_enable_prev_first, then the pre_enable for the +* prev bridge will be called before pre_enable of this bridge. +* * Note: the bridge passed should be the one closest to the encoder */ void drm_atomic_bridge_chain_pre_enable (struct drm_bridge *bridge,struct drm_atomic_state *old_state) {struct drm_encoder *encoder; -struct drm_bridge *iter; +struct drm_bridge *iter, *next, *limit;if (!bridge)return ; encoder = bridge->encoder; +list_for_each_entry_reverse (iter, &encoder->bridge_chain, chain_node) { -if (iter->funcs->atomic_pre_enable) { -struct drm_bridge_state *old_bridge_state; +if (iter->pre_enable_prev_first) { + next = iter; + limit = bridge; +list_for_each_entry_from_reverse (next, + &encoder->bridge_chain, + chain_node) { +if (next == bridge) +break ; + +if (!next->pre_enable_prev_first) { +/* Found first bridge that does NOT +* request prev to be enabled first +*/ + limit =list_prev_entry (next, chain_node); +break ; + } + } + +list_for_each_entry_from (next, &encoder->bridge_chain, chain_node) { +/* Call requested prev bridge pre_enable +* in order. +*/ +if (next == iter) +/* At the first bridge to request prev +* bridges called first. +*/ +break ; + +drm_atomic_bridge_call_pre_enable (next, old_state); + } + } - old_bridge_state = -drm_atomic_get_old_bridge_state (old_state, - iter); -if (WARN_ON (!old_bridge_state)) -return ; +drm_atomic_bridge_call_pre_enable (iter, old_state); - iter->funcs->atomic_pre_enable (iter, old_bridge_state); - }else if (iter->funcs->pre_enable) { - iter->funcs->pre_enable (iter); - } +if (iter->pre_enable_prev_first) +/* Jump all bridges that we have already pre_enabled */ + iter = limit;if (iter == bridge)break ;
include/drm/drm_bridge.h +8 -0
@@ -768,6 +768,14 @@ struct drm_bridge {* modes. */ bool interlace_allowed; +/** +* @pre_enable_prev_first: The bridge requires that the prev +* bridge @pre_enable function is called before its @pre_enable, +* and conversely for post_disable. This is most frequently a +* requirement for DSI devices which need the host to be initialised +* before the peripheral. +*/ +bool pre_enable_prev_first;/** * @ddc: Associated I2C adapter for DDC access, if any. */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 206/591 drm/bridge: ti-sn65dsi83: Fix enable/disable flow to meet spec
In reply to Greg Kroah-HartmanFrom: Frieder Schrempf <[email protected]>
[ Upstream commit dd9e329af7236e34c566d3705ea32a63069b9b13 ]
The datasheet describes the following initialization flow including minimum delay times between each step:
1. DSI data lanes need to be in LP-11 and the clock lane in HS mode
2. toggle EN signal
3. initialize registers
4. enable PLL
5. soft reset
6. enable DSI stream
7. check error status register
To meet this requirement we need to make sure the host bridge's pre_enable() is called first by using the pre_enable_prev_first flag.
Furthermore we need to split enable() into pre_enable() which covers steps 2-5 from above and enable() which covers step 7 and is called after the host bridge's enable().
--- drivers/gpu/drm/bridge/ti-sn65dsi83.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-)
drivers/gpu/drm/bridge/ti-sn65dsi83.c +16 -3
@@ -321,8 +321,8 @@ static u8 sn65dsi83_get_dsi_div(struct sn65dsi83 *ctx)return dsi_div -1 ; } -static void sn65dsi83_atomic_enable (struct drm_bridge *bridge, -struct drm_bridge_state *old_bridge_state) +static void sn65dsi83_atomic_pre_enable (struct drm_bridge *bridge, +struct drm_bridge_state *old_bridge_state) {struct sn65dsi83 *ctx =bridge_to_sn65dsi83 (bridge);struct drm_atomic_state *state = old_bridge_state->base.state;
@@ -485,11 +485,22 @@ static void sn65dsi83_atomic_enable(struct drm_bridge *bridge,/* Trigger reset after CSR register update. */ regmap_write (ctx->regmap,REG_RC_RESET ,REG_RC_RESET_SOFT_RESET ); +/* Wait for 10ms after soft reset as specified in datasheet */ +usleep_range (10000 ,12000 ); +} + +static void sn65dsi83_atomic_enable (struct drm_bridge *bridge, +struct drm_bridge_state *old_bridge_state) +{ +struct sn65dsi83 *ctx =bridge_to_sn65dsi83 (bridge); +unsigned int pval; +/* Clear all errors that got asserted during initialization. */ regmap_read (ctx->regmap,REG_IRQ_STAT , &pval);regmap_write (ctx->regmap,REG_IRQ_STAT , pval); -usleep_range (10000 ,12000 ); +/* Wait for 1ms and check for errors in status register */ +usleep_range (1000 ,1100 );regmap_read (ctx->regmap,REG_IRQ_STAT , &pval);if (pval)dev_err (ctx->dev,"Unexpected link status 0x%02x\n" , pval);
@@ -556,6 +567,7 @@ static const struct drm_bridge_funcs sn65dsi83_funcs = { .attach = sn65dsi83_attach, .detach = sn65dsi83_detach, .atomic_enable = sn65dsi83_atomic_enable, + .atomic_pre_enable = sn65dsi83_atomic_pre_enable, .atomic_disable = sn65dsi83_atomic_disable, .mode_valid = sn65dsi83_mode_valid,
@@ -696,6 +708,7 @@ static int sn65dsi83_probe(struct i2c_client *client, ctx->bridge.funcs = &sn65dsi83_funcs; ctx->bridge.of_node = dev->of_node; + ctx->bridge.pre_enable_prev_first = true;drm_bridge_add (&ctx->bridge); ret =sn65dsi83_host_attach (ctx);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 207/591 drm/panel: simple: fix active size for Ampire AM-480272H3TMQW-T01H
In reply to Greg Kroah-HartmanFrom: Dario Binacchi <[email protected]>
[ Upstream commit f24b49550814fdee4a98b9552e35e243ccafd4a8 ]
The previous setting was related to the overall dimension and not to the active display area.
In the "PHYSICAL SPECIFICATIONS" section, the datasheet shows the following parameters:
----------------------------------------------------------
| Item | Specifications | unit |
----------------------------------------------------------
| Display area | 98.7 (W) x 57.5 (H) | mm |
----------------------------------------------------------
| Overall dimension | 105.5(W) x 67.2(H) x 4.96(D) | mm |
----------------------------------------------------------
--- drivers/gpu/drm/panel/panel-simple.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/panel/panel-simple.c +2 -2
@@ -759,8 +759,8 @@ static const struct panel_desc ampire_am_480272h3tmqw_t01h = { .num_modes = 1, .bpc = 8, .size = { - .width = 105, - .height = 67, + .width = 99, + .height = 58, }, .bus_format = MEDIA_BUS_FMT_RGB888_1X24, };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 208/591 ARM: ep93xx: fix missing-prototype warnings
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 419013740ea1e4343d8ade535d999f59fa28e460 ]
ep93xx_clocksource_read() is only called from the file it is declared in, while ep93xx_timer_init() is declared in a header that is not included here.
arch/arm/mach-ep93xx/timer-ep93xx.c:120:13: error: no previous prototype for 'ep93xx_timer_init' arch/arm/mach-ep93xx/timer-ep93xx.c:63:5: error: no previous prototype for 'ep93xx_clocksource_read'
--- arch/arm/mach-ep93xx/timer-ep93xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/mach-ep93xx/timer-ep93xx.c +2 -1
@@ -9,6 +9,7 @@#include <linux/io.h> #include <asm/mach/time.h> #include "soc.h" +#include "platform.h" /************************************************************************* * Timer handling for EP93xx
@@ -60,7 +61,7 @@ static u64 notrace ep93xx_read_sched_clock(void)return ret; } -u64 ep93xx_clocksource_read (struct clocksource *c) +static u64 ep93xx_clocksource_read (struct clocksource *c) {u64 ret;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 209/591 ARM: omap2: fix missing tick_broadcast() prototype
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 861bc1d2886d47bd57a2cbf2cda87fdbe3eb9d08 ]
omap2 contains a hack to define tick_broadcast() on non-SMP configurations in place of the normal SMP definition. This one causes a warning because of a missing prototype:
arch/arm/mach-omap2/board-generic.c:44:6: error: no previous prototype for 'tick_broadcast'
Make sure to always include the header with the declaration.
--- arch/arm/mach-omap2/board-generic.c | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap2/board-generic.c +1 -0
@@ -13,6 +13,7 @@#include <linux/of_platform.h> #include <linux/irqdomain.h> #include <linux/clocksource.h> +#include <linux/clockchips.h> #include <asm/setup.h> #include <asm/mach/arch.h>
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 210/591 arm64: dts: qcom: pm7250b: add missing spmi-vadc include
In reply to Greg Kroah-HartmanFrom: Luca Weiss <[email protected]>
[ Upstream commit 83022f6484b11a60dbf9a95a88c7ef8e59c4b19c ]
This file is using definitions from the spmi-vadc header, so we need to include it.
--- arch/arm64/boot/dts/qcom/pm7250b.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/pm7250b.dtsi +1 -0
@@ -3,6 +3,7 @@ * Copyright (C) 2022 Luca Weiss <[email protected]> */ +#include <dt-bindings/iio/qcom,spmi-vadc.h> #include <dt-bindings/interrupt-controller/irq.h> #include <dt-bindings/spmi/spmi.h>
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 211/591 arm64: dts: qcom: apq8096: fix fixed regulator name property
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit c77612a07d18d4425fd8ddd532a8a9b8e1970c53 ]
Correct the typo in 'regulator-name' property.
apq8096-ifc6640.dtb: v1p05-regulator: 'regulator-name' is a required property apq8096-ifc6640.dtb: v1p05-regulator: Unevaluated properties are not allowed ('reglator-name' was unexpected)
--- arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/qcom/apq8096-ifc6640.dts +2 -2
@@ -26,7 +26,7 @@ chosen { v1p05: v1p05-regulator { compatible = "regulator-fixed"; - reglator-name = "v1p05"; + regulator-name = "v1p05"; regulator-always-on; regulator-boot-on;
@@ -38,7 +38,7 @@ v1p05: v1p05-regulator { v12_poe: v12-poe-regulator { compatible = "regulator-fixed"; - reglator-name = "v12_poe"; + regulator-name = "v12_poe"; regulator-always-on; regulator-boot-on;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 212/591 arm64: dts: mediatek: mt8183: Add mediatek,broken-save-restore-fw to kukui
In reply to Greg Kroah-HartmanFrom: Douglas Anderson <[email protected]>
[ Upstream commit 42127f578ebde652d1373e0233356fbd351675c4 ]
Firmware shipped on mt8183 Chromebooks is affected by the GICR save/restore issue as described by the patch ("dt-bindings:
interrupt-controller: arm,gic-v3: Add quirk for Mediatek SoCs w/ broken FW"). Add the quirk property.
--- arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm64/boot/dts/mediatek/mt8183-kukui.dtsi +4 -0
@@ -297,6 +297,10 @@ dsi_out: endpoint { }; }; +&gic { + mediatek,broken-save-restore-fw; +}; + &gpu { mali-supply = <&mt6358_vgpu_reg>; sram-supply = <&mt6358_vsram_gpu_reg>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 213/591 ARM: dts: stm32: Shorten the AV96 HDMI sound card name
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit 0cf765e598712addec34d0208cc1418c151fefb2 ]
Fix the following error in kernel log due to too long sound card name:
"
asoc-audio-graph-card sound: ASoC: driver name too long 'STM32MP1-AV96-HDMI' -> 'STM32MP1-AV96-H' "
--- arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/stm32mp15xx-dhcor-avenger96.dtsi +1 -1
@@ -88,7 +88,7 @@ sd_switch: regulator-sd_switch { sound { compatible = "audio-graph-card"; - label = "STM32MP1-AV96-HDMI"; + label = "STM32-AV96-HDMI"; dais = <&sai2a_port>; status = "okay"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 214/591 memory: brcmstb_dpfe: fix testing array offset after use
In reply to Greg Kroah-HartmanFrom: Krzysztof Kozlowski <[email protected]>
[ Upstream commit 1d9e93fad549bc38f593147479ee063f2872c170 ]
Code should first check for valid value of array offset, then use it as the index. Fixes smatch warning:
drivers/memory/brcmstb_dpfe.c:443 __send_command() error: testing array offset 'cmd' after use.
--- drivers/memory/brcmstb_dpfe.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/memory/brcmstb_dpfe.c +3 -1
@@ -434,15 +434,17 @@ static void __finalize_command(struct brcmstb_dpfe_priv *priv)static int __send_command (struct brcmstb_dpfe_priv *priv,unsigned int cmd,u32 result[]) { -const u32 *msg = priv->dpfe_api->command[cmd];void __iomem *regs = priv->regs;unsigned int i, chksum, chksum_idx; +const u32 *msg;int ret =0 ;u32 resp;if (cmd >=DPFE_CMD_MAX )return -1 ; + msg = priv->dpfe_api->command[cmd]; +mutex_lock (&priv->lock);/* Wait for DCPU to become ready */
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 215/591 ARM: dts: qcom: apq8074-dragonboard: Set DMA as remotely controlled
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit e60c230588d88036f974cec7e93361e2c4f62226 ]
Add the qcom,controlled-remotely property for the blsp2_bam controller node. This board requires this, otherwise the board stalls during the boot for some reason (most probably because TZ mishandles the protection error and keeps on looping somewhere inside).
--- arch/arm/boot/dts/qcom-apq8074-dragonboard.dts | 4 ++++ 1 file changed, 4 insertions(+)
arch/arm/boot/dts/qcom-apq8074-dragonboard.dts +4 -0
@@ -23,6 +23,10 @@ &blsp1_uart2 { status = "okay"; }; +&blsp2_dma { + qcom,controlled-remotely; +}; + &blsp2_i2c5 { status = "okay"; clock-frequency = <200000>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 216/591 ASoC: es8316: Increment max value for ALC Capture Target Volume control
In reply to Greg Kroah-HartmanFrom: Cristian Ciocaltea <[email protected]>
[ Upstream commit 6f073429037cd79d7311cd8236311c53f5ea8f01 ]
The following error occurs when trying to restore a previously saved ALSA mixer state (tested on a Rock 5B board):
$ alsactl --no-ucm -f /tmp/asound.state store hw:Analog $ alsactl --no-ucm -I -f /tmp/asound.state restore hw:Analog alsactl: set_control:1475: Cannot write control '2:0:0:ALC Capture Target Volume:0' : Invalid argument
According to ES8316 datasheet, the register at address 0x2B, which is related to the above mixer control, contains by default the value 0xB0. Considering the corresponding ALC target bits (ALCLVL) are 7:4, the control is initialized with 11, which is one step above the maximum value allowed by the driver:
ALCLVL | dB gain
-------+--------
0000 | -16.5 0001 | -15.0 0010 | -13.5 .... | ..... 0111 | -6.0 1000 | -4.5 1001 | -3.0 1010 | -1.5 .... | ..... 1111 | -1.5
The tests performed using the VU meter feature (--vumeter=TYPE) of arecord/aplay confirm the specs are correct and there is no measured gain if the 1011-1111 range would have been mapped to 0 dB:
dB gain | VU meter %
--------+-----------
-6.0 | 30-31
-4.5 | 35-36
-3.0 | 42-43
-1.5 | 50-51
0.0 | 50-51Increment the max value allowed for ALC Capture Target Volume control, so that it matches the hardware default. Additionally, update the related TLV to prevent an artificial extension of the dB gain range.
--- sound/soc/codecs/es8316.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
sound/soc/codecs/es8316.c +7 -2
@@ -52,7 +52,12 @@ static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(dac_vol_tlv, -9600, 50, 1); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(adc_vol_tlv, -9600, 50, 1); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_max_gain_tlv, -650, 150, 0); static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_min_gain_tlv, -1200, 150, 0); -static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(alc_target_tlv, -1650, 150, 0); + +static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(alc_target_tlv, +0 ,10 ,TLV_DB_SCALE_ITEM (-1650 ,150 ,0 ), + 11, 11, TLV_DB_SCALE_ITEM(-150, 0, 0), +); + static const SNDRV_CTL_TLVD_DECLARE_DB_RANGE(hpmixer_gain_tlv,0 ,4 ,TLV_DB_SCALE_ITEM (-1200 ,150 ,0 ), 8, 11, TLV_DB_SCALE_ITEM(-450, 150, 0),
@@ -115,7 +120,7 @@ static const struct snd_kcontrol_new es8316_snd_controls[] = { alc_max_gain_tlv),SOC_SINGLE_TLV ("ALC Capture Min Volume" ,ES8316_ADC_ALC2 ,0 ,28 ,0 , alc_min_gain_tlv), -SOC_SINGLE_TLV ("ALC Capture Target Volume" ,ES8316_ADC_ALC3 ,4 ,10 ,0 , +SOC_SINGLE_TLV ("ALC Capture Target Volume" ,ES8316_ADC_ALC3 ,4 ,11 ,0 , alc_target_tlv),SOC_SINGLE ("ALC Capture Hold Time" ,ES8316_ADC_ALC3 ,0 ,10 ,0 ), SOC_SINGLE("ALC Capture Decay Time", ES8316_ADC_ALC4, 4, 10, 0),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 217/591 ASoC: es8316: Do not set rate constraints for unsupported MCLKs
In reply to Greg Kroah-HartmanFrom: Cristian Ciocaltea <[email protected]>
[ Upstream commit 60413129ee2b38a80347489270af7f6e1c1de4d0 ]
When using the codec through the generic audio graph card, there are at least two calls of es8316_set_dai_sysclk(), with the effect of limiting the allowed sample rates according to the MCLK/LRCK ratios supported by the codec:
1. During audio card setup, to set the initial MCLK - see asoc_simple_init_dai().
2. Before opening a stream, to update MCLK, according to the stream sample rate and the multiplication factor - see asoc_simple_hw_params().
In some cases the initial MCLK might be set to a frequency that doesn't match any of the supported ratios, e.g. 12287999 instead of 12288000, which is only 1 Hz below the supported clock, as that is what the hardware reports. This creates an empty list of rate constraints, which is further passed to snd_pcm_hw_constraint_list() via es8316_pcm_startup(), and causes the following error on the very first access of the sound card:
$ speaker-test -D hw:Analog,0 -F S16_LE -c 2 -t wav Broken configuration for playback: no configurations available: Invalid argument Setting of hwparams failed: Invalid argument
Note that all subsequent retries succeed thanks to the updated MCLK set at point 2 above, which uses a computed frequency value instead of a reading from the hardware registers. Normally this would have mitigated the issue, but es8316_pcm_startup() executes before the 2nd call to es8316_set_dai_sysclk(), hence it cannot make use of the updated constraints.
Since es8316_pcm_hw_params() performs anyway a final validation of MCLK against the stream sample rate and the supported MCLK/LRCK ratios, fix the issue by ensuring that sysclk_constraints list is only set when at least one supported sample rate is autodetected by the codec.
--- sound/soc/codecs/es8316.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
sound/soc/codecs/es8316.c +7 -7
@@ -369,13 +369,11 @@ static int es8316_set_dai_sysclk(struct snd_soc_dai *codec_dai,int count =0 ; es8316->sysclk = freq; + es8316->sysclk_constraints.list =NULL ; + es8316->sysclk_constraints.count =0 ; -if (freq ==0 ) { - es8316->sysclk_constraints.list =NULL ; - es8316->sysclk_constraints.count =0 ; - +if (freq ==0 )return 0 ; - } ret =clk_set_rate (es8316->mclk, freq);if (ret)
@@ -391,8 +389,10 @@ static int es8316_set_dai_sysclk(struct snd_soc_dai *codec_dai, es8316->allowed_rates[count++] = freq / ratio; } - es8316->sysclk_constraints.list = es8316->allowed_rates; - es8316->sysclk_constraints.count = count; +if (count) { + es8316->sysclk_constraints.list = es8316->allowed_rates; + es8316->sysclk_constraints.count = count; + }return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 218/591 ARM: dts: meson8: correct uart_B and uart_C clock references
In reply to Greg Kroah-HartmanFrom: Martin Blumenstingl <[email protected]>
[ Upstream commit 98b503c7fb13a17a47d8ebf15fa8f7c10118e75c ]
On Meson8 uart_B and uart_C do not work, because they are relying on incorrect clocks. Change the references of pclk to the correct CLKID (UART1 for uart_B and UART2 for uart_C), to allow use of the two uarts.
This was originally reported by Hans-Frieder Vogt for Meson8b [0], but the same bug is also present in meson8.dtsi
--- arch/arm/boot/dts/meson8.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/meson8.dtsi +2 -2
@@ -749,13 +749,13 @@ &uart_A { &uart_B { compatible = "amlogic,meson8-uart"; - clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>; + clocks = <&xtal>, <&clkc CLKID_UART1>, <&clkc CLKID_CLK81>; clock-names = "xtal", "pclk", "baud"; }; &uart_C { compatible = "amlogic,meson8-uart"; - clocks = <&xtal>, <&clkc CLKID_UART0>, <&clkc CLKID_CLK81>; + clocks = <&xtal>, <&clkc CLKID_UART2>, <&clkc CLKID_CLK81>; clock-names = "xtal", "pclk", "baud"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 219/591 soc/fsl/qe: fix usb.c build errors
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit 7b1a78babd0d2cd27aa07255dee0c2d7ac0f31e3 ]
Fix build errors in soc/fsl/qe/usb.c when QUICC_ENGINE is not set. This happens when PPC_EP88XC is set, which selects CPM1 & CPM. When CPM is set, USB_FSL_QE can be set without QUICC_ENGINE being set. When USB_FSL_QE is set, QE_USB deafults to y, which causes build errors when QUICC_ENGINE is not set. Making QE_USB depend on QUICC_ENGINE prevents QE_USB from defaulting to y.
Fixes these build errors:
drivers/soc/fsl/qe/usb.o: in function `qe_usb_clock_set':
usb.c:(.text+0x1e): undefined reference to `qe_immr'
powerpc-linux-ld: usb.c:(.text+0x2a): undefined reference to `qe_immr'
powerpc-linux-ld: usb.c:(.text+0xbc): undefined reference to `qe_setbrg'
powerpc-linux-ld: usb.c:(.text+0xca): undefined reference to `cmxgcr_lock'
powerpc-linux-ld: usb.c:(.text+0xce): undefined reference to `cmxgcr_lock'
--- drivers/soc/fsl/qe/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/soc/fsl/qe/Kconfig +1 -0
@@ -39,6 +39,7 @@ config QE_TDM config QE_USB bool + depends on QUICC_ENGINE default y if USB_FSL_QE help QE USB Controller support
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 220/591 RDMA/irdma: avoid fortify-string warning in irdma_clr_wqes
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit b002760f877c0d91ecd3c78565b52f4bbac379dd ]
Commit df8fc4e934c1 ("kbuild: Enable -fstrict-flex-arrays=3") triggers a warning for fortified memset():
In function 'fortify_memset_chk',
inlined from 'irdma_clr_wqes' at drivers/infiniband/hw/irdma/uk.c:103:4:include/linux/fortify-string.h:493:25: error: call to '__write_overflow_field' declared with attribute warning: detected write beyond size of field (1st parameter); maybe use struct_group()? [-Werror=attribute-warning]
493 | __write_overflow_field(p_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~The problem here isthat the inner array only has four 8-byte elements, so clearing 4096 bytes overflows that. As this structure is part of an outer array, change the code to pass a pointer to the irdma_qp_quanta instead, and change the size argument for readability, matching the comment above it.
--- drivers/infiniband/hw/irdma/uk.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/infiniband/hw/irdma/uk.c +6 -4
@@ -93,16 +93,18 @@ static int irdma_nop_1(struct irdma_qp_uk *qp)*/ void irdma_clr_wqes (struct irdma_qp_uk *qp,u32 qp_wqe_idx) { -__le64 *wqe; +struct irdma_qp_quanta *sq;u32 wqe_idx;if (!(qp_wqe_idx &0x7F )) { wqe_idx = (qp_wqe_idx +128 ) % qp->sq_ring.size; - wqe = qp->sq_base[wqe_idx].elem; + sq = qp->sq_base + wqe_idx;if (wqe_idx) -memset (wqe, qp->swqe_polarity ?0 :0xFF ,0x1000 ); +memset (sq, qp->swqe_polarity ?0 :0xFF , +128 *sizeof (*sq));else -memset (wqe, qp->swqe_polarity ?0xFF :0 ,0x1000 ); +memset (sq, qp->swqe_polarity ?0xFF :0 , +128 *sizeof (*sq)); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 221/591 IB/hfi1: Fix wrong mmu_node used for user SDMA packet after invalidate
In reply to Greg Kroah-HartmanFrom: Brendan Cunningham <[email protected]>
[ Upstream commit c9358de193ecfb360c3ce75f27ce839ca0b0bc8c ]
The hfi1 user SDMA pinned-page cache will leave a stale cache entry when the cache-entry's virtual address range is invalidated but that cache entry is in-use by an outstanding SDMA request.
Subsequent user SDMA requests with buffers in or spanning the virtual address range of the stale cache entry will result in packets constructed from the wrong memory, the physical pages pointed to by the stale cache entry.
To fix this, remove mmu_rb_node cache entries from the mmu_rb_handler cache independent of the cache entry's refcount. Add 'struct kref refcount' to struct mmu_rb_node and manage mmu_rb_node lifetime with kref_get() and kref_put().
mmu_rb_node.refcount makes sdma_mmu_node.refcount redundant. Remove 'atomic_t refcount' from struct sdma_mmu_node and change sdma_mmu_node code to use mmu_rb_node.refcount.
Move the mmu_rb_handler destructor call after a wait-for-SDMA-request-completion call so mmu_rb_nodes that need mmu_rb_handler's workqueue to queue themselves up for destruction from an interrupt context may do so.
--- drivers/infiniband/hw/hfi1/ipoib_tx.c | 4 +- drivers/infiniband/hw/hfi1/mmu_rb.c | 101 ++++++++++------- drivers/infiniband/hw/hfi1/mmu_rb.h | 3 + drivers/infiniband/hw/hfi1/sdma.c | 23 +++- drivers/infiniband/hw/hfi1/sdma.h | 47 +++++--- drivers/infiniband/hw/hfi1/sdma_txreq.h | 2 + drivers/infiniband/hw/hfi1/user_sdma.c | 137 ++++++++++-------------- drivers/infiniband/hw/hfi1/user_sdma.h | 1 - drivers/infiniband/hw/hfi1/vnic_sdma.c | 4 +- 9 files changed, 177 insertions(+), 145 deletions(-)
drivers/infiniband/hw/hfi1/ipoib_tx.c +2 -2
@@ -215,11 +215,11 @@ static int hfi1_ipoib_build_ulp_payload(struct ipoib_txreq *tx,const skb_frag_t *frag = &skb_shinfo (skb)->frags[i]; ret =sdma_txadd_page (dd, -NULL , txreq,skb_frag_page (frag), frag->bv_offset, -skb_frag_size (frag)); +skb_frag_size (frag), +NULL ,NULL ,NULL );if (unlikely (ret))break ; }
drivers/infiniband/hw/hfi1/mmu_rb.c +63 -38
165 lines not on this page · raw message
drivers/infiniband/hw/hfi1/mmu_rb.h +3 -0
@@ -16,6 +16,7 @@ struct mmu_rb_node {struct rb_node node;struct mmu_rb_handler *handler;struct list_head list; +struct kref refcount; };/*
@@ -51,6 +52,8 @@ int hfi1_mmu_rb_register(void *ops_arg,void hfi1_mmu_rb_unregister (struct mmu_rb_handler *handler);int hfi1_mmu_rb_insert (struct mmu_rb_handler *handler,struct mmu_rb_node *mnode); +void hfi1_mmu_rb_release (struct kref *refcount); +void hfi1_mmu_rb_evict (struct mmu_rb_handler *handler,void *evict_arg); struct mmu_rb_node *hfi1_mmu_rb_get_first(struct mmu_rb_handler *handler, unsigned long addr,
drivers/infiniband/hw/hfi1/sdma.c +18 -5
@@ -1593,7 +1593,20 @@ static inline void sdma_unmap_desc(struct hfi1_devdata *dd, struct sdma_desc *descp) { -system_descriptor_complete (dd ,descp ); + switch (sdma_mapping_type(descp)) { + case SDMA_MAP_SINGLE: + dma_unmap_single(&dd->pcidev->dev, sdma_mapping_addr(descp), +sdma_mapping_len (descp ),DMA_TO_DEVICE ); +break ; +case SDMA_MAP_PAGE : +dma_unmap_page (&dd->pcidev->dev,sdma_mapping_addr (descp), +sdma_mapping_len (descp),DMA_TO_DEVICE ); +break ; + } + +if (descp->pinning_ctx && descp->ctx_put) + descp->ctx_put (descp->pinning_ctx); + descp->pinning_ctx =NULL ; }/*
@@ -3113,8 +3126,8 @@ int ext_coal_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx,/* Add descriptor for coalesce buffer */ tx->desc_limit =MAX_DESC ; -return _sdma_txadd_daddr (dd,SDMA_MAP_SINGLE ,NULL , tx, - addr, tx->tlen); +return _sdma_txadd_daddr (dd,SDMA_MAP_SINGLE , tx, + addr, tx->tlen,NULL ,NULL ,NULL ); }return 1 ;
@@ -3157,9 +3170,9 @@ int _pad_sdma_tx_descs(struct hfi1_devdata *dd, struct sdma_txreq *tx)make_tx_sdma_desc ( tx,SDMA_MAP_NONE , -NULL , dd->sdma_pad_phys, -sizeof (u32) - (tx->packet_len & (sizeof (u32) -1 ))); +sizeof (u32) - (tx->packet_len & (sizeof (u32) -1 )), +NULL ,NULL ,NULL ); tx->num_desc++;_sdma_close_tx (dd, tx);return rval;
drivers/infiniband/hw/hfi1/sdma.h +32 -15
116 lines not on this page · raw message
drivers/infiniband/hw/hfi1/sdma_txreq.h +2 -0
@@ -20,6 +20,8 @@ struct sdma_desc {/* private: don't use directly */ u64 qw[2 ];void *pinning_ctx; +/* Release reference to @pinning_ctx. May be called in interrupt context. Must not sleep. */ +void (*ctx_put)(void *ctx); };/**
drivers/infiniband/hw/hfi1/user_sdma.c +55 -82
253 lines not on this page · raw message
drivers/infiniband/hw/hfi1/user_sdma.h +0 -1
@@ -104,7 +104,6 @@ struct hfi1_user_sdma_comp_q {struct sdma_mmu_node {struct mmu_rb_node rb;struct hfi1_user_sdma_pkt_q *pq; -atomic_t refcount;struct page **pages;unsigned int npages; };
drivers/infiniband/hw/hfi1/vnic_sdma.c +2 -2
@@ -64,11 +64,11 @@ static noinline int build_vnic_ulp_payload(struct sdma_engine *sde,/* combine physically continuous fragments later? */ ret =sdma_txadd_page (sde->dd, -NULL , &tx->txreq,skb_frag_page (frag),skb_frag_off (frag), -skb_frag_size (frag)); +skb_frag_size (frag), +NULL ,NULL ,NULL );if (unlikely (ret)) goto bail_txadd; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 222/591 RDMA/hns: Fix hns_roce_table_get return value
In reply to Greg Kroah-HartmanFrom: Chengchang Tang <[email protected]>
[ Upstream commit cf5b608fb0e369c473a8303cad6ddb386505e5b8 ]
The return value of set_hem has been fixed to ENODEV, which will lead a diagnostic information missing.
--- drivers/infiniband/hw/hns/hns_roce_hem.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hem.c +4 -3
@@ -595,11 +595,12 @@ int hns_roce_table_get(struct hns_roce_dev *hr_dev, }/* Set HEM base address(128K/page, pa) to Hardware */ -if (hr_dev->hw->set_hem (hr_dev, table, obj,HEM_HOP_STEP_DIRECT )) { + ret = hr_dev->hw->set_hem (hr_dev, table, obj,HEM_HOP_STEP_DIRECT ); +if (ret) {hns_roce_free_hem (hr_dev, table->hem[i]); table->hem[i] =NULL ; - ret = -ENODEV ; -dev_err (dev,"set HEM base address to HW failed.\n" ); +dev_err (dev,"set HEM base address to HW failed, ret = %d.\n" , + ret); goto out; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 223/591 ARM: dts: iwg20d-q7-common: Fix backlight pwm specifier
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 0501fdec106a291c43b3c1b525cf22ab4c24b2d8 ]
make dtbs_check:
arch/arm/boot/dts/renesas/r8a7743-iwg20d-q7.dtb: backlight: pwms: [[58, 0, 5000000], [0]] is too long
From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
arch/arm/boot/dts/renesas/r8a7743-iwg20d-q7-dbcm-ca.dtb: backlight: pwms: [[67, 0, 5000000], [0]] is too long
From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
arch/arm/boot/dts/renesas/r8a7744-iwg20d-q7-dbcm-ca.dtb: backlight: pwms: [[67, 0, 5000000], [0]] is too long
From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
arch/arm/boot/dts/renesas/r8a7744-iwg20d-q7.dtb: backlight: pwms: [[58, 0, 5000000], [0]] is too long
From schema: Documentation/devicetree/bindings/leds/backlight/pwm-backlight.yaml
PWM specifiers referring to R-Car PWM Timer Controllers should contain only two cells.
Fix this by dropping the bogus third cell.
--- arch/arm/boot/dts/iwg20d-q7-common.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/iwg20d-q7-common.dtsi +1 -1
@@ -49,7 +49,7 @@ audio_clock: audio_clock { lcd_backlight: backlight { compatible = "pwm-backlight"; - pwms = <&pwm3 0 5000000 0>; + pwms = <&pwm3 0 5000000>; brightness-levels = <0 4 8 16 32 64 128 255>; default-brightness-level = <7>; enable-gpios = <&gpio5 14 GPIO_ACTIVE_HIGH>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 224/591 arm64: dts: renesas: ulcb-kf: Remove flow control for SCIF1
In reply to Greg Kroah-HartmanFrom: Wolfram Sang <[email protected]>
[ Upstream commit 1a2c4e5635177939a088d22fa35c6a7032725663 ]
The schematics are misleading, the flow control is for HSCIF1. We need SCIF1 for GNSS/GPS which does not use flow control.
--- arch/arm64/boot/dts/renesas/ulcb-kf.dtsi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/boot/dts/renesas/ulcb-kf.dtsi +1 -2
@@ -393,7 +393,7 @@ hscif0_pins: hscif0 { }; scif1_pins: scif1 { - groups = "scif1_data_b", "scif1_ctrl"; + groups = "scif1_data_b"; function = "scif1"; };
@@ -447,7 +447,6 @@ rsnd_for_pcm3168a_capture: endpoint { &scif1 { pinctrl-0 = <&scif1_pins>; pinctrl-names = "default"; - uart-has-rtscts; status = "okay"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 225/591 drm/msm/dpu: set DSC flush bit correctly at MDP CTL flush register
In reply to Greg Kroah-HartmanFrom: Kuogee Hsieh <[email protected]>
[ Upstream commit 12cef323c903bd8b13d1f6ff24a9695c2cdc360b ]
The CTL_FLUSH register should be programmed with the 22th bit (DSC_IDX) to flush the DSC hardware blocks, not the literal value of 22 (which corresponds to flushing VIG1, VIG2 and RGB1 instead).
Changes in V12:
-- split this patch out of "separate DSC flush update out of interface"
Changes in V13:
-- rewording the commit text
Changes in V14:
-- drop 'DSC" from "The DSC CTL_FLUSH register" at commit text
Patchwork: https://patchwork.freedesktop.org/patch/539496/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c +1 -1
@@ -550,7 +550,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,DPU_REG_WRITE (c,CTL_MERGE_3D_ACTIVE ,BIT (cfg->merge_3d -MERGE_3D_0 ));if (cfg->dsc) { -DPU_REG_WRITE (&ctx->hw,CTL_FLUSH ,DSC_IDX ); +DPU_REG_WRITE (&ctx->hw,CTL_FLUSH ,BIT (DSC_IDX ));DPU_REG_WRITE (c,CTL_DSC_ACTIVE , cfg->dsc); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 226/591 fbdev: omapfb: lcd_mipid: Fix an error handling path in mipid_spi_probe()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 79a3908d1ea6c35157a6d907b1a9d8ec06015e7a ]
If 'mipid_detect()' fails, we must free 'md' to avoid a memory leak.
--- drivers/video/fbdev/omap/lcd_mipid.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/video/fbdev/omap/lcd_mipid.c +5 -1
@@ -563,11 +563,15 @@ static int mipid_spi_probe(struct spi_device *spi) r =mipid_detect (md);if (r <0 ) -return r; + goto free_md;omapfb_register_panel (&md->panel);return 0 ; + +free_md: +kfree (md); +return r; }static void mipid_spi_remove (struct spi_device *spi)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 227/591 arm64: dts: ti: k3-j7200: Fix physical address of pin
In reply to Greg Kroah-HartmanFrom: Keerthy <[email protected]>
[ Upstream commit 3d011933000ed9054c649952d83162d24f020a93 ]
wkup_pmx splits into multiple regions. Like
wkup_pmx0 -> 13 pins (WKUP_PADCONFIG 0 - 12)
wkup_pmx1 -> 2 pins (WKUP_PADCONFIG 14 - 15)
wkup_pmx2 -> 59 pins (WKUP_PADCONFIG 26 - 84)
wkup_pmx3 -> 8 pins (WKUP_PADCONFIG 93 - 100)With this split, pin offset needs to be adjusted to match with new pmx for all pins above wkup_pmx0.
Example a pin under wkup_pmx1 should start from 0 instead of old offset(0x38 WKUP_PADCONFIG 14 offset)
J7200 Datasheet (Table 6-106, Section 6.4 Pin Multiplexing) :
https://www.ti.com/lit/ds/symlink/dra821u.pdf
--- .../dts/ti/k3-j7200-common-proc-board.dts | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-)
arch/arm64/boot/dts/ti/k3-j7200-common-proc-board.dts +14 -14
@@ -83,25 +83,25 @@ vdd_sd_dv: gpio-regulator-TLV71033 { &wkup_pmx2 { mcu_cpsw_pins_default: mcu-cpsw-pins-default { pinctrl-single,pins = < - J721E_WKUP_IOPAD(0x0068, PIN_OUTPUT, 0) /* MCU_RGMII1_TX_CTL */ - J721E_WKUP_IOPAD(0x006c, PIN_INPUT, 0) /* MCU_RGMII1_RX_CTL */ - J721E_WKUP_IOPAD(0x0070, PIN_OUTPUT, 0) /* MCU_RGMII1_TD3 */ - J721E_WKUP_IOPAD(0x0074, PIN_OUTPUT, 0) /* MCU_RGMII1_TD2 */ - J721E_WKUP_IOPAD(0x0078, PIN_OUTPUT, 0) /* MCU_RGMII1_TD1 */ - J721E_WKUP_IOPAD(0x007c, PIN_OUTPUT, 0) /* MCU_RGMII1_TD0 */ - J721E_WKUP_IOPAD(0x0088, PIN_INPUT, 0) /* MCU_RGMII1_RD3 */ - J721E_WKUP_IOPAD(0x008c, PIN_INPUT, 0) /* MCU_RGMII1_RD2 */ - J721E_WKUP_IOPAD(0x0090, PIN_INPUT, 0) /* MCU_RGMII1_RD1 */ - J721E_WKUP_IOPAD(0x0094, PIN_INPUT, 0) /* MCU_RGMII1_RD0 */ - J721E_WKUP_IOPAD(0x0080, PIN_OUTPUT, 0) /* MCU_RGMII1_TXC */ - J721E_WKUP_IOPAD(0x0084, PIN_INPUT, 0) /* MCU_RGMII1_RXC */ + J721E_WKUP_IOPAD(0x0000, PIN_OUTPUT, 0) /* MCU_RGMII1_TX_CTL */ + J721E_WKUP_IOPAD(0x0004, PIN_INPUT, 0) /* MCU_RGMII1_RX_CTL */ + J721E_WKUP_IOPAD(0x0008, PIN_OUTPUT, 0) /* MCU_RGMII1_TD3 */ + J721E_WKUP_IOPAD(0x000c, PIN_OUTPUT, 0) /* MCU_RGMII1_TD2 */ + J721E_WKUP_IOPAD(0x0010, PIN_OUTPUT, 0) /* MCU_RGMII1_TD1 */ + J721E_WKUP_IOPAD(0x0014, PIN_OUTPUT, 0) /* MCU_RGMII1_TD0 */ + J721E_WKUP_IOPAD(0x0020, PIN_INPUT, 0) /* MCU_RGMII1_RD3 */ + J721E_WKUP_IOPAD(0x0024, PIN_INPUT, 0) /* MCU_RGMII1_RD2 */ + J721E_WKUP_IOPAD(0x0028, PIN_INPUT, 0) /* MCU_RGMII1_RD1 */ + J721E_WKUP_IOPAD(0x002c, PIN_INPUT, 0) /* MCU_RGMII1_RD0 */ + J721E_WKUP_IOPAD(0x0018, PIN_OUTPUT, 0) /* MCU_RGMII1_TXC */ + J721E_WKUP_IOPAD(0x001c, PIN_INPUT, 0) /* MCU_RGMII1_RXC */ >; }; mcu_mdio_pins_default: mcu-mdio1-pins-default { pinctrl-single,pins = < - J721E_WKUP_IOPAD(0x009c, PIN_OUTPUT, 0) /* (L1) MCU_MDIO0_MDC */ - J721E_WKUP_IOPAD(0x0098, PIN_INPUT, 0) /* (L4) MCU_MDIO0_MDIO */ + J721E_WKUP_IOPAD(0x0034, PIN_OUTPUT, 0) /* (L1) MCU_MDIO0_MDC */ + J721E_WKUP_IOPAD(0x0030, PIN_INPUT, 0) /* (L4) MCU_MDIO0_MDIO */ >; }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 228/591 Input: pm8941-powerkey - fix debounce on gen2+ PMICs
In reply to Greg Kroah-HartmanFrom: Caleb Connolly <[email protected]>
[ Upstream commit 8c9cce9cb81b5fdc6e66bf3f129727b89e8daab7 ]
Since PM8998/PM660, the power key debounce register was redefined to support shorter debounce times. On PM8941 the shortest debounce time (represented by register value 0) was 15625us, on PM8998 the shortest debounce time is 62us, with the default being 2ms.
Adjust the bit shift to correctly program debounce on PM8998 and newer.
--- drivers/input/misc/pm8941-pwrkey.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-)
drivers/input/misc/pm8941-pwrkey.c +15 -4
@@ -50,7 +50,10 @@#define PON_RESIN_PULL_UP BIT(0)#define PON_DBC_CTL 0x71 -#define PON_DBC_DELAY_MASK 0x7 +#define PON_DBC_DELAY_MASK_GEN1 0x7 +#define PON_DBC_DELAY_MASK_GEN2 0xf +#define PON_DBC_SHIFT_GEN1 6 +#define PON_DBC_SHIFT_GEN2 14struct pm8941_data {unsigned int pull_up_bit;
@@ -247,7 +250,7 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev)struct device *parent;struct device_node *regmap_node;const __be32 *addr; -u32 req_delay; +u32 req_delay, mask, delay_shift;int error;if (of_property_read_u32 (pdev->dev.of_node,"debounce" , &req_delay))
@@ -336,12 +339,20 @@ static int pm8941_pwrkey_probe(struct platform_device *pdev) pwrkey->input->phys = pwrkey->data->phys;if (pwrkey->data->supports_debounce_config) { - req_delay = (req_delay <<6 ) /USEC_PER_SEC ; +if (pwrkey->subtype >=PON_SUBTYPE_GEN2_PRIMARY ) { + mask =PON_DBC_DELAY_MASK_GEN2 ; + delay_shift =PON_DBC_SHIFT_GEN2 ; + }else { + mask =PON_DBC_DELAY_MASK_GEN1 ; + delay_shift =PON_DBC_SHIFT_GEN1 ; + } + + req_delay = (req_delay << delay_shift) /USEC_PER_SEC ; req_delay =ilog2 (req_delay); error =regmap_update_bits (pwrkey->regmap, pwrkey->baseaddr +PON_DBC_CTL , -PON_DBC_DELAY_MASK , + mask, req_delay);if (error) { dev_err(&pdev->dev, "failed to set debounce: %d\n",
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 229/591 ARM: dts: stm32: Fix audio routing on STM32MP15xx DHCOM PDK2
In reply to Greg Kroah-HartmanFrom: Marek Vasut <[email protected]>
[ Upstream commit e3f2778b1b6ced649bffdc7cbb05b80bb92f2108 ]
The audio routing flow is not correct, the flow should be from source (second element in the pair) to sink (first element in the pair). The flow now is from "HP_OUT" to "Playback", where "Playback" is source and "HP_OUT" is sink, i.e. the direction is swapped and there is no direct link between the two either.
Fill in the correct routing, where "HP_OUT" supplies the "Headphone Jack", "Line In Jack" supplies "LINE_IN" input, "Microphone Jack" supplies "MIC_IN" input and "Mic Bias" supplies "Microphone Jack".
--- arch/arm/boot/dts/stm32mp15xx-dhcom-pdk2.dtsi | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
arch/arm/boot/dts/stm32mp15xx-dhcom-pdk2.dtsi +7 -4
@@ -137,10 +137,13 @@ reg_panel_supply: regulator-panel-supply { sound { compatible = "audio-graph-card"; - routing = - "MIC_IN", "Capture", - "Capture", "Mic Bias", - "Playback", "HP_OUT"; + widgets = "Headphone", "Headphone Jack", + "Line", "Line In Jack", + "Microphone", "Microphone Jack"; + routing = "Headphone Jack", "HP_OUT", + "LINE_IN", "Line In Jack", + "MIC_IN", "Microphone Jack", + "Microphone Jack", "Mic Bias"; dais = <&sai2a_port &sai2b_port>; status = "okay"; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 230/591 ARM: dts: stm32: fix i2s endpoint format property for stm32mp15xx-dkx
In reply to Greg Kroah-HartmanFrom: Olivier Moysan <[email protected]>
[ Upstream commit 076c74c592cabe4a47537fe5205b5b678bed010d ]
Use "dai-format" to configure DAI audio format as specified in audio-graph-port.yaml bindings.
--- arch/arm/boot/dts/stm32mp15xx-dkx.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/stm32mp15xx-dkx.dtsi +1 -1
@@ -438,7 +438,7 @@ &i2s2 { i2s2_port: port { i2s2_endpoint: endpoint { remote-endpoint = <&sii9022_tx_endpoint>; - format = "i2s"; + dai-format = "i2s"; mclk-fs = <256>; }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 231/591 hwmon: (gsc-hwmon) fix fan pwm temperature scaling
In reply to Greg Kroah-HartmanFrom: Tim Harvey <[email protected]>
[ Upstream commit a6d80df47ee2c69db99e4f2f8871aa4db154620b ]
The GSC fan pwm temperature register is in centidegrees celcius but the Linux hwmon convention is to use milidegrees celcius. Fix the scaling.
--- drivers/hwmon/gsc-hwmon.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/hwmon/gsc-hwmon.c +3 -3
@@ -82,8 +82,8 @@ static ssize_t pwm_auto_point_temp_store(struct device *dev,if (kstrtol (buf,10 , &temp))return -EINVAL ; - temp =clamp_val (temp,0 ,10000 ); - temp =DIV_ROUND_CLOSEST (temp,10 ); + temp =clamp_val (temp,0 ,100000 ); + temp =DIV_ROUND_CLOSEST (temp,100 ); regs[0 ] = temp &0xff ; regs[1 ] = (temp >>8 ) &0xff ;
@@ -100,7 +100,7 @@ static ssize_t pwm_auto_point_pwm_show(struct device *dev, {struct sensor_device_attribute *attr =to_sensor_dev_attr (devattr); -return sprintf (buf,"%d\n" ,255 * (50 + (attr->index *10 )) /100 ); +return sprintf (buf,"%d\n" ,255 * (50 + (attr->index *10 ))); } static SENSOR_DEVICE_ATTR_RO(pwm1_auto_point1_pwm, pwm_auto_point_pwm, 0);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 232/591 hwmon: (pmbus/adm1275) Fix problems with temperature monitoring on ADM1272
In reply to Greg Kroah-HartmanFrom: Guenter Roeck <[email protected]>
[ Upstream commit b153a0bb4199566abd337119207f82b59a8cd1ca ]
The PMON_CONFIG register on ADM1272 is a 16 bit register. Writing a 8 bit value into it clears the upper 8 bits of the register, resulting in unexpected side effects. Fix by writing the 16 bit register value.
Also, it has been reported that temperature readings are sometimes widely inaccurate, to the point where readings may result in device shutdown due to errant overtemperature faults. Improve by enabling temperature sampling.
While at it, move the common code for ADM1272 and ADM1278 into a separate function, and clarify in the error message that an attempt was made to enable both VOUT and temperature monitoring.
Last but not least, return the error code reported by the underlying I2C controller and not -ENODEV if updating the PMON_CONFIG register fails. After all, this does not indicate that the chip is not present, but an error in the communication with the chip.
--- drivers/hwmon/pmbus/adm1275.c | 52 +++++++++++++++++------------------ 1 file changed, 26 insertions(+), 26 deletions(-)
drivers/hwmon/pmbus/adm1275.c +26 -26
@@ -37,10 +37,13 @@ enum chips { adm1075, adm1272, adm1275, adm1276, adm1278, adm1293, adm1294 };#define ADM1272_IRANGE BIT(0) +#define ADM1278_TSFILT BIT(15)#define ADM1278_TEMP1_EN BIT(3)#define ADM1278_VIN_EN BIT(2)#define ADM1278_VOUT_EN BIT(1) +#define ADM1278_PMON_DEFCONFIG (ADM1278_VOUT_EN | ADM1278_TEMP1_EN | ADM1278_TSFILT) +#define ADM1293_IRANGE_25 0#define ADM1293_IRANGE_50 BIT(6)#define ADM1293_IRANGE_100 BIT(7)
@@ -462,6 +465,22 @@ static const struct i2c_device_id adm1275_id[] = { };MODULE_DEVICE_TABLE (i2c, adm1275_id); +/* Enable VOUT & TEMP1 if not enabled (disabled by default) */ +static int adm1275_enable_vout_temp (struct i2c_client *client,int config) +{ +int ret; + +if ((config &ADM1278_PMON_DEFCONFIG ) !=ADM1278_PMON_DEFCONFIG ) { + config |=ADM1278_PMON_DEFCONFIG ; + ret =i2c_smbus_write_word_data (client,ADM1275_PMON_CONFIG , config); +if (ret <0 ) { +dev_err (&client->dev,"Failed to enable VOUT/TEMP1 monitoring\n" ); +return ret; + } + } +return 0 ; +} +static int adm1275_probe (struct i2c_client *client) {s32 (*config_read_fn)(const struct i2c_client *client,u8 reg);
@@ -615,19 +634,10 @@ static int adm1275_probe(struct i2c_client *client)PMBUS_HAVE_VOUT |PMBUS_HAVE_STATUS_VOUT |PMBUS_HAVE_TEMP |PMBUS_HAVE_STATUS_TEMP ; -/* Enable VOUT & TEMP1 if not enabled (disabled by default) */ -if ((config & (ADM1278_VOUT_EN |ADM1278_TEMP1_EN )) != - (ADM1278_VOUT_EN |ADM1278_TEMP1_EN )) { - config |=ADM1278_VOUT_EN |ADM1278_TEMP1_EN ; - ret =i2c_smbus_write_byte_data (client, -ADM1275_PMON_CONFIG , - config); -if (ret <0 ) { -dev_err (&client->dev, -"Failed to enable VOUT monitoring\n" ); -return -ENODEV ; - } - } + ret =adm1275_enable_vout_temp (client, config); +if (ret) +return ret; +if (config &ADM1278_VIN_EN ) info->func[0 ] |=PMBUS_HAVE_VIN ;break ;
@@ -684,19 +694,9 @@ static int adm1275_probe(struct i2c_client *client)PMBUS_HAVE_VOUT |PMBUS_HAVE_STATUS_VOUT |PMBUS_HAVE_TEMP |PMBUS_HAVE_STATUS_TEMP ; -/* Enable VOUT & TEMP1 if not enabled (disabled by default) */ -if ((config & (ADM1278_VOUT_EN |ADM1278_TEMP1_EN )) != - (ADM1278_VOUT_EN |ADM1278_TEMP1_EN )) { - config |=ADM1278_VOUT_EN |ADM1278_TEMP1_EN ; - ret =i2c_smbus_write_word_data (client, -ADM1275_PMON_CONFIG , - config); -if (ret <0 ) { -dev_err (&client->dev, -"Failed to enable VOUT monitoring\n" ); -return -ENODEV ; - } - } + ret =adm1275_enable_vout_temp (client, config); +if (ret) +return ret;if (config &ADM1278_VIN_EN ) info->func[0 ] |=PMBUS_HAVE_VIN ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 233/591 ARM: dts: BCM5301X: fix duplex-full => full-duplex
In reply to Greg Kroah-HartmanFrom: Christian Lamparter <[email protected]>
[ Upstream commit fd274b733bfdde3ca72f0fa2a37f032f3a8c402c ]
this typo was found by the dtbs_check
| ports:port@5:fixed-link: 'oneOf' conditional failed,
| {'speed': [[1000]], 'duplex-full': True} is not of type 'array'
| 'duplex-full' does not match any of the regexes: 'pinctrl-[0-]..."this should have been full-duplex;
--- arch/arm/boot/dts/bcm53015-meraki-mr26.dts | 2 +- arch/arm/boot/dts/bcm53016-meraki-mr32.dts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/bcm53015-meraki-mr26.dts +1 -1
@@ -128,7 +128,7 @@ port@5 { fixed-link { speed = <1000>; - duplex-full; + full-duplex; }; }; };
arch/arm/boot/dts/bcm53016-meraki-mr32.dts +1 -1
@@ -187,7 +187,7 @@ port@5 { fixed-link { speed = <1000>; - duplex-full; + full-duplex; }; }; };
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 234/591 clk: Export clk_hw_forward_rate_request()
In reply to Greg Kroah-HartmanFrom: Maxime Ripard <[email protected]>
[ Upstream commit ed046ac74da0b5602566073023a1519b5ae657b7 ]
Commit 262ca38f4b6e ("clk: Stop forwarding clk_rate_requests to the parent") introduced the public clk_hw_forward_rate_request() function, but didn't export the symbol. Make sure it's the case.
--- drivers/clk/clk.c | 1 + 1 file changed, 1 insertion(+)
drivers/clk/clk.c +1 -0
@@ -1525,6 +1525,7 @@ void clk_hw_forward_rate_request(const struct clk_hw *hw, parent->core, req, parent_rate); } +EXPORT_SYMBOL_GPL (clk_hw_forward_rate_request);static bool clk_core_can_round (struct clk_core *const core) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 235/591 MIPS: DTS: CI20: Fix ACT8600 regulator node names
In reply to Greg Kroah-HartmanFrom: Paul Cercueil <[email protected]>
[ Upstream commit 08384e80a70fb1942510ab5f0ce27bad134e634e ]
The Device Tree was using invalid node names for the ACT8600 regulators. To be fair, it is not the original committer's fault, as the documentation did gives invalid names as well.
In theory, the fix should have been to modify the driver to accept the alternative names. However, even though the act8865 driver spits warnings, the kernel seemed to work fine with what is currently supported upstream. For that reason, I think it is okay to just update the DTS.
I removed the "regulator-name" too, since they really didn't bring any information. The node names are enough.
--- arch/mips/boot/dts/ingenic/ci20.dts | 27 ++++++++------------------- 1 file changed, 8 insertions(+), 19 deletions(-)
arch/mips/boot/dts/ingenic/ci20.dts +8 -19
@@ -237,59 +237,49 @@ &i2c0 { act8600: act8600@5a { compatible = "active-semi,act8600"; reg = <0x5a>; - status = "okay"; regulators { - vddcore: SUDCDC1 { - regulator-name = "DCDC_REG1"; + vddcore: DCDC1 { regulator-min-microvolt = <1100000>; regulator-max-microvolt = <1100000>; regulator-always-on; }; - vddmem: SUDCDC2 { - regulator-name = "DCDC_REG2"; + vddmem: DCDC2 { regulator-min-microvolt = <1500000>; regulator-max-microvolt = <1500000>; regulator-always-on; }; - vcc_33: SUDCDC3 { - regulator-name = "DCDC_REG3"; + vcc_33: DCDC3 { regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; regulator-always-on; }; - vcc_50: SUDCDC4 { - regulator-name = "SUDCDC_REG4"; + vcc_50: SUDCDC_REG4 { regulator-min-microvolt = <5000000>; regulator-max-microvolt = <5000000>; regulator-always-on; }; - vcc_25: LDO_REG5 { - regulator-name = "LDO_REG5"; + vcc_25: LDO5 { regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-always-on; }; - wifi_io: LDO_REG6 { - regulator-name = "LDO_REG6"; + wifi_io: LDO6 { regulator-min-microvolt = <2500000>; regulator-max-microvolt = <2500000>; regulator-always-on; }; - vcc_28: LDO_REG7 { - regulator-name = "LDO_REG7"; + cim_io_28: LDO7 { regulator-min-microvolt = <2800000>; regulator-max-microvolt = <2800000>; regulator-always-on; }; - vcc_15: LDO_REG8 { - regulator-name = "LDO_REG8"; + cim_io_15: LDO8 { regulator-min-microvolt = <1500000>; regulator-max-microvolt = <1500000>; regulator-always-on; }; vrtc_18: LDO_REG9 { - regulator-name = "LDO_REG9"; /* Despite the datasheet stating 3.3V * for REG9 and the driver expecting that, * REG9 outputs 1.8V.
@@ -303,7 +293,6 @@ vrtc_18: LDO_REG9 { regulator-always-on; }; vcc_11: LDO_REG10 { - regulator-name = "LDO_REG10"; regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1200000>; regulator-always-on;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 236/591 drm/amd/display: Fix a test CalculatePrefetchSchedule()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 960e27a5741cd3001996ff6ddfb3eb0ed3a4909d ]
It is likely Height was expected here, instead of Width.
Test the correct variable.
--- drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn21/display_mode_vba_21.c +1 -1
@@ -810,7 +810,7 @@ static bool CalculatePrefetchSchedule( *swath_width_chroma_ub =dml_ceil (SwathWidthY /2 -1 , myPipe->BlockWidth256BytesC) + myPipe->BlockWidth256BytesC; }else { *swath_width_luma_ub =dml_ceil (SwathWidthY -1 , myPipe->BlockHeight256BytesY) + myPipe->BlockHeight256BytesY; -if (myPipe->BlockWidth256BytesC >0 ) +if (myPipe->BlockHeight256BytesC >0 ) *swath_width_chroma_ub =dml_ceil (SwathWidthY /2 -1 , myPipe->BlockHeight256BytesC) + myPipe->BlockHeight256BytesC; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 237/591 drm/amd/display: Fix a test dml32_rq_dlg_get_rq_reg()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit bafc31166aa7df5fa26ae0ad8196d1717e6cdea9 ]
It is likely p1_min_meta_chunk_bytes was expected here, instead of min_meta_chunk_bytes.
Test the correct variable.
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c +1 -1
@@ -116,7 +116,7 @@ void dml32_rq_dlg_get_rq_reg(display_rq_regs_st *rq_regs,else rq_regs->rq_regs_l.min_meta_chunk_size =dml_log2 (min_meta_chunk_bytes) -6 +1 ; -if (min_meta_chunk_bytes ==0 ) +if (p1_min_meta_chunk_bytes ==0 ) rq_regs->rq_regs_c.min_meta_chunk_size =0 ;else rq_regs->rq_regs_c.min_meta_chunk_size =dml_log2 (p1_min_meta_chunk_bytes) -6 +1 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 238/591 drm/amdkfd: Fix potential deallocation of previously deallocated memory.
In reply to Greg Kroah-HartmanFrom: Daniil Dulov <[email protected]>
[ Upstream commit cabbdea1f1861098991768d7bbf5a49ed1608213 ]
Pointer mqd_mem_obj can be deallocated in kfd_gtt_sa_allocate(). The function then returns non-zero value, which causes the second deallocation.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v9.c +7 -6
@@ -115,18 +115,19 @@ static struct kfd_mem_obj *allocate_mqd(struct kfd_dev *kfd, &(mqd_mem_obj->gtt_mem), &(mqd_mem_obj->gpu_addr), (void *)&(mqd_mem_obj->cpu_ptr), true); + +if (retval) { +kfree (mqd_mem_obj); +return NULL ; + } }else { retval =kfd_gtt_sa_allocate (kfd,sizeof (struct v9_mqd ), &mqd_mem_obj); - } - -if (retval) { -kfree (mqd_mem_obj); -return NULL ; +if (retval) +return NULL ; }return mqd_mem_obj; - } static void init_mqd(struct mqd_manager *mm, void **mqd,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 239/591 soc: mediatek: SVS: Fix MT8192 GPU node name
In reply to Greg Kroah-HartmanFrom: Chen-Yu Tsai <[email protected]>
[ Upstream commit 95094495401bdf6a0649d220dfd095e6079b5e39 ]
Device tree node names should be generic. The planned device node name for the GPU, according to the bindings and posted DT changes, is "gpu", not "mali".
Fix the GPU node name in the SVS driver to follow.
--- drivers/soc/mediatek/mtk-svs.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/mediatek/mtk-svs.c +2 -2
@@ -2114,9 +2114,9 @@ static int svs_mt8192_platform_probe(struct svs_platform *svsp) svsb = &svsp->banks[idx];if (svsb->type ==SVSB_HIGH ) - svsb->opp_dev =svs_add_device_link (svsp,"mali" ); + svsb->opp_dev =svs_add_device_link (svsp,"gpu" );else if (svsb->type ==SVSB_LOW ) - svsb->opp_dev =svs_get_subsys_device (svsp,"mali" ); + svsb->opp_dev =svs_get_subsys_device (svsp,"gpu" );if (IS_ERR (svsb->opp_dev)) return dev_err_probe(svsp->dev, PTR_ERR(svsb->opp_dev),
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 240/591 drm/amd/display: Fix artifacting on eDP panels when engaging freesync video mode
In reply to Greg Kroah-HartmanFrom: Aurabindo Pillai <[email protected]>
[ Upstream commit b18f05a0666aecd5cb19c26a8305bcfa4e9d6502 ]
[Why]
When freesync video mode is enabled, switching resolution from native mode to one of the freesync video compatible modes can trigger continous artifacts on some eDP panels when running under KDE. The articating can be seen in the attached bug report.
[How]
Fix this by restricting updates that require full commit by using the same checks for stream and scaling changes in the the enable pass of dm_update_crtc_state() along with the check for compatible timings for freesync vide mode.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -0
@@ -8873,6 +8873,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,/* Now check if we should set freesync video mode */ if (amdgpu_freesync_vid_mode && dm_new_crtc_state->stream && +dc_is_stream_unchanged (new_stream, dm_old_crtc_state->stream) && +dc_is_stream_scaling_unchanged (new_stream, dm_old_crtc_state->stream) &&is_timing_unchanged_for_freesync (new_crtc_state, old_crtc_state)) { new_crtc_state->mode_changed = false;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 241/591 drm/radeon: fix possible division-by-zero errors
In reply to Greg Kroah-HartmanFrom: Nikita Zhandarovich <[email protected]>
[ Upstream commit 1becc57cd1a905e2aa0e1eca60d2a37744525c4a ]
Function rv740_get_decoded_reference_divider() may return 0 due to unpredictable reference divider value calculated in radeon_atom_get_clock_dividers(). This will lead to division-by-zero error once that value is used as a divider in calculating 'clk_s'.
While unlikely, this issue should nonetheless be prevented so add a sanity check for such cases by testing 'decoded_ref' value against 0.
Found by Linux Verification Center (linuxtesting.org) with static analysis tool SVACE.
v2: minor coding style fixes (Alex)
In practice this should actually happen as the vbios should be properly populated.
--- drivers/gpu/drm/radeon/cypress_dpm.c | 8 ++++++-- drivers/gpu/drm/radeon/ni_dpm.c | 8 ++++++-- drivers/gpu/drm/radeon/rv740_dpm.c | 8 ++++++-- 3 files changed, 18 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/cypress_dpm.c +6 -2
@@ -557,8 +557,12 @@ static int cypress_populate_mclk_value(struct radeon_device *rdev, ASIC_INTERNAL_MEMORY_SS, vco_freq)) {u32 reference_clock = rdev->clock.mpll.reference_freq;u32 decoded_ref =rv740_get_decoded_reference_divider (dividers.ref_div); -u32 clk_s = reference_clock *5 / (decoded_ref * ss.rate); -u32 clk_v = ss.percentage * +u32 clk_s, clk_v; + +if (!decoded_ref) +return -EINVAL ; + clk_s = reference_clock *5 / (decoded_ref * ss.rate); + clk_v = ss.percentage * (0x4000 * dividers.whole_fb_div +0x800 * dividers.frac_fb_div) / (clk_s *625 ); mpll_ss1 &= ~CLKV_MASK ;
drivers/gpu/drm/radeon/ni_dpm.c +6 -2
@@ -2241,8 +2241,12 @@ static int ni_populate_mclk_value(struct radeon_device *rdev, ASIC_INTERNAL_MEMORY_SS, vco_freq)) {u32 reference_clock = rdev->clock.mpll.reference_freq;u32 decoded_ref =rv740_get_decoded_reference_divider (dividers.ref_div); -u32 clk_s = reference_clock *5 / (decoded_ref * ss.rate); -u32 clk_v = ss.percentage * +u32 clk_s, clk_v; + +if (!decoded_ref) +return -EINVAL ; + clk_s = reference_clock *5 / (decoded_ref * ss.rate); + clk_v = ss.percentage * (0x4000 * dividers.whole_fb_div +0x800 * dividers.frac_fb_div) / (clk_s *625 ); mpll_ss1 &= ~CLKV_MASK ;
drivers/gpu/drm/radeon/rv740_dpm.c +6 -2
@@ -249,8 +249,12 @@ int rv740_populate_mclk_value(struct radeon_device *rdev, ASIC_INTERNAL_MEMORY_SS, vco_freq)) {u32 reference_clock = rdev->clock.mpll.reference_freq;u32 decoded_ref =rv740_get_decoded_reference_divider (dividers.ref_div); -u32 clk_s = reference_clock *5 / (decoded_ref * ss.rate); -u32 clk_v =0x40000 * ss.percentage * +u32 clk_s, clk_v; + +if (!decoded_ref) +return -EINVAL ; + clk_s = reference_clock *5 / (decoded_ref * ss.rate); + clk_v =0x40000 * ss.percentage * (dividers.whole_fb_div + (dividers.frac_fb_div /8 )) / (clk_s *10000 ); mpll_ss1 &= ~CLKV_MASK ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 242/591 HID: uclogic: Modular KUnit tests should not depend on KUNIT=y
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 49904a0ebf23b15aad288a10f5354e7cd8193121 ]
While KUnit tests that cannot be built as a loadable module must depend on "KUNIT=y", this is not true for modular tests, where it adds an unnecessary limitation.
Fix this by relaxing the dependency to "KUNIT".
--- drivers/hid/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/hid/Kconfig +1 -1
@@ -1262,7 +1262,7 @@ config HID_MCP2221 config HID_KUNIT_TEST tristate "KUnit tests for HID" if !KUNIT_ALL_TESTS - depends on KUNIT=y + depends on KUNIT depends on HID_UCLOGIC default KUNIT_ALL_TESTS help
Greg Kroah-Hartman
maintainerPATCH 243/591 RDMA/rxe: Add ibdev_dbg macros for rxe
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit 4554bac48a8c464ff00136a64efe8847e4da4ea8 ]
Add macros borrowed from siw to call dynamic debug macro ibdev_dbg.
Stable-dep-of: 425e1c9018fd ("RDMA/rxe: Fix access checks in rxe_check_bind_mw")
--- drivers/infiniband/sw/rxe/rxe.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
drivers/infiniband/sw/rxe/rxe.h +19 -0
@@ -38,6 +38,25 @@#define RXE_ROCE_V2_SPORT (0xc000) +#define rxe_dbg (rxe, fmt, ...) ibdev_dbg(&(rxe)->ib_dev, \ + "%s: " fmt, __func__, ##__VA_ARGS__) +#define rxe_dbg_uc (uc, fmt, ...) ibdev_dbg((uc)->ibuc.device, \ + "uc#%d %s: " fmt, (uc)->elem.index, __func__, ##__VA_ARGS__) +#define rxe_dbg_pd (pd, fmt, ...) ibdev_dbg((pd)->ibpd.device, \ + "pd#%d %s: " fmt, (pd)->elem.index, __func__, ##__VA_ARGS__) +#define rxe_dbg_ah (ah, fmt, ...) ibdev_dbg((ah)->ibah.device, \ + "ah#%d %s: " fmt, (ah)->elem.index, __func__, ##__VA_ARGS__) +#define rxe_dbg_srq (srq, fmt, ...) ibdev_dbg((srq)->ibsrq.device, \ + "srq#%d %s: " fmt, (srq)->elem.index, __func__, ##__VA_ARGS__) +#define rxe_dbg_qp (qp, fmt, ...) ibdev_dbg((qp)->ibqp.device, \ + "qp#%d %s: " fmt, (qp)->elem.index, __func__, ##__VA_ARGS__) +#define rxe_dbg_cq (cq, fmt, ...) ibdev_dbg((cq)->ibcq.device, \ + "cq#%d %s: " fmt, (cq)->elem.index, __func__, ##__VA_ARGS__) +#define rxe_dbg_mr (mr, fmt, ...) ibdev_dbg((mr)->ibmr.device, \ + "mr#%d %s: " fmt, (mr)->elem.index, __func__, ##__VA_ARGS__) +#define rxe_dbg_mw (mw, fmt, ...) ibdev_dbg((mw)->ibmw.device, \ + "mw#%d %s: " fmt, (mw)->elem.index, __func__, ##__VA_ARGS__) +void rxe_set_mtu (struct rxe_dev *rxe,unsigned int dev_mtu);int rxe_add (struct rxe_dev *rxe,unsigned int mtu,const char *ibdev_name);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 244/591 RDMA/rxe: Replace pr_xxx by rxe_dbg_xxx in rxe_mw.c
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit e8a87efdf87455454d0a14fd486c679769bfeee2 ]
Replace calls to pr_xxx() int rxe_mw.c with rxe_dbg_xxx().
Stable-dep-of: 425e1c9018fd ("RDMA/rxe: Fix access checks in rxe_check_bind_mw")
--- drivers/infiniband/sw/rxe/rxe_mw.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
drivers/infiniband/sw/rxe/rxe_mw.c +10 -10
@@ -52,14 +52,14 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, {if (mw->ibmw.type ==IB_MW_TYPE_1 ) {if (unlikely (mw->state !=RXE_MW_STATE_VALID )) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to bind a type 1 MW not in the valid state\n" );return -EINVAL ; }/* o10-36.2.2 */ if (unlikely ((mw->access &IB_ZERO_BASED ))) { -pr_err_once ("attempt to bind a zero based type 1 MW\n" ); +rxe_dbg_mw (mw,"attempt to bind a zero based type 1 MW\n" );return -EINVAL ; } }
@@ -67,21 +67,21 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe,if (mw->ibmw.type ==IB_MW_TYPE_2 ) {/* o10-37.2.30 */ if (unlikely (mw->state !=RXE_MW_STATE_FREE )) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to bind a type 2 MW not in the free state\n" );return -EINVAL ; }/* C10-72 */ if (unlikely (qp->pd !=to_rpd (mw->ibmw.pd))) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to bind type 2 MW with qp with different PD\n" );return -EINVAL ; }/* o10-37.2.40 */ if (unlikely (!mr || wqe->wr.wr.mw.length ==0 )) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to invalidate type 2 MW by binding with NULL or zero length MR\n" );return -EINVAL ; }
@@ -92,13 +92,13 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe,return 0 ;if (unlikely (mr->access &IB_ZERO_BASED )) { -pr_err_once ("attempt to bind MW to zero based MR\n" ); +rxe_dbg_mw (mw,"attempt to bind MW to zero based MR\n" );return -EINVAL ; }/* C10-73 */ if (unlikely (!(mr->access &IB_ACCESS_MW_BIND ))) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to bind an MW to an MR without bind access\n" );return -EINVAL ; }
@@ -107,7 +107,7 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe,if (unlikely ((mw->access & (IB_ACCESS_REMOTE_WRITE |IB_ACCESS_REMOTE_ATOMIC )) && !(mr->access &IB_ACCESS_LOCAL_WRITE ))) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to bind an Writable MW to an MR without local write access\n" );return -EINVAL ; }
@@ -115,7 +115,7 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe,/* C10-75 */ if (mw->access &IB_ZERO_BASED ) {if (unlikely (wqe->wr.wr.mw.length > mr->ibmr.length)) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to bind a ZB MW outside of the MR\n" );return -EINVAL ; }
@@ -123,7 +123,7 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe,if (unlikely ((wqe->wr.wr.mw.addr < mr->ibmr.iova) || ((wqe->wr.wr.mw.addr + wqe->wr.wr.mw.length) > (mr->ibmr.iova + mr->ibmr.length)))) { -pr_err_once ( +rxe_dbg_mw (mw,"attempt to bind a VA MW outside of the MR\n" );return -EINVAL ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 245/591 RDMA/rxe: Fix access checks in rxe_check_bind_mw
In reply to Greg Kroah-HartmanFrom: Bob Pearson <[email protected]>
[ Upstream commit 425e1c9018fdf25cb4531606cc92d9d01a55534f ]
The subroutine rxe_check_bind_mw() in rxe_mw.c performs checks on the mw access flags before they are set so they always succeed. This patch instead checks the access flags passed in the send wqe.
--- drivers/infiniband/sw/rxe/rxe_mw.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/infiniband/sw/rxe/rxe_mw.c +9 -8
@@ -48,7 +48,7 @@ int rxe_dealloc_mw(struct ib_mw *ibmw) }static int rxe_check_bind_mw (struct rxe_qp *qp,struct rxe_send_wqe *wqe, -struct rxe_mw *mw,struct rxe_mr *mr) +struct rxe_mw *mw,struct rxe_mr *mr,int access) {if (mw->ibmw.type ==IB_MW_TYPE_1 ) {if (unlikely (mw->state !=RXE_MW_STATE_VALID )) {
@@ -58,7 +58,7 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, }/* o10-36.2.2 */ -if (unlikely ((mw->access &IB_ZERO_BASED ))) { +if (unlikely ((access &IB_ZERO_BASED ))) {rxe_dbg_mw (mw,"attempt to bind a zero based type 1 MW\n" );return -EINVAL ; }
@@ -104,7 +104,7 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, }/* C10-74 */ -if (unlikely ((mw->access & +if (unlikely ((access & (IB_ACCESS_REMOTE_WRITE |IB_ACCESS_REMOTE_ATOMIC )) && !(mr->access &IB_ACCESS_LOCAL_WRITE ))) { rxe_dbg_mw(mw,
@@ -113,7 +113,7 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, }/* C10-75 */ -if (mw->access &IB_ZERO_BASED ) { +if (access &IB_ZERO_BASED ) {if (unlikely (wqe->wr.wr.mw.length > mr->ibmr.length)) {rxe_dbg_mw (mw,"attempt to bind a ZB MW outside of the MR\n" );
@@ -133,12 +133,12 @@ static int rxe_check_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe, }static void rxe_do_bind_mw (struct rxe_qp *qp,struct rxe_send_wqe *wqe, -struct rxe_mw *mw,struct rxe_mr *mr) +struct rxe_mw *mw,struct rxe_mr *mr,int access) {u32 key = wqe->wr.wr.mw.rkey &0xff ; mw->rkey = (mw->rkey & ~0xff ) | key; - mw->access = wqe->wr.wr.mw.access; + mw->access = access; mw->state =RXE_MW_STATE_VALID ; mw->addr = wqe->wr.wr.mw.addr; mw->length = wqe->wr.wr.mw.length;
@@ -169,6 +169,7 @@ int rxe_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe)struct rxe_dev *rxe =to_rdev (qp->ibqp.device);u32 mw_rkey = wqe->wr.wr.mw.mw_rkey;u32 mr_lkey = wqe->wr.wr.mw.mr_lkey; +int access = wqe->wr.wr.mw.access; mw =rxe_pool_get_index (&rxe->mw_pool, mw_rkey >>8 );if (unlikely (!mw)) {
@@ -198,11 +199,11 @@ int rxe_bind_mw(struct rxe_qp *qp, struct rxe_send_wqe *wqe)spin_lock_bh (&mw->lock); - ret =rxe_check_bind_mw (qp, wqe, mw, mr); + ret =rxe_check_bind_mw (qp, wqe, mw, mr, access);if (ret) goto err_unlock; -rxe_do_bind_mw (qp, wqe, mw, mr); +rxe_do_bind_mw (qp, wqe, mw, mr, access); err_unlock:spin_unlock_bh (&mw->lock); err_drop_mr:
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 246/591 amdgpu: validate offset_in_bo of drm_amdgpu_gem_va
In reply to Greg Kroah-HartmanFrom: Chia-I Wu <[email protected]>
[ Upstream commit 9f0bcf49e9895cb005d78b33a5eebfa11711b425 ]
This is motivated by OOB access in amdgpu_vm_update_range when offset_in_bo+map_size overflows.
v2: keep the validations in amdgpu_vm_bo_map
v3: add the validations to amdgpu_vm_bo_map/amdgpu_vm_bo_replace_map
rather than to amdgpu_gem_va_ioctl
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +8 -8
@@ -1427,14 +1427,14 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev,uint64_t eaddr;/* validate the parameters */ -if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || - size ==0 || size & ~PAGE_MASK ) +if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || size & ~PAGE_MASK ) +return -EINVAL ; +if (saddr + size <= saddr || offset + size <= offset)return -EINVAL ;/* make sure object fit at this offset */ eaddr = saddr + size -1 ; -if (saddr >= eaddr || - (bo && offset + size >amdgpu_bo_size (bo)) || +if ((bo && offset + size >amdgpu_bo_size (bo)) || (eaddr >= adev->vm_manager.max_pfn <<AMDGPU_GPU_PAGE_SHIFT ))return -EINVAL ;
@@ -1493,14 +1493,14 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev,int r;/* validate the parameters */ -if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || - size ==0 || size & ~PAGE_MASK ) +if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || size & ~PAGE_MASK ) +return -EINVAL ; +if (saddr + size <= saddr || offset + size <= offset)return -EINVAL ;/* make sure object fit at this offset */ eaddr = saddr + size -1 ; -if (saddr >= eaddr || - (bo && offset + size >amdgpu_bo_size (bo)) || +if ((bo && offset + size >amdgpu_bo_size (bo)) || (eaddr >= adev->vm_manager.max_pfn <<AMDGPU_GPU_PAGE_SHIFT ))return -EINVAL ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 247/591 drm/msm/a5xx: really check for A510 in a5xx_gpu_init
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 736a9327365644b460e4498b1ce172ca411efcbc ]
The commit 010c8bbad2cb ("drm: msm: adreno: Disable preemption on Adreno 510") added special handling for a510 (this SKU doesn't seem to support preemption, so the driver should clamp nr_rings to 1). However the gpu->revn is not yet set (it is set later, in adreno_gpu_init()) and thus the condition is always false. Check config->rev instead.
Patchwork: https://patchwork.freedesktop.org/patch/531511/
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +2 -1
@@ -1740,6 +1740,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) {struct msm_drm_private *priv = dev->dev_private;struct platform_device *pdev = priv->gpu_pdev; +struct adreno_platform_config *config = pdev->dev.platform_data;struct a5xx_gpu *a5xx_gpu =NULL ;struct adreno_gpu *adreno_gpu;struct msm_gpu *gpu;
@@ -1766,7 +1767,7 @@ struct msm_gpu *a5xx_gpu_init(struct drm_device *dev) nr_rings =4 ; -if (adreno_is_a510 (adreno_gpu)) +if (adreno_cmp_rev (ADRENO_REV (5 ,1 ,0 ,ANY_ID ), config->rev)) nr_rings =1 ; ret =adreno_gpu_init (dev, pdev, adreno_gpu, &funcs, nr_rings);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 248/591 RDMA/bnxt_re: wraparound mbox producer index
In reply to Greg Kroah-HartmanFrom: Kashyap Desai <[email protected]>
[ Upstream commit 0af91306e17ef3d18e5f100aa58aa787869118af ]
Driver is not handling the wraparound of the mbox producer index correctly. Currently the wraparound happens once u32 max is reached.
Bit 31 of the producer index register is special and should be set only once for the first command. Because the producer index overflow setting bit31 after a long time, FW goes to initialization sequence and this causes FW hang.
Fix is to wraparound the mbox producer index once it reaches u16 max.
--- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +2 -2
@@ -181,7 +181,7 @@ static int __send_message(struct bnxt_qplib_rcfw *rcfw, struct cmdq_base *req, }while (size >0 ); cmdq->seq_num++; - cmdq_prod = hwq->prod; + cmdq_prod = hwq->prod &0xFFFF ;if (test_bit (FIRMWARE_FIRST_FLAG , &cmdq->flags)) {/* The very first doorbell write * is required to set this flag
@@ -598,7 +598,7 @@ int bnxt_qplib_alloc_rcfw_channel(struct bnxt_qplib_res *res, rcfw->cmdq_depth =BNXT_QPLIB_CMDQE_MAX_CNT_8192 ; sginfo.pgsize =bnxt_qplib_cmdqe_page_size (rcfw->cmdq_depth); - hwq_attr.depth = rcfw->cmdq_depth; + hwq_attr.depth = rcfw->cmdq_depth &0x7FFFFFFF ; hwq_attr.stride =BNXT_QPLIB_CMDQE_UNITS ; hwq_attr.type =HWQ_TYPE_CTX ;if (bnxt_qplib_alloc_init_hwq (&cmdq->hwq, &hwq_attr)) {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 249/591 RDMA/bnxt_re: Avoid calling wake_up threads from spin_lock context
In reply to Greg Kroah-HartmanFrom: Kashyap Desai <[email protected]>
[ Upstream commit 3099bcdc19b701f732f638ee45679858c08559bb ]
bnxt_qplib_service_creq can be called from interrupt or tasklet or process context. So the function take irq variant of spin_lock. But when wake_up is invoked with the lock held, it is putting the calling context to sleep.
[exception RIP: __wake_up_common+190]
RIP: ffffffffb7539d7e RSP: ffffa73300207ad8 RFLAGS: 00000083 RAX: 0000000000000001 RBX: ffff91fa295f69b8 RCX: dead000000000200 RDX: ffffa733344af940 RSI: ffffa73336527940 RDI: ffffa73336527940 RBP: 000000000000001c R8: 0000000000000002 R9: 00000000000299c0 R10: 0000017230de82c5 R11: 0000000000000002 R12: ffffa73300207b28 R13: 0000000000000000 R14: ffffa733341bf928 R15: 0000000000000000 ORIG_RAX: ffffffffffffffff CS: 0010 SS: 0018
Call the wakeup after releasing the lock.
--- drivers/infiniband/hw/bnxt_re/qplib_rcfw.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c +10 -3
@@ -299,7 +299,8 @@ static int bnxt_qplib_process_func_event(struct bnxt_qplib_rcfw *rcfw, }static int bnxt_qplib_process_qp_event (struct bnxt_qplib_rcfw *rcfw, -struct creq_qp_event *qp_event) +struct creq_qp_event *qp_event, +u32 *num_wait) {struct creq_qp_error_notification *err_event;struct bnxt_qplib_hwq *hwq = &rcfw->cmdq.hwq;
@@ -308,6 +309,7 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw,u16 cbit, blocked =0 ;struct pci_dev *pdev;unsigned long flags; +u32 wait_cmds =0 ;__le16 mcookie;u16 cookie;int rc =0 ;
@@ -367,9 +369,10 @@ static int bnxt_qplib_process_qp_event(struct bnxt_qplib_rcfw *rcfw, crsqe->req_size =0 ;if (!blocked) -wake_up (&rcfw->cmdq.waitq); + wait_cmds++;spin_unlock_irqrestore (&hwq->lock, flags); } + *num_wait += wait_cmds;return rc; }
@@ -383,6 +386,7 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t)struct creq_base *creqe;u32 sw_cons, raw_cons;unsigned long flags; +u32 num_wakeup =0 ;/* Service the CREQ until budget is over */ spin_lock_irqsave (&hwq->lock, flags);
@@ -401,7 +405,8 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t)switch (type) {case CREQ_BASE_TYPE_QP_EVENT :bnxt_qplib_process_qp_event - (rcfw, (struct creq_qp_event *)creqe); + (rcfw, (struct creq_qp_event *)creqe, + &num_wakeup); creq->stats.creq_qp_event_processed++;break ;case CREQ_BASE_TYPE_FUNC_EVENT :
@@ -429,6 +434,8 @@ static void bnxt_qplib_service_creq(struct tasklet_struct *t) rcfw->res->cctx, true); }spin_unlock_irqrestore (&hwq->lock, flags); +if (num_wakeup) +wake_up_nr (&rcfw->cmdq.waitq, num_wakeup); }static irqreturn_t bnxt_qplib_creq_irq (int irq,void *dev_instance)
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 250/591 clk: imx: clk-imxrt1050: fix memory leak in imxrt1050_clocks_probe
In reply to Greg Kroah-HartmanFrom: Kai Ma <[email protected]>
[ Upstream commit 1b280598ab3bd8a2dc8b96a12530d5b1ee7a8f4a ]
Use devm_of_iomap() instead of of_iomap() to automatically handle the unused ioremap region. If any error occurs, regions allocated by kzalloc() will leak, but using devm_kzalloc() instead will automatically free the memory using devm_kfree().
Also, fix error handling of hws by adding unregister_hws label, which unregisters remaining hws when iomap failed.
--- drivers/clk/imx/clk-imxrt1050.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
drivers/clk/imx/clk-imxrt1050.c +15 -7
@@ -42,7 +42,7 @@ static int imxrt1050_clocks_probe(struct platform_device *pdev)struct device_node *anp;int ret; - clk_hw_data =kzalloc (struct_size (clk_hw_data, hws, + clk_hw_data =devm_kzalloc (dev,struct_size (clk_hw_data, hws,IMXRT1050_CLK_END ),GFP_KERNEL );if (WARN_ON (!clk_hw_data))return -ENOMEM ;
@@ -53,10 +53,12 @@ static int imxrt1050_clocks_probe(struct platform_device *pdev) hws[IMXRT1050_CLK_OSC ] =imx_obtain_fixed_clk_hw (np,"osc" ); anp =of_find_compatible_node (NULL ,NULL ,"fsl,imxrt-anatop" ); - pll_base =of_iomap (anp,0 ); + pll_base =devm_of_iomap (dev, anp,0 ,NULL );of_node_put (anp); -if (WARN_ON (!pll_base)) -return -ENOMEM ; +if (WARN_ON (IS_ERR (pll_base))) { + ret =PTR_ERR (pll_base); + goto unregister_hws; + }/* Anatop clocks */ hws[IMXRT1050_CLK_DUMMY ] =imx_clk_hw_fixed ("dummy" ,0UL );
@@ -104,8 +106,10 @@ static int imxrt1050_clocks_probe(struct platform_device *pdev)/* CCM clocks */ ccm_base =devm_platform_ioremap_resource (pdev,0 ); -if (WARN_ON (IS_ERR (ccm_base))) -return PTR_ERR (ccm_base); +if (WARN_ON (IS_ERR (ccm_base))) { + ret =PTR_ERR (ccm_base); + goto unregister_hws; + } hws[IMXRT1050_CLK_ARM_PODF ] =imx_clk_hw_divider ("arm_podf" ,"pll1_arm" , ccm_base +0x10 ,0 ,3 ); hws[IMXRT1050_CLK_PRE_PERIPH_SEL] = imx_clk_hw_mux("pre_periph_sel", ccm_base + 0x18, 18, 2,
@@ -148,8 +152,12 @@ static int imxrt1050_clocks_probe(struct platform_device *pdev) ret =of_clk_add_hw_provider (np, of_clk_hw_onecell_get, clk_hw_data);if (ret <0 ) {dev_err (dev,"Failed to register clks for i.MXRT1050.\n" ); -imx_unregister_hw_clocks (hws,IMXRT1050_CLK_END ); + goto unregister_hws; } +return 0 ; + +unregister_hws: +imx_unregister_hw_clocks (hws,IMXRT1050_CLK_END );return ret; }static const struct of_device_id imxrt1050_clk_of_match[] = {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 251/591 clk: imx: clk-imx8mn: fix memory leak in imx8mn_clocks_probe
In reply to Greg Kroah-HartmanFrom: Hao Luo <[email protected]>
[ Upstream commit 188d070de9132667956f5aadd98d2bd87d3eac89 ]
Use devm_of_iomap() instead of of_iomap() to automatically handle the unused ioremap region.
If any error occurs, regions allocated by kzalloc() will leak, but using devm_kzalloc() instead will automatically free the memory using devm_kfree().
--- drivers/clk/imx/clk-imx8mn.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/clk/imx/clk-imx8mn.c +4 -4
@@ -323,7 +323,7 @@ static int imx8mn_clocks_probe(struct platform_device *pdev)void __iomem *base;int ret; - clk_hw_data =kzalloc (struct_size (clk_hw_data, hws, + clk_hw_data =devm_kzalloc (dev,struct_size (clk_hw_data, hws,IMX8MN_CLK_END ),GFP_KERNEL );if (WARN_ON (!clk_hw_data))return -ENOMEM ;
@@ -340,10 +340,10 @@ static int imx8mn_clocks_probe(struct platform_device *pdev) hws[IMX8MN_CLK_EXT4 ] =imx_obtain_fixed_clk_hw (np,"clk_ext4" ); np =of_find_compatible_node (NULL ,NULL ,"fsl,imx8mn-anatop" ); - base =of_iomap (np,0 ); + base =devm_of_iomap (dev, np,0 ,NULL );of_node_put (np); -if (WARN_ON (!base)) { - ret = -ENOMEM ; +if (WARN_ON (IS_ERR (base))) { + ret =PTR_ERR (base); goto unregister_hws; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 252/591 clk: imx93: fix memory leak and missing unwind goto in imx93_clocks_probe
In reply to Greg Kroah-HartmanFrom: Zhanhao Hu <[email protected]>
[ Upstream commit e02ba11b457647050cb16e7cad16cec3c252fade ]
In function probe(), it returns directly without unregistered hws when error occurs.
Fix this by adding 'goto unregister_hws;' on line 295 and line 310.
Use devm_kzalloc() instead of kzalloc() to automatically free the memory using devm_kfree() when error occurs.
Replace of_iomap() with devm_of_iomap() to automatically handle the unused ioremap region and delete 'iounmap(anatop_base);' in unregister_hws.
--- drivers/clk/imx/clk-imx93.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
drivers/clk/imx/clk-imx93.c +8 -7
@@ -261,7 +261,7 @@ static int imx93_clocks_probe(struct platform_device *pdev)void __iomem *base, *anatop_base;int i, ret; - clk_hw_data =kzalloc (struct_size (clk_hw_data, hws, + clk_hw_data =devm_kzalloc (dev,struct_size (clk_hw_data, hws,IMX93_CLK_END ),GFP_KERNEL );if (!clk_hw_data)return -ENOMEM ;
@@ -285,10 +285,12 @@ static int imx93_clocks_probe(struct platform_device *pdev) "sys_pll_pfd2", 1, 2); np =of_find_compatible_node (NULL ,NULL ,"fsl,imx93-anatop" ); - anatop_base =of_iomap (np,0 ); + anatop_base =devm_of_iomap (dev, np,0 ,NULL );of_node_put (np); -if (WARN_ON (!anatop_base)) -return -ENOMEM ; +if (WARN_ON (IS_ERR (anatop_base))) { + ret =PTR_ERR (base); + goto unregister_hws; + } clks[IMX93_CLK_AUDIO_PLL ] =imx_clk_fracn_gppll ("audio_pll" ,"osc_24m" , anatop_base +0x1200 , &imx_fracn_gppll);
@@ -298,8 +300,8 @@ static int imx93_clocks_probe(struct platform_device *pdev) np = dev->of_node; base =devm_platform_ioremap_resource (pdev,0 );if (WARN_ON (IS_ERR (base))) { -iounmap (anatop_base); -return PTR_ERR (base); + ret =PTR_ERR (base); + goto unregister_hws; }for (i =0 ; i <ARRAY_SIZE (root_array); i++) {
@@ -329,7 +331,6 @@ static int imx93_clocks_probe(struct platform_device *pdev) unregister_hws:imx_unregister_hw_clocks (clks,IMX93_CLK_END ); -iounmap (anatop_base);return ret; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 253/591 clk: imx: clk-imx8mp: improve error handling in imx8mp_clocks_probe()
In reply to Greg Kroah-HartmanFrom: Yuxing Liu <[email protected]>
[ Upstream commit 878b02d5f3b56cb090dbe2c70c89273be144087f ]
Replace of_iomap() and kzalloc() with devm_of_iomap() and devm_kzalloc() which can automatically release the related memory when the device or driver is removed or unloaded to avoid potential memory leak.
In this case, iounmap(anatop_base) in line 427,433 are removed as manual release is not required.
Besides, referring to clk-imx8mq.c, check the return code of of_clk_add_hw_provider, if it returns negtive, print error info and unregister hws, which makes the program more robust.
--- drivers/clk/imx/clk-imx8mp.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
drivers/clk/imx/clk-imx8mp.c +13 -11
@@ -413,25 +413,22 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)struct device *dev = &pdev->dev;struct device_node *np;void __iomem *anatop_base, *ccm_base; +int err; np =of_find_compatible_node (NULL ,NULL ,"fsl,imx8mp-anatop" ); - anatop_base =of_iomap (np,0 ); + anatop_base =devm_of_iomap (dev, np,0 ,NULL );of_node_put (np); -if (WARN_ON (!anatop_base)) -return -ENOMEM ; +if (WARN_ON (IS_ERR (anatop_base))) +return PTR_ERR (anatop_base); np = dev->of_node; ccm_base =devm_platform_ioremap_resource (pdev,0 ); -if (WARN_ON (IS_ERR (ccm_base))) { -iounmap (anatop_base); +if (WARN_ON (IS_ERR (ccm_base)))return PTR_ERR (ccm_base); - } - clk_hw_data =kzalloc (struct_size (clk_hw_data, hws,IMX8MP_CLK_END ),GFP_KERNEL ); -if (WARN_ON (!clk_hw_data)) { -iounmap (anatop_base); + clk_hw_data =devm_kzalloc (dev,struct_size (clk_hw_data, hws,IMX8MP_CLK_END ),GFP_KERNEL ); +if (WARN_ON (!clk_hw_data))return -ENOMEM ; - } clk_hw_data->num =IMX8MP_CLK_END ; hws = clk_hw_data->hws;
@@ -711,7 +708,12 @@ static int imx8mp_clocks_probe(struct platform_device *pdev)imx_check_clk_hws (hws,IMX8MP_CLK_END ); -of_clk_add_hw_provider (np, of_clk_hw_onecell_get, clk_hw_data); + err =of_clk_add_hw_provider (np, of_clk_hw_onecell_get, clk_hw_data); +if (err <0 ) { +dev_err (dev,"failed to register hws for i.MX8MP\n" ); +imx_unregister_hw_clocks (hws,IMX8MP_CLK_END ); +return err; + }imx_register_uart_clocks (4 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 254/591 arm64: dts: qcom: sdm845: Flush RSC sleep & wake votes
In reply to Greg Kroah-HartmanFrom: Konrad Dybcio <[email protected]>
[ Upstream commit 91e83140b5dd5598fbcfada3ee1f8b2b410c3731 ]
The rpmh driver will cache sleep and wake votes until the cluster power-domain is about to enter idle, to avoid unnecessary writes. So associate the apps_rsc with the cluster pd, so that it can be notified about this event.
Without this, only AMC votes are being commited.
--- arch/arm64/boot/dts/qcom/sdm845.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/qcom/sdm845.dtsi +1 -0
@@ -5043,6 +5043,7 @@ apps_rsc: rsc@179c0000 { <SLEEP_TCS 3>, <WAKE_TCS 3>, <CONTROL_TCS 1>; + power-domains = <&CLUSTER_PD>; apps_bcm_voter: bcm-voter { compatible = "qcom,bcm-voter";
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 255/591 arm64: dts: qcom: sm8250-edo: Panel framebuffer is 2.5k instead of 4k
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 223ce29c8b7e5b00f01a68387aabeefd77d97f06 ]
The framebuffer configuration for edo pdx203, written in edo dtsi (which is overwritten in pdx206 dts for its smaller panel) has to use a 1096x2560 configuration as this is what the panel (and framebuffer area) has been initialized to. Downstream userspace also has access to (and uses) this 2.5k mode by default, and only switches the panel to 4k when requested.
This is similar to commit be8de06dc397 ("arm64: dts: qcom:
sm8150-kumano: Panel framebuffer is 2.5k instead of 4k") which fixed the same for the previous generation Sony platform.
--- arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
arch/arm64/boot/dts/qcom/sm8250-sony-xperia-edo.dtsi +4 -3
@@ -26,9 +26,10 @@ chosen { framebuffer: framebuffer@9c000000 { compatible = "simple-framebuffer"; reg = <0 0x9c000000 0 0x2300000>; - width = <1644>; - height = <3840>; - stride = <(1644 * 4)>; + /* pdx203 BL initializes in 2.5k mode, not 4k */ + width = <1096>; + height = <2560>; + stride = <(1096 * 4)>; format = "a8r8g8b8"; /* * That's a lot of clocks, but it's necessary due
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 256/591 clk: bcm: rpi: Fix off by one in raspberrypi_discover_clocks()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit da2edb3e3c09fd1451b7f400ccd1070ef086619a ]
Smatch detected an off by one in this code:
drivers/clk/bcm/clk-raspberrypi.c:374 raspberrypi_discover_clocks()
error: buffer overflow 'data->hws' 16 <= 16The data->hws[] array has RPI_FIRMWARE_NUM_CLK_ID elements so the > comparison needs to changed to >=.
--- drivers/clk/bcm/clk-raspberrypi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/clk/bcm/clk-raspberrypi.c +2 -2
@@ -375,9 +375,9 @@ static int raspberrypi_discover_clocks(struct raspberrypi_clk *rpi,while (clks->id) {struct raspberrypi_clk_variant *variant; -if (clks->id >RPI_FIRMWARE_NUM_CLK_ID ) { +if (clks->id >=RPI_FIRMWARE_NUM_CLK_ID ) {dev_err (rpi->dev,"Unknown clock id: %u (max: %u)\n" , - clks->id,RPI_FIRMWARE_NUM_CLK_ID ); + clks->id,RPI_FIRMWARE_NUM_CLK_ID -1 );return -EINVAL ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 257/591 clk: clocking-wizard: Fix Oops in clk_wzrd_register_divider()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 9c632a6396505a019ea6d12b5ab45e659a542a93 ]
Smatch detected this potential error pointer dereference clk_wzrd_register_divider(). If devm_clk_hw_register() fails then it sets "hw" to an error pointer and then dereferences it on the next line. Return the error directly instead.
--- drivers/clk/xilinx/clk-xlnx-clock-wizard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/xilinx/clk-xlnx-clock-wizard.c +1 -1
@@ -354,7 +354,7 @@ static struct clk *clk_wzrd_register_divider(struct device *dev, hw = &div->hw; ret =devm_clk_hw_register (dev, hw);if (ret) - hw =ERR_PTR (ret); +return ERR_PTR (ret);return hw->clk; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 258/591 clk: tegra: tegra124-emc: Fix potential memory leak
In reply to Greg Kroah-HartmanFrom: Yuan Can <[email protected]>
[ Upstream commit 53a06e5924c0d43c11379a08c5a78529c3e61595 ]
The tegra and tegra needs to be freed in the error handling path, otherwise it will be leaked.
--- drivers/clk/tegra/clk-tegra124-emc.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/tegra/clk-tegra124-emc.c +2 -0
@@ -464,6 +464,7 @@ static int load_timings_from_dt(struct tegra_clk_emc *tegra, err =load_one_timing_from_dt (tegra, timing, child);if (err) {of_node_put (child); +kfree (tegra->timings);return err; }
@@ -515,6 +516,7 @@ struct clk *tegra124_clk_register_emc(void __iomem *base, struct device_node *np err =load_timings_from_dt (tegra, node, node_ram_code);if (err) {of_node_put (node); +kfree (tegra);return ERR_PTR (err); } }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 259/591 ALSA: ac97: Fix possible NULL dereference in snd_ac97_mixer
In reply to Greg Kroah-HartmanFrom: Su Hui <[email protected]>
[ Upstream commit 79597c8bf64ca99eab385115743131d260339da5 ]
smatch error:sound/pci/ac97/ac97_codec.c:2354 snd_ac97_mixer() error:
we previously assumed 'rac97' could be null (see line 2072)
remove redundant assignment, return error if rac97 is NULL.
--- sound/pci/ac97/ac97_codec.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/pci/ac97/ac97_codec.c +2 -2
@@ -2070,8 +2070,8 @@ int snd_ac97_mixer(struct snd_ac97_bus *bus, struct snd_ac97_template *template, .dev_disconnect = snd_ac97_dev_disconnect, }; -if (rac97) - *rac97 =NULL ; +if (!rac97) +return -EINVAL ;if (snd_BUG_ON (!bus || !template))return -EINVAL ;if (snd_BUG_ON (template->num >=4 ))
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 260/591 drm/msm/dpu: do not enable color-management if DSPPs are not available
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 3bcfc7b90465efd337d39b91b43972162f0d1908 ]
We can not support color management without DSPP blocks being provided in the HW catalog. Do not enable color management for CRTCs if num_dspps is 0.
Patchwork: https://patchwork.freedesktop.org/patch/542141/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c +4 -1
@@ -1579,6 +1579,8 @@ static const struct drm_crtc_helper_funcs dpu_crtc_helper_funcs = {struct drm_crtc *dpu_crtc_init (struct drm_device *dev,struct drm_plane *plane,struct drm_plane *cursor) { +struct msm_drm_private *priv = dev->dev_private; +struct dpu_kms *dpu_kms =to_dpu_kms (priv->kms);struct drm_crtc *crtc =NULL ;struct dpu_crtc *dpu_crtc =NULL ;int i;
@@ -1610,7 +1612,8 @@ struct drm_crtc *dpu_crtc_init(struct drm_device *dev, struct drm_plane *plane,drm_crtc_helper_add (crtc, &dpu_crtc_helper_funcs); -drm_crtc_enable_color_mgmt (crtc,0 , true,0 ); +if (dpu_kms->catalog->dspp_count) +drm_crtc_enable_color_mgmt (crtc,0 , true,0 );/* save user friendly CRTC name for later */ snprintf (dpu_crtc->name,DPU_CRTC_NAME_SIZE ,"crtc%u" , crtc->base.id);
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 261/591 drm/msm/dpu: Fix slice_last_group_size calculation
In reply to Greg Kroah-HartmanFrom: Jessica Zhang <[email protected]>
[ Upstream commit c223059e6f8340f7eac2319470984cbfc39c433b ]
Correct the math for slice_last_group_size so that it matches the calculations downstream.
Patchwork: https://patchwork.freedesktop.org/patch/539269/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c +3 -2
@@ -52,9 +52,10 @@ static void dpu_hw_dsc_config(struct dpu_hw_dsc *hw_dsc,if (is_cmd_mode) initial_lines +=1 ; - slice_last_group_size =3 - (dsc->slice_width %3 ); + slice_last_group_size = (dsc->slice_width +2 ) %3 ; + data = (initial_lines <<20 ); - data |= ((slice_last_group_size -1 ) <<18 ); + data |= (slice_last_group_size <<18 );/* bpp is 6.4 format, 4 LSBs bits are for fractional part */ data |= (dsc->bits_per_pixel <<8 ); data |= (dsc->block_pred_enable <<7 );
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 262/591 drm/msm/dsi: Use DSC slice(s) packet size to compute word count
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit bc6b6ff8135c4b96787eda88f3baf653939a75ce ]
According to downstream the value to use for WORD_COUNT is bytes_per_pkt, which denotes the number of bytes in a packet based on how many slices have been configured by the panel driver times the width of a slice times the number of bytes per pixel.
The DSC panels seen thus far use one byte per pixel, only one slice per packet, and a slice width of half the panel width leading to the desired bytes_per_pkt+1 value to be equal to hdisplay/2+1. This however isn't the case anymore for panels that configure two slices per packet, where the value should now be hdisplay+1.
Note that the aforementioned panel (on a Sony Xperia XZ3, sdm845) with slice_count=1 has also been tested to successfully accept slice_count=2, which would have shown corrupted output previously.
Patchwork: https://patchwork.freedesktop.org/patch/515694/
Stable-dep-of: 155fa3a91d64 ("drm/msm/dsi: Remove incorrect references to slice_count")
--- drivers/gpu/drm/msm/dsi/dsi_host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +1 -1
@@ -987,7 +987,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)if (!msm_host->dsc) wc = hdisplay *dsi_get_bpp (msm_host->format) /8 +1 ;else - wc = mode->hdisplay /2 +1 ; + wc = msm_host->dsc->slice_chunk_size * msm_host->dsc->slice_count +1 ; dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL, DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) |
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 263/591 drm/msm/dsi: Flip greater-than check for slice_count and slice_per_intf
In reply to Greg Kroah-HartmanFrom: Marijn Suijten <[email protected]>
[ Upstream commit 82e72fd22a8f9eff4e75c08be68319008ea90a29 ]
According to downstream /and the comment copied from it/ this comparison should be the other way around. In other words, when the panel driver requests to use more slices per packet than what could be sent over this interface, it is bumped down to only use a single slice per packet (and strangely not the number of slices that could fit on the interface).
Patchwork: https://patchwork.freedesktop.org/patch/515686/
Stable-dep-of: 155fa3a91d64 ("drm/msm/dsi: Remove incorrect references to slice_count")
--- drivers/gpu/drm/msm/dsi/dsi_host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +3 -2
@@ -853,11 +853,12 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod*/ slice_per_intf =DIV_ROUND_UP (hdisplay, dsc->slice_width); -/* If slice_per_pkt is greater than slice_per_intf +/* +* If slice_count is greater than slice_per_intf * then default to 1. This can happen during partial * update. */ -if (slice_per_intf > dsc->slice_count) +if (dsc->slice_count > slice_per_intf) dsc->slice_count =1 ; total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 264/591 drm/msm/dsi: Remove incorrect references to slice_count
In reply to Greg Kroah-HartmanFrom: Jessica Zhang <[email protected]>
[ Upstream commit 155fa3a91d64221eb0885fd221cc8085dbef908f ]
Currently, slice_count is being used to calculate word count and pkt_per_line. Instead, these values should be calculated using slice per packet, which is not the same as slice_count.
Slice count represents the number of slices per interface, and its value will not always match that of slice per packet. For example, it is possible to have cases where there are multiple slices per interface but the panel specifies only one slice per packet.
Thus, use the default value of one slice per packet and remove slice_count from the aforementioned calculations.
Patchwork: https://patchwork.freedesktop.org/patch/541965/
--- drivers/gpu/drm/msm/dsi/dsi_host.c | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-)
drivers/gpu/drm/msm/dsi/dsi_host.c +16 -10
@@ -853,18 +853,17 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod*/ slice_per_intf =DIV_ROUND_UP (hdisplay, dsc->slice_width); -/* -* If slice_count is greater than slice_per_intf -* then default to 1. This can happen during partial -* update. -*/ -if (dsc->slice_count > slice_per_intf) - dsc->slice_count =1 ; - total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf; eol_byte_num = total_bytes_per_intf %3 ; - pkt_per_line = slice_per_intf / dsc->slice_count; + +/* +* Typically, pkt_per_line = slice_per_intf * slice_per_pkt. +* +* Since the current driver only supports slice_per_pkt = 1, +* pkt_per_line will be equal to slice per intf for now. +*/ + pkt_per_line = slice_per_intf;if (is_cmd_mode)/* packet data type */ reg =DSI_COMMAND_COMPRESSION_MODE_CTRL_STREAM0_DATATYPE (MIPI_DSI_DCS_LONG_WRITE );
@@ -988,7 +987,14 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)if (!msm_host->dsc) wc = hdisplay *dsi_get_bpp (msm_host->format) /8 +1 ;else - wc = msm_host->dsc->slice_chunk_size * msm_host->dsc->slice_count +1 ; +/* +* When DSC is enabled, WC = slice_chunk_size * slice_per_pkt + 1. +* Currently, the driver only supports default value of slice_per_pkt = 1 +* +* TODO: Expand mipi_dsi_device struct to hold slice_per_pkt info +* and adjust DSC math to account for slice_per_pkt. +*/ + wc = msm_host->dsc->slice_chunk_size +1 ; dsi_write(msm_host, REG_DSI_CMD_MDP_STREAM0_CTRL, DSI_CMD_MDP_STREAM0_CTRL_WORD_COUNT(wc) |
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 265/591 drm/msm/dp: Free resources after unregistering them
In reply to Greg Kroah-HartmanFrom: Bjorn Andersson <[email protected]>
[ Upstream commit fa0048a4b1fa7a50c8b0e514f5b428abdf69a6f8 ]
The DP component's unbind operation walks through the submodules to unregister and clean things up. But if the unbind happens because the DP controller itself is being removed, all the memory for those submodules has just been freed.
Change the order of these operations to avoid the many use-after-free that otherwise happens in this code path.
Patchwork: https://patchwork.freedesktop.org/patch/542166/
--- drivers/gpu/drm/msm/dp/dp_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/dp/dp_display.c +1 -1
@@ -1342,9 +1342,9 @@ static int dp_display_remove(struct platform_device *pdev) {struct dp_display_private *dp =dev_get_dp_display_private (&pdev->dev); +component_del (&pdev->dev, &dp_display_comp_ops);dp_display_deinit_sub_modules (dp); -component_del (&pdev->dev, &dp_display_comp_ops);platform_set_drvdata (pdev,NULL );return 0 ;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 266/591 arm64: dts: mediatek: Add cpufreq nodes for MT8192
In reply to Greg Kroah-HartmanFrom: Allen-KH Cheng <[email protected]>
[ Upstream commit 9d498cce9298a71e3896e2d1aee24a1a4c531d81 ]
Add the cpufreq nodes for MT8192 SoC.
Stable-dep-of: a4366b5695c9 ("arm64: dts: mediatek: mt8192: Fix CPUs capacity-dmips-mhz")
--- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
arch/arm64/boot/dts/mediatek/mt8192.dtsi +14 -0
@@ -64,6 +64,7 @@ cpu0: cpu@0 { clock-frequency = <1701000000>; cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; + performance-domains = <&performance 0>; capacity-dmips-mhz = <530>; };
@@ -75,6 +76,7 @@ cpu1: cpu@100 { clock-frequency = <1701000000>; cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; + performance-domains = <&performance 0>; capacity-dmips-mhz = <530>; };
@@ -86,6 +88,7 @@ cpu2: cpu@200 { clock-frequency = <1701000000>; cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; + performance-domains = <&performance 0>; capacity-dmips-mhz = <530>; };
@@ -97,6 +100,7 @@ cpu3: cpu@300 { clock-frequency = <1701000000>; cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; + performance-domains = <&performance 0>; capacity-dmips-mhz = <530>; };
@@ -108,6 +112,7 @@ cpu4: cpu@400 { clock-frequency = <2171000000>; cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; + performance-domains = <&performance 1>; capacity-dmips-mhz = <1024>; };
@@ -119,6 +124,7 @@ cpu5: cpu@500 { clock-frequency = <2171000000>; cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; + performance-domains = <&performance 1>; capacity-dmips-mhz = <1024>; };
@@ -130,6 +136,7 @@ cpu6: cpu@600 { clock-frequency = <2171000000>; cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; + performance-domains = <&performance 1>; capacity-dmips-mhz = <1024>; };
@@ -141,6 +148,7 @@ cpu7: cpu@700 { clock-frequency = <2171000000>; cpu-idle-states = <&cpu_sleep_b &cluster_sleep_b>; next-level-cache = <&l2_1>; + performance-domains = <&performance 1>; capacity-dmips-mhz = <1024>; };
@@ -257,6 +265,12 @@ soc { compatible = "simple-bus"; ranges; + performance: performance-controller@11bc10 { + compatible = "mediatek,cpufreq-hw"; + reg = <0 0x0011bc10 0 0x120>, <0 0x0011bd30 0 0x120>; + #performance-domain-cells = <1>; + }; + gic: interrupt-controller@c000000 { compatible = "arm,gic-v3"; #interrupt-cells = <4>;
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 267/591 arm64: dts: mediatek: mt8192: Fix CPUs capacity-dmips-mhz
In reply to Greg Kroah-HartmanFrom: Nícolas F. R. A. Prado <[email protected]>
[ Upstream commit a4366b5695c984b8a3fc8b31de9e758c8f6d1aed ]
The capacity-dmips-mhz parameter was miscalculated: this SoC runs the first (Cortex-A55) cluster at a maximum of 2000MHz and the second (Cortex-A76) cluster at a maximum of 2200MHz.
In order to calculate the right capacity-dmips-mhz, the following test was performed:
1. CPUFREQ governor was set to 'performance' on both clusters
2. Ran dhrystone with 500000000 iterations for 10 times on each cluster
3. Calculated the mean result for each cluster
4. Calculated DMIPS/MHz: dmips_mhz = dmips_per_second / cpu_mhz
5. Scaled results to 1024:
result_c0 = dmips_mhz_c0 / dmips_mhz_c1 * 1024
The mean results for this SoC are:
Cluster 0 (LITTLE): 12016411 Dhry/s
Cluster 1 (BIG): 31702034 Dhry/s
The calculated scaled results are:
Cluster 0: 426.953226899238 (rounded to 427)
Cluster 1: 1024
--- arch/arm64/boot/dts/mediatek/mt8192.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/mediatek/mt8192.dtsi +4 -4
@@ -65,7 +65,7 @@ cpu0: cpu@0 { cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; performance-domains = <&performance 0>; - capacity-dmips-mhz = <530>; + capacity-dmips-mhz = <427>; }; cpu1: cpu@100 {
@@ -77,7 +77,7 @@ cpu1: cpu@100 { cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; performance-domains = <&performance 0>; - capacity-dmips-mhz = <530>; + capacity-dmips-mhz = <427>; }; cpu2: cpu@200 {
@@ -89,7 +89,7 @@ cpu2: cpu@200 { cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; performance-domains = <&performance 0>; - capacity-dmips-mhz = <530>; + capacity-dmips-mhz = <427>; }; cpu3: cpu@300 {
@@ -101,7 +101,7 @@ cpu3: cpu@300 { cpu-idle-states = <&cpu_sleep_l &cluster_sleep_l>; next-level-cache = <&l2_0>; performance-domains = <&performance 0>; - capacity-dmips-mhz = <530>; + capacity-dmips-mhz = <427>; }; cpu4: cpu@400 {
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 268/591 drm/amdgpu: Fix memcpy() in sienna_cichlid_append_powerplay_table function.
In reply to Greg Kroah-HartmanFrom: Srinivasan Shanmugam <[email protected]>
[ Upstream commit d50dc746ff72b9c48812dac3344fa87fbde940a3 ]
Fixes the following gcc with W=1:
In file included from ./include/linux/string.h:253,
from ./include/linux/bitmap.h:11,
from ./include/linux/cpumask.h:12,
from ./arch/x86/include/asm/cpumask.h:5,
from ./arch/x86/include/asm/msr.h:11,
from ./arch/x86/include/asm/processor.h:22,
from ./arch/x86/include/asm/cpufeature.h:5,
from ./arch/x86/include/asm/thread_info.h:53,
from ./include/linux/thread_info.h:60,
from ./arch/x86/include/asm/preempt.h:7,
from ./include/linux/preempt.h:78,
from ./include/linux/spinlock.h:56,
from ./include/linux/mmzone.h:8,
from ./include/linux/gfp.h:7,
from ./include/linux/firmware.h:7,
from drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:26:In function ‘fortify_memcpy_chk’,
inlined from ‘sienna_cichlid_append_powerplay_table’ at drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:444:2,
inlined from ‘sienna_cichlid_setup_pptable’ at drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:506:8,
inlined from ‘sienna_cichlid_setup_pptable’ at drivers/gpu/drm/amd/amdgpu/../pm/swsmu/smu11/sienna_cichlid_ppt.c:494:12:./include/linux/fortify-string.h:413:4: warning: call to ‘__read_overflow2_field’ declared with attribute warning: detected read beyond size of field (2nd parameter); maybe use struct_group()? [-Wattribute-warning]
413 | __read_overflow2_field(q_size_field, size);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~the compiler complains about the size calculation in the memcpy() - "sizeof(*smc_dpm_table) - sizeof(smc_dpm_table->table_header)" is much larger than what fits into table_member.
Hence, reuse 'smu_memcpy_trailing' for nv1x
--- .../amd/pm/swsmu/smu11/sienna_cichlid_ppt.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu11/sienna_cichlid_ppt.c +14 -4
@@ -431,7 +431,13 @@ static int sienna_cichlid_append_powerplay_table(struct smu_context *smu) {struct atom_smc_dpm_info_v4_9 *smc_dpm_table;int index, ret; -I2cControllerConfig_t *table_member; +PPTable_beige_goby_t *ppt_beige_goby; +PPTable_t *ppt; + +if (smu->adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (11 ,0 ,13 )) + ppt_beige_goby = smu->smu_table.driver_pptable; +else + ppt = smu->smu_table.driver_pptable; index =get_index_into_master_table (atom_master_list_of_data_tables_v2_1, smc_dpm_info);
@@ -440,9 +446,13 @@ static int sienna_cichlid_append_powerplay_table(struct smu_context *smu) (uint8_t **)&smc_dpm_table);if (ret)return ret; -GET_PPTABLE_MEMBER (I2cControllers, &table_member); -memcpy (table_member, smc_dpm_table->I2cControllers, -sizeof (*smc_dpm_table) -sizeof (smc_dpm_table->table_header)); + +if (smu->adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (11 ,0 ,13 )) +smu_memcpy_trailing (ppt_beige_goby, I2cControllers, BoardReserved, + smc_dpm_table, I2cControllers); +else +smu_memcpy_trailing (ppt, I2cControllers, BoardReserved, + smc_dpm_table, I2cControllers);return 0 ; }
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 269/591 drm/amdgpu: Fix usage of UMC fill record in RAS
In reply to Greg Kroah-HartmanFrom: Luben Tuikov <[email protected]>
[ Upstream commit 71344a718a9fda8c551cdc4381d354f9a9907f6f ]
The fixed commit listed in the Fixes tag below, introduced a bug in amdgpu_ras.c::amdgpu_reserve_page_direct(), in that when introducing the new amdgpu_umc_fill_error_record() and internally in that new function the physical address (argument "uint64_t retired_page"--wrong name) is right-shifted by AMDGPU_GPU_PAGE_SHIFT. Thus, in amdgpu_reserve_page_direct() when we pass "address" to that new function, we should NOT right-shift it, since this results, erroneously, in the page address to be 0 for first 2^(2*AMDGPU_GPU_PAGE_SHIFT) memory addresses.
This commit fixes this bug.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 -2
@@ -170,8 +170,7 @@ static int amdgpu_reserve_page_direct(struct amdgpu_device *adev, uint64_t addrememset (&err_rec,0x0 ,sizeof (struct eeprom_table_record )); err_data.err_addr = &err_rec; -amdgpu_umc_fill_error_record (&err_data, address, - (address >>AMDGPU_GPU_PAGE_SHIFT ),0 ,0 ); +amdgpu_umc_fill_error_record (&err_data, address, address,0 ,0 );if (amdgpu_bad_page_threshold !=0 ) { amdgpu_ras_add_bad_pages(adev, err_data.err_addr,
Signature · 1 line
2.39.2
Greg Kroah-Hartman
maintainerPATCH 270/591 drm/msm/dpu: correct MERGE_3D length
In reply to Greg Kroah-HartmanFrom: Dmitry Baryshkov <[email protected]>
[ Upstream commit 9a6c13b847d61b0c3796820ca6e976789df59cd8 ]
Each MERGE_3D block has just two registers. Correct the block length accordingly.
Patchwork: https://patchwork.freedesktop.org/patch/542177/
--- drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c +1 -1
@@ -1203,7 +1203,7 @@ static struct dpu_pingpong_cfg qcm2290_pp[] = {#define MERGE_3D_BLK (_name, _id, _base) \ {\ .name = _name, .id = _id, \ - .base = _base, .len = 0x100, \ + .base = _base, .len = 0x8, \ .features = MERGE_3D_SM8150_MASK, \ .sblk = NULL \ }
Signature · 1 line
2.39.2