ARC: HSDK: wireup perf irq
Subsystems (10)
Sasha Levin
maintainerPATCH 1/43 ARC: HSDK: wireup perf irq
From: Vineet Gupta <[email protected]>
[ Upstream commit fe81d927b78c4f0557836661d32e41ebc957b024 ]
Newer version of HSDK aka HSDK-4xD (with dual issue HS48x4 CPU) wired up the perf interrupt, so enable that in DT.
This is OK for old HSDK where this irq is ignored because pct irq is not wired up in hardware.
--- arch/arc/boot/dts/hsdk.dts | 2 ++ 1 file changed, 2 insertions(+)
arch/arc/boot/dts/hsdk.dts +2 -0
@@ -88,6 +88,8 @@ idu_intc: idu-interrupt-controller { arcpct: pct { compatible = "snps,archs-pct"; + interrupt-parent = <&cpu_intc>; + interrupts = <20>; }; /* TIMER0 with interrupt for clockevent */
Signature · 7 lines
2.25.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Sasha Levin
maintainerPATCH 2/43 dmaengine: acpi: Put the CSRT table after using it
From: Hanjun Guo <[email protected]>
[ Upstream commit 7eb48dd094de5fe0e216b550e73aa85257903973 ]
The acpi_get_table() should be coupled with acpi_put_table() if the mapped table is not used at runtime to release the table mapping, put the CSRT table buf after using it.
--- drivers/dma/acpi-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/dma/acpi-dma.c +3 -1
@@ -135,11 +135,13 @@ static void acpi_dma_parse_csrt(struct acpi_device *adev, struct acpi_dma *adma)if (ret <0 ) {dev_warn (&adev->dev,"error in parsing resource group\n" ); -return ; +break ; } grp = (struct acpi_csrt_group *)((void *)grp + grp->length); } + +acpi_put_table ((struct acpi_table_header *)csrt); }/**
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 3/43 netfilter: conntrack: allow sctp hearbeat after connection re-use
In reply to Sasha LevinFrom: Florian Westphal <[email protected]>
[ Upstream commit cc5453a5b7e90c39f713091a7ebc53c1f87d1700 ]
If an sctp connection gets re-used, heartbeats are flagged as invalid because their vtag doesn't match.
Handle this in a similar way as TCP conntrack when it suspects that the endpoints and conntrack are out-of-sync.
When a HEARTBEAT request fails its vtag validation, flag this in the conntrack state and accept the packet.
When a HEARTBEAT_ACK is received with an invalid vtag in the reverse direction after we allowed such a HEARTBEAT through, assume we are out-of-sync and re-set the vtag info.
v2: remove left-over snippet from an older incarnation that moved
new_state/old_state assignments, thats not needed so keep that as-is.
--- include/linux/netfilter/nf_conntrack_sctp.h | 2 ++ net/netfilter/nf_conntrack_proto_sctp.c | 39 ++++++++++++++++++--- 2 files changed, 37 insertions(+), 4 deletions(-)
include/linux/netfilter/nf_conntrack_sctp.h +2 -0
@@ -9,6 +9,8 @@ struct ip_ct_sctp {enum sctp_conntrack state;__be32 vtag[IP_CT_DIR_MAX ]; +u8 last_dir; + u8 flags; };#endif /* _NF_CONNTRACK_SCTP_H */
net/netfilter/nf_conntrack_proto_sctp.c +35 -4
@@ -62,6 +62,8 @@ static const unsigned int sctp_timeouts[SCTP_CONNTRACK_MAX] = { [SCTP_CONNTRACK_HEARTBEAT_ACKED] = 210 SECS, }; +#define SCTP_FLAG_HEARTBEAT_VTAG_FAILED 1 +#define sNO SCTP_CONNTRACK_NONE#define sCL SCTP_CONNTRACK_CLOSED#define sCW SCTP_CONNTRACK_COOKIE_WAIT
@@ -369,6 +371,7 @@ int nf_conntrack_sctp_packet(struct nf_conn *ct,u_int32_t offset, count;unsigned int *timeouts;unsigned long map[256 /sizeof (unsigned long )] = {0 }; +bool ignore = false;if (sctp_error (skb, dataoff, state))return -NF_ACCEPT ;
@@ -427,15 +430,39 @@ int nf_conntrack_sctp_packet(struct nf_conn *ct,/* Sec 8.5.1 (D) */ if (sh->vtag != ct->proto.sctp.vtag[dir]) goto out_unlock; - }else if (sch->type ==SCTP_CID_HEARTBEAT || - sch->type ==SCTP_CID_HEARTBEAT_ACK ) { + }else if (sch->type ==SCTP_CID_HEARTBEAT ) { +if (ct->proto.sctp.vtag[dir] ==0 ) { +pr_debug ("Setting %d vtag %x for dir %d\n" , sch->type, sh->vtag, dir); + ct->proto.sctp.vtag[dir] = sh->vtag; + }else if (sh->vtag != ct->proto.sctp.vtag[dir]) { +if (test_bit (SCTP_CID_DATA , map) || ignore) + goto out_unlock; + + ct->proto.sctp.flags |=SCTP_FLAG_HEARTBEAT_VTAG_FAILED ; + ct->proto.sctp.last_dir = dir; + ignore = true; +continue ; + }else if (ct->proto.sctp.flags &SCTP_FLAG_HEARTBEAT_VTAG_FAILED ) { + ct->proto.sctp.flags &= ~SCTP_FLAG_HEARTBEAT_VTAG_FAILED ; + } + }else if (sch->type ==SCTP_CID_HEARTBEAT_ACK ) {if (ct->proto.sctp.vtag[dir] ==0 ) {pr_debug ("Setting vtag %x for dir %d\n" , sh->vtag, dir); ct->proto.sctp.vtag[dir] = sh->vtag; }else if (sh->vtag != ct->proto.sctp.vtag[dir]) { -pr_debug ("Verification tag check failed\n" ); - goto out_unlock; +if (test_bit (SCTP_CID_DATA , map) || ignore) + goto out_unlock; + +if ((ct->proto.sctp.flags &SCTP_FLAG_HEARTBEAT_VTAG_FAILED ) ==0 || + ct->proto.sctp.last_dir == dir) + goto out_unlock; + + ct->proto.sctp.flags &= ~SCTP_FLAG_HEARTBEAT_VTAG_FAILED ; + ct->proto.sctp.vtag[dir] = sh->vtag; + ct->proto.sctp.vtag[!dir] =0 ; + }else if (ct->proto.sctp.flags &SCTP_FLAG_HEARTBEAT_VTAG_FAILED ) { + ct->proto.sctp.flags &= ~SCTP_FLAG_HEARTBEAT_VTAG_FAILED ; } }
@@ -470,6 +497,10 @@ int nf_conntrack_sctp_packet(struct nf_conn *ct, }spin_unlock_bh (&ct->lock); +/* allow but do not refresh timeout */ +if (ignore) +return NF_ACCEPT ; + timeouts =nf_ct_timeout_lookup (ct);if (!timeouts) timeouts =nf_sctp_pernet (nf_ct_net (ct))->timeouts;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 11/43 ibmvnic fix NULL tx_pools and rx_tools issue at do_reset
In reply to Sasha LevinFrom: Mingming Cao <[email protected]>
[ Upstream commit 9f13457377907fa253aef560e1a37e1ca4197f9b ]
At the time of do_rest, ibmvnic tries to re-initalize the tx_pools and rx_pools to avoid re-allocating the long term buffer. However there is a window inside do_reset that the tx_pools and rx_pools were freed before re-initialized making it possible to deference null pointers.
This patch fix this issue by always check the tx_pool
and rx_pool are not NULL after ibmvnic_login. If so, re-allocating the pools. This will avoid getting into calling reset_tx/rx_pools with NULL adapter tx_pools/rx_pools pointer. Also add null pointer check in reset_tx_pools and reset_rx_pools to safe handle NULL pointer case.
--- drivers/net/ethernet/ibm/ibmvnic.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-)
drivers/net/ethernet/ibm/ibmvnic.c +14 -1
@@ -416,6 +416,9 @@ static int reset_rx_pools(struct ibmvnic_adapter *adapter)int i, j, rc;u64 *size_array; +if (!adapter->rx_pool) +return -1 ; + size_array = (u64 *)((u8 *)(adapter->login_rsp_buf) +be32_to_cpu (adapter->login_rsp_buf->off_rxadd_buff_size));
@@ -586,6 +589,9 @@ static int reset_tx_pools(struct ibmvnic_adapter *adapter)int tx_scrqs;int i, rc; +if (!adapter->tx_pool) +return -1 ; + tx_scrqs =be32_to_cpu (adapter->login_rsp_buf->num_txsubm_subcrqs);for (i =0 ; i < tx_scrqs; i++) { rc =reset_one_tx_pool (adapter, &adapter->tso_pool[i]);
@@ -1918,7 +1924,10 @@ static int do_reset(struct ibmvnic_adapter *adapter, adapter->req_rx_add_entries_per_subcrq != old_num_rx_slots || adapter->req_tx_entries_per_subcrq != - old_num_tx_slots) { + old_num_tx_slots || + !adapter->rx_pool || + !adapter->tso_pool || + !adapter->tx_pool) {release_rx_pools (adapter);release_tx_pools (adapter);release_napi (adapter);
@@ -1931,10 +1940,14 @@ static int do_reset(struct ibmvnic_adapter *adapter, }else { rc =reset_tx_pools (adapter);if (rc) +netdev_dbg (adapter->netdev,"reset tx pools failed (%d)\n" , + rc); goto out; rc =reset_rx_pools (adapter);if (rc) +netdev_dbg (adapter->netdev,"reset rx pools failed (%d)\n" , + rc); goto out; }ibmvnic_disable_irqs (adapter);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 13/43 xfs: fix off-by-one in inode alloc block reservation calculation
In reply to Sasha LevinFrom: Brian Foster <[email protected]>
[ Upstream commit 657f101930bc6c5b41bd7d6c22565c4302a80d33 ]
The inode chunk allocation transaction reserves inobt_maxlevels-1 blocks to accommodate a full split of the inode btree. A full split requires an allocation for every existing level and a new root block, which means inobt_maxlevels is the worst case block requirement for a transaction that inserts to the inobt. This can lead to a transaction block reservation overrun when tmpfile creation allocates an inode chunk and expands the inobt to its maximum depth. This problem has been observed in conjunction with overlayfs, which makes frequent use of tmpfiles internally.
The existing reservation code goes back as far as the Linux git repo history (v2.6.12). It was likely never observed as a problem because the traditional file/directory creation transactions also include worst case block reservation for directory modifications, which most likely is able to make up for a single block deficiency in the inode allocation portion of the calculation. tmpfile support is relatively more recent (v3.15), less heavily used, and only includes the inode allocation block reservation as tmpfiles aren't linked into the directory tree on creation.
Fix up the inode alloc block reservation macro and a couple of the block allocator minleft parameters that enforce an allocation to leave enough free blocks in the AG for a full inobt split.
--- fs/xfs/libxfs/xfs_ialloc.c | 4 ++-- fs/xfs/libxfs/xfs_trans_space.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-)
fs/xfs/libxfs/xfs_ialloc.c +2 -2
@@ -679,7 +679,7 @@ xfs_ialloc_ag_alloc( args.minalignslop = igeo->cluster_align -1 ;/* Allow space for the inode btree to split. */ - args.minleft = igeo->inobt_maxlevels -1 ; + args.minleft = igeo->inobt_maxlevels;if ((error =xfs_alloc_vextent (&args)))return error;
@@ -727,7 +727,7 @@ xfs_ialloc_ag_alloc(/* * Allow space for the inode btree to split. */ - args.minleft = igeo->inobt_maxlevels -1 ; + args.minleft = igeo->inobt_maxlevels;if ((error =xfs_alloc_vextent (&args)))return error; }
fs/xfs/libxfs/xfs_trans_space.h +1 -1
@@ -58,7 +58,7 @@#define XFS_IALLOC_SPACE_RES (mp) \ (M_IGEO(mp)->ialloc_blks + \ ((xfs_sb_version_hasfinobt(&mp->m_sb) ? 2 : 1) * \ - (M_IGEO(mp)->inobt_maxlevels - 1))) + M_IGEO(mp)->inobt_maxlevels))/* * Space reservation values for various transactions.
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 20/43 nvmet-tcp: Fix NULL dereference when a connect data comes in h2cdata pdu
In reply to Sasha LevinFrom: Ziye Yang <[email protected]>
[ Upstream commit a6ce7d7b4adaebc27ee7e78e5ecc378a1cfc221d ]
When handling commands without in-capsule data, we assign the ttag assuming we already have the queue commands array allocated (based on the queue size information in the connect data payload). However if the connect itself did not send the connect data in-capsule we have yet to allocate the queue commands,and we will assign a bogus ttag and suffer a NULL dereference when we receive the corresponding h2cdata pdu.
Fix this by checking if we already allocated commands before dereferencing it when handling h2cdata, if we didn't, its for sure a connect and we should use the preallocated connect command.
--- drivers/nvme/target/tcp.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-)
drivers/nvme/target/tcp.c +9 -1
@@ -150,6 +150,11 @@ static void nvmet_tcp_finish_cmd(struct nvmet_tcp_cmd *cmd);static inline u16 nvmet_tcp_cmd_tag (struct nvmet_tcp_queue *queue,struct nvmet_tcp_cmd *cmd) { +if (unlikely (!queue->nr_cmds)) { +/* We didn't allocate cmds yet, send 0xffff */ +return USHRT_MAX ; + } +return cmd - queue->cmds; }
@@ -847,7 +852,10 @@ static int nvmet_tcp_handle_h2c_data_pdu(struct nvmet_tcp_queue *queue)struct nvme_tcp_data_pdu *data = &queue->pdu.data;struct nvmet_tcp_cmd *cmd; - cmd = &queue->cmds[data->ttag]; +if (likely (queue->nr_cmds)) + cmd = &queue->cmds[data->ttag]; +else + cmd = &queue->connect;if (le32_to_cpu (data->data_offset) != cmd->rbytes_done) { pr_err("ttag %u unexpected data offset %u (expected %u)\n",
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 19/43 irqchip/eznps: Fix build error for !ARC700 builds
In reply to Sasha LevinFrom: Vineet Gupta <[email protected]>
[ Upstream commit 89d29997f103d08264b0685796b420d911658b96 ]
eznps driver is supposed to be platform independent however it ends up including stuff from inside arch/arc headers leading to rand config build errors.
The quick hack to fix this (proper fix is too much chrun for non active user-base) is to add following to nps platform agnostic header.
- copy AUX_IENABLE from arch/arc header
- move CTOP_AUX_IACK from arch/arc/plat-eznps/*/**
--- arch/arc/plat-eznps/include/plat/ctop.h | 1 - include/soc/nps/common.h | 6 ++++++ 2 files changed, 6 insertions(+), 1 deletion(-)
arch/arc/plat-eznps/include/plat/ctop.h +0 -1
@@ -33,7 +33,6 @@#define CTOP_AUX_DPC (CTOP_AUX_BASE + 0x02C)#define CTOP_AUX_LPC (CTOP_AUX_BASE + 0x030)#define CTOP_AUX_EFLAGS (CTOP_AUX_BASE + 0x080) -#define CTOP_AUX_IACK (CTOP_AUX_BASE + 0x088)#define CTOP_AUX_GPA1 (CTOP_AUX_BASE + 0x08C)#define CTOP_AUX_UDMC (CTOP_AUX_BASE + 0x300)
include/soc/nps/common.h +6 -0
@@ -45,6 +45,12 @@#define CTOP_INST_MOV2B_FLIP_R3_B1_B2_INST 0x5B60#define CTOP_INST_MOV2B_FLIP_R3_B1_B2_LIMM 0x00010422 +#ifndef AUX_IENABLE +#define AUX_IENABLE 0x40c +#endif + +#define CTOP_AUX_IACK (0xFFFFF800 + 0x088) +#ifndef __ASSEMBLY__/* In order to increase compilation test coverage */
Signature · 7 lines
2.25.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Sasha Levin
maintainerPATCH 41/43 drm/amdgpu: Fix bug in reporting voltage for CIK
In reply to Sasha LevinFrom: Sandeep Raghuraman <[email protected]>
[ Upstream commit d98299885c9ea140c1108545186593deba36c4ac ]
On my R9 390, the voltage was reported as a constant 1000 mV. This was due to a bug in smu7_hwmgr.c, in the smu7_read_sensor() function, where some magic constants were used in a condition, to determine whether the voltage should be read from PLANE2_VID or PLANE1_VID. The VDDC mask was incorrectly used, instead of the VDDGFX mask.
This patch changes the code to use the correct defined constants (and apply the correct bitshift), thus resulting in correct voltage reporting.
--- drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +2 -1
@@ -3575,7 +3575,8 @@ static int smu7_read_sensor(struct pp_hwmgr *hwmgr, int idx,case AMDGPU_PP_SENSOR_GPU_POWER :return smu7_get_gpu_power (hwmgr, (uint32_t *)value);case AMDGPU_PP_SENSOR_VDDGFX : -if ((data->vr_config &0xff ) ==0x2 ) +if ((data->vr_config &VRCONF_VDDGFX_MASK ) == + (VR_SVI2_PLANE_2 <<VRCONF_VDDGFX_SHIFT )) val_vid =PHM_READ_INDIRECT_FIELD (hwmgr->device,CGS_IND_REG__SMC ,PWR_SVI2_STATUS ,PLANE2_VID );else
Signature · 6 lines
2.25.1 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Sasha Levin
maintainerPATCH 42/43 iommu/amd: Do not use IOMMUv2 functionality when SME is active
In reply to Sasha LevinFrom: Joerg Roedel <[email protected]>
[ Upstream commit 2822e582501b65707089b097e773e6fd70774841 ]
When memory encryption is active the device is likely not in a direct mapped domain. Forbid using IOMMUv2 functionality for now until finer grained checks for this have been implemented.
--- drivers/iommu/amd_iommu_v2.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/iommu/amd_iommu_v2.c +7 -0
@@ -741,6 +741,13 @@ int amd_iommu_init_device(struct pci_dev *pdev, int pasids)might_sleep (); +/* +* When memory encryption is active the device is likely not in a +* direct-mapped domain. Forbid using IOMMUv2 functionality for now. +*/ +if (mem_encrypt_active ()) +return -ENODEV ; +if (!amd_iommu_v2_supported ())return -ENODEV ;
Signature · 6 lines
2.25.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 12/43 net: hns3: Fix for geneve tx checksum bug
In reply to Sasha LevinFrom: Yi Li <[email protected]>
[ Upstream commit a156998fc92d3859c8e820f1583f6d0541d643c3 ]
when skb->encapsulation is 0, skb->ip_summed is CHECKSUM_PARTIAL and it is udp packet, which has a dest port as the IANA assigned. the hardware is expected to do the checksum offload, but the hardware will not do the checksum offload when udp dest port is 6081.
This patch fixes it by doing the checksum in software.
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +4 -2
@@ -21,6 +21,7 @@#include <net/pkt_cls.h> #include <net/tcp.h> #include <net/vxlan.h> +#include <net/geneve.h> #include "hnae3.h" #include "hns3_enet.h"
@@ -795,7 +796,7 @@ static int hns3_get_l4_protocol(struct sk_buff *skb, u8 *ol4_proto,* and it is udp packet, which has a dest port as the IANA assigned. * the hardware is expected to do the checksum offload, but the * hardware will not do the checksum offload when udp dest port is -* 4789. +* 4789 or 6081. */ static bool hns3_tunnel_csum_bug (struct sk_buff *skb) {
@@ -804,7 +805,8 @@ static bool hns3_tunnel_csum_bug(struct sk_buff *skb) l4.hdr =skb_transport_header (skb);if (!(!skb->encapsulation && - l4.udp->dest ==htons (IANA_VXLAN_UDP_PORT ))) + (l4.udp->dest ==htons (IANA_VXLAN_UDP_PORT ) || + l4.udp->dest ==htons (GENEVE_UDP_PORT ))))return false;skb_checksum_help (skb);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 33/43 HID: elan: Fix memleak in elan_input_configured
In reply to Sasha LevinFrom: Dinghao Liu <[email protected]>
[ Upstream commit b7429ea53d6c0936a0f10a5d64164f0aea440143 ]
When input_mt_init_slots() fails, input should be freed to prevent memleak. When input_register_device() fails, we should call input_mt_destroy_slots() to free memory allocated by input_mt_init_slots().
--- drivers/hid/hid-elan.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/hid/hid-elan.c +2 -0
@@ -188,6 +188,7 @@ static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi) ret =input_mt_init_slots (input,ELAN_MAX_FINGERS ,INPUT_MT_POINTER );if (ret) {hid_err (hdev,"Failed to init elan MT slots: %d\n" , ret); +input_free_device (input);return ret; }
@@ -198,6 +199,7 @@ static int elan_input_configured(struct hid_device *hdev, struct hid_input *hi)if (ret) {hid_err (hdev,"Failed to register elan input device: %d\n" , ret); +input_mt_destroy_slots (input);input_free_device (input);return ret; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 32/43 drivers/net/wan/hdlc_cisco: Add hard_header_len
In reply to Sasha LevinFrom: Xie He <[email protected]>
[ Upstream commit 1a545ebe380bf4c1433e3c136e35a77764fda5ad ]
This driver didn't set hard_header_len. This patch sets hard_header_len for it according to its header_ops->create function.
This driver's header_ops->create function (cisco_hard_header) creates a header of (struct hdlc_header), so hard_header_len should be set to sizeof(struct hdlc_header).
--- drivers/net/wan/hdlc_cisco.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wan/hdlc_cisco.c +1 -0
@@ -370,6 +370,7 @@ static int cisco_ioctl(struct net_device *dev, struct ifreq *ifr)memcpy (&state (hdlc)->settings, &new_settings, size);spin_lock_init (&state (hdlc)->lock); dev->header_ops = &cisco_header_ops; + dev->hard_header_len =sizeof (struct hdlc_header ); dev->type =ARPHRD_CISCO ;call_netdevice_notifiers (NETDEV_POST_TYPE_CHANGE , dev);netif_dormant_on (dev);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 21/43 nvme-fabrics: don't check state NVME_CTRL_NEW for request acceptance
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit d7144f5c4cf4de95fdc3422943cf51c06aeaf7a7 ]
NVME_CTRL_NEW should never see any I/O, because in order to start initialization it has to transition to NVME_CTRL_CONNECTING and from there it will never return to this state.
--- drivers/nvme/host/fabrics.c | 1 - 1 file changed, 1 deletion(-)
drivers/nvme/host/fabrics.c +0 -1
@@ -576,7 +576,6 @@ bool __nvmf_check_ready(struct nvme_ctrl *ctrl, struct request *rq,* which is require to set the queue live in the appropinquate states. */ switch (ctrl->state) { -case NVME_CTRL_NEW :case NVME_CTRL_CONNECTING :if (nvme_is_fabrics (req->cmd) && req->cmd->fabrics.fctype == nvme_fabrics_type_connect)
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 23/43 nvme-tcp: serialize controller teardown sequences
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit d4d61470ae48838f49e668503e840e1520b97162 ]
In the timeout handler we may need to complete a request because the request that timed out may be an I/O that is a part of a serial sequence of controller teardown or initialization. In order to complete the request, we need to fence any other context that may compete with us and complete the request that is timing out.
In this case, we could have a potential double completion in case a hard-irq or a different competing context triggered error recovery and is running inflight request cancellation concurrently with the timeout handler.
Protect using a ctrl teardown_lock to serialize contexts that may complete a cancelled request due to error recovery or a reset.
--- drivers/nvme/host/tcp.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/nvme/host/tcp.c +9 -2
@@ -110,6 +110,7 @@ struct nvme_tcp_ctrl {struct sockaddr_storage src_addr;struct nvme_ctrl ctrl; +struct mutex teardown_lock;struct work_struct err_work;struct delayed_work connect_work;struct nvme_tcp_request async_req;
@@ -1438,7 +1439,6 @@ static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid)if (!test_and_clear_bit (NVME_TCP_Q_LIVE , &queue->flags))return ; -__nvme_tcp_stop_queue (queue); }
@@ -1785,6 +1785,7 @@ static int nvme_tcp_configure_admin_queue(struct nvme_ctrl *ctrl, bool new)static void nvme_tcp_teardown_admin_queue (struct nvme_ctrl *ctrl,bool remove) { +mutex_lock (&to_tcp_ctrl (ctrl)->teardown_lock);blk_mq_quiesce_queue (ctrl->admin_q);nvme_tcp_stop_queue (ctrl,0 );if (ctrl->admin_tagset) {
@@ -1795,13 +1796,16 @@ static void nvme_tcp_teardown_admin_queue(struct nvme_ctrl *ctrl,if (remove)blk_mq_unquiesce_queue (ctrl->admin_q);nvme_tcp_destroy_admin_queue (ctrl, remove); +mutex_unlock (&to_tcp_ctrl (ctrl)->teardown_lock); }static void nvme_tcp_teardown_io_queues (struct nvme_ctrl *ctrl,bool remove) { +mutex_lock (&to_tcp_ctrl (ctrl)->teardown_lock);if (ctrl->queue_count <=1 ) -return ; + goto out; +blk_mq_quiesce_queue (ctrl->admin_q);nvme_start_freeze (ctrl);nvme_stop_queues (ctrl);nvme_tcp_stop_io_queues (ctrl);
@@ -1813,6 +1817,8 @@ static void nvme_tcp_teardown_io_queues(struct nvme_ctrl *ctrl,if (remove)nvme_start_queues (ctrl);nvme_tcp_destroy_io_queues (ctrl, remove); +out: +mutex_unlock (&to_tcp_ctrl (ctrl)->teardown_lock); }static void nvme_tcp_reconnect_or_remove (struct nvme_ctrl *ctrl)
@@ -2311,6 +2317,7 @@ static struct nvme_ctrl *nvme_tcp_create_ctrl(struct device *dev, nvme_tcp_reconnect_ctrl_work);INIT_WORK (&ctrl->err_work, nvme_tcp_error_recovery_work);INIT_WORK (&ctrl->ctrl.reset_work, nvme_reset_ctrl_work); +mutex_init (&ctrl->teardown_lock);if (!(opts->mask &NVMF_OPT_TRSVCID )) { opts->trsvcid =
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 25/43 nvme-tcp: fix reset hang if controller died in the middle of a reset
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit e5c01f4f7f623e768e868bcc08d8e7ceb03b75d0 ]
If the controller becomes unresponsive in the middle of a reset, we will hang because we are waiting for the freeze to complete, but that cannot happen since we have commands that are inflight holding the q_usage_counter, and we can't blindly fail requests that times out.
So give a timeout and if we cannot wait for queue freeze before unfreezing, fail and have the error handling take care how to proceed (either schedule a reconnect of remove the controller).
--- drivers/nvme/host/tcp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/nvme/host/tcp.c +12 -1
@@ -1693,7 +1693,15 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)if (!new) {nvme_start_queues (ctrl); -nvme_wait_freeze (ctrl); +if (!nvme_wait_freeze_timeout (ctrl,NVME_IO_TIMEOUT )) { +/* +* If we timed out waiting for freeze we are likely to +* be stuck. Fail the controller initialization just +* to be safe. +*/ + ret = -ENODEV ; + goto out_wait_freeze_timed_out; + }blk_mq_update_nr_hw_queues (ctrl->tagset, ctrl->queue_count -1 );nvme_unfreeze (ctrl);
@@ -1701,6 +1709,9 @@ static int nvme_tcp_configure_io_queues(struct nvme_ctrl *ctrl, bool new)return 0 ; +out_wait_freeze_timed_out: +nvme_stop_queues (ctrl); +nvme_tcp_stop_io_queues (ctrl); out_cleanup_connect_q:if (new)blk_cleanup_queue (ctrl->connect_q);
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 24/43 nvme-tcp: fix timeout handler
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit 236187c4ed195161dfa4237c7beffbba0c5ae45b ]
When a request times out in a LIVE state, we simply trigger error recovery and let the error recovery handle the request cancellation, however when a request times out in a non LIVE state, we make sure to complete it immediately as it might block controller setup or teardown and prevent forward progress.
However tearing down the entire set of I/O and admin queues causes freeze/unfreeze imbalance (q->mq_freeze_depth) because and is really an overkill to what we actually need, which is to just fence controller teardown that may be running, stop the queue, and cancel the request if it is not already completed.
Now that we have the controller teardown_lock, we can safely serialize request cancellation. This addresses a hang caused by calling extra queue freeze on controller namespaces, causing unfreeze to not complete correctly.
--- drivers/nvme/host/tcp.c | 56 ++++++++++++++++++++++++++--------------- 1 file changed, 36 insertions(+), 20 deletions(-)
drivers/nvme/host/tcp.c +36 -20
@@ -421,6 +421,7 @@ static void nvme_tcp_error_recovery(struct nvme_ctrl *ctrl)if (!nvme_change_ctrl_state (ctrl,NVME_CTRL_RESETTING ))return ; +dev_warn (ctrl->device,"starting error recovery\n" );queue_work (nvme_reset_wq, &to_tcp_ctrl (ctrl)->err_work); }
@@ -2057,40 +2058,55 @@ static void nvme_tcp_submit_async_event(struct nvme_ctrl *arg)nvme_tcp_queue_request (&ctrl->async_req); } +static void nvme_tcp_complete_timed_out (struct request *rq) +{ +struct nvme_tcp_request *req =blk_mq_rq_to_pdu (rq); +struct nvme_ctrl *ctrl = &req->queue->ctrl->ctrl; + +/* fence other contexts that may complete the command */ +mutex_lock (&to_tcp_ctrl (ctrl)->teardown_lock); +nvme_tcp_stop_queue (ctrl,nvme_tcp_queue_id (req->queue)); +if (!blk_mq_request_completed (rq)) { +nvme_req (rq)->status =NVME_SC_HOST_ABORTED_CMD ; +blk_mq_complete_request (rq); + } +mutex_unlock (&to_tcp_ctrl (ctrl)->teardown_lock); +} +static enum blk_eh_timer_return nvme_tcp_timeout (struct request *rq,bool reserved) {struct nvme_tcp_request *req =blk_mq_rq_to_pdu (rq); -struct nvme_tcp_ctrl *ctrl = req->queue->ctrl; +struct nvme_ctrl *ctrl = &req->queue->ctrl->ctrl;struct nvme_tcp_cmd_pdu *pdu = req->pdu; -/* -* Restart the timer if a controller reset is already scheduled. Any -* timed out commands would be handled before entering the connecting -* state. -*/ -if (ctrl->ctrl.state ==NVME_CTRL_RESETTING ) -return BLK_EH_RESET_TIMER ; - -dev_warn (ctrl->ctrl.device, +dev_warn (ctrl->device,"queue %d: timeout request %#x type %d\n" ,nvme_tcp_queue_id (req->queue), rq->tag, pdu->hdr.type); -if (ctrl->ctrl.state !=NVME_CTRL_LIVE ) { +if (ctrl->state !=NVME_CTRL_LIVE ) {/* -* Teardown immediately if controller times out while starting -* or we are already started error recovery. all outstanding -* requests are completed on shutdown, so we return BLK_EH_DONE. +* If we are resetting, connecting or deleting we should +* complete immediately because we may block controller +* teardown or setup sequence +* - ctrl disable/shutdown fabrics requests +* - connect requests +* - initialization admin requests +* - I/O requests that entered after unquiescing and +* the controller stopped responding +* +* All other requests should be cancelled by the error +* recovery work, so it's fine that we fail it here. */ -flush_work (&ctrl->err_work); -nvme_tcp_teardown_io_queues (&ctrl->ctrl, false); -nvme_tcp_teardown_admin_queue (&ctrl->ctrl, false); +nvme_tcp_complete_timed_out (rq);return BLK_EH_DONE ; } -dev_warn (ctrl->ctrl.device,"starting error recovery\n" ); -nvme_tcp_error_recovery (&ctrl->ctrl); - +/* +* LIVE state should trigger the normal error recovery which will +* handle completing this request. +*/ +nvme_tcp_error_recovery (ctrl);return BLK_EH_RESET_TIMER ; }
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 26/43 nvme-rdma: serialize controller teardown sequences
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit 5110f40241d08334375eb0495f174b1d2c07657e ]
In the timeout handler we may need to complete a request because the request that timed out may be an I/O that is a part of a serial sequence of controller teardown or initialization. In order to complete the request, we need to fence any other context that may compete with us and complete the request that is timing out.
In this case, we could have a potential double completion in case a hard-irq or a different competing context triggered error recovery and is running inflight request cancellation concurrently with the timeout handler.
Protect using a ctrl teardown_lock to serialize contexts that may complete a cancelled request due to error recovery or a reset.
--- drivers/nvme/host/rdma.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/nvme/host/rdma.c +6 -0
@@ -110,6 +110,7 @@ struct nvme_rdma_ctrl {struct sockaddr_storage src_addr;struct nvme_ctrl ctrl; +struct mutex teardown_lock;bool use_inline_data;u32 io_queues[HCTX_MAX_TYPES ]; };
@@ -920,6 +921,7 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new)static void nvme_rdma_teardown_admin_queue (struct nvme_rdma_ctrl *ctrl,bool remove) { +mutex_lock (&ctrl->teardown_lock);blk_mq_quiesce_queue (ctrl->ctrl.admin_q);nvme_rdma_stop_queue (&ctrl->queues[0 ]);if (ctrl->ctrl.admin_tagset) {
@@ -930,11 +932,13 @@ static void nvme_rdma_teardown_admin_queue(struct nvme_rdma_ctrl *ctrl,if (remove)blk_mq_unquiesce_queue (ctrl->ctrl.admin_q);nvme_rdma_destroy_admin_queue (ctrl, remove); +mutex_unlock (&ctrl->teardown_lock); }static void nvme_rdma_teardown_io_queues (struct nvme_rdma_ctrl *ctrl,bool remove) { +mutex_lock (&ctrl->teardown_lock);if (ctrl->ctrl.queue_count >1 ) {nvme_start_freeze (&ctrl->ctrl);nvme_stop_queues (&ctrl->ctrl);
@@ -948,6 +952,7 @@ static void nvme_rdma_teardown_io_queues(struct nvme_rdma_ctrl *ctrl,nvme_start_queues (&ctrl->ctrl);nvme_rdma_destroy_io_queues (ctrl, remove); } +mutex_unlock (&ctrl->teardown_lock); }static void nvme_rdma_free_ctrl (struct nvme_ctrl *nctrl)
@@ -1988,6 +1993,7 @@ static struct nvme_ctrl *nvme_rdma_create_ctrl(struct device *dev,return ERR_PTR (-ENOMEM ); ctrl->ctrl.opts = opts;INIT_LIST_HEAD (&ctrl->list); +mutex_init (&ctrl->teardown_lock);if (!(opts->mask &NVMF_OPT_TRSVCID )) { opts->trsvcid =
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 27/43 nvme-rdma: fix timeout handler
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit 0475a8dcbcee92a5d22e40c9c6353829fc6294b8 ]
When a request times out in a LIVE state, we simply trigger error recovery and let the error recovery handle the request cancellation, however when a request times out in a non LIVE state, we make sure to complete it immediately as it might block controller setup or teardown and prevent forward progress.
However tearing down the entire set of I/O and admin queues causes freeze/unfreeze imbalance (q->mq_freeze_depth) because and is really an overkill to what we actually need, which is to just fence controller teardown that may be running, stop the queue, and cancel the request if it is not already completed.
Now that we have the controller teardown_lock, we can safely serialize request cancellation. This addresses a hang caused by calling extra queue freeze on controller namespaces, causing unfreeze to not complete correctly.
--- drivers/nvme/host/rdma.c | 49 +++++++++++++++++++++++++++------------- 1 file changed, 33 insertions(+), 16 deletions(-)
drivers/nvme/host/rdma.c +33 -16
@@ -1101,6 +1101,7 @@ static void nvme_rdma_error_recovery(struct nvme_rdma_ctrl *ctrl)if (!nvme_change_ctrl_state (&ctrl->ctrl,NVME_CTRL_RESETTING ))return ; +dev_warn (ctrl->ctrl.device,"starting error recovery\n" );queue_work (nvme_reset_wq, &ctrl->err_work); }
@@ -1704,6 +1705,22 @@ static int nvme_rdma_cm_handler(struct rdma_cm_id *cm_id,return 0 ; } +static void nvme_rdma_complete_timed_out (struct request *rq) +{ +struct nvme_rdma_request *req =blk_mq_rq_to_pdu (rq); +struct nvme_rdma_queue *queue = req->queue; +struct nvme_rdma_ctrl *ctrl = queue->ctrl; + +/* fence other contexts that may complete the command */ +mutex_lock (&ctrl->teardown_lock); +nvme_rdma_stop_queue (queue); +if (!blk_mq_request_completed (rq)) { +nvme_req (rq)->status =NVME_SC_HOST_ABORTED_CMD ; +blk_mq_complete_request (rq); + } +mutex_unlock (&ctrl->teardown_lock); +} +static enum blk_eh_timer_return nvme_rdma_timeout (struct request *rq,bool reserved) {
@@ -1714,29 +1731,29 @@ nvme_rdma_timeout(struct request *rq, bool reserved)dev_warn (ctrl->ctrl.device,"I/O %d QID %d timeout\n" , rq->tag,nvme_rdma_queue_idx (queue)); -/* -* Restart the timer if a controller reset is already scheduled. Any -* timed out commands would be handled before entering the connecting -* state. -*/ -if (ctrl->ctrl.state ==NVME_CTRL_RESETTING ) -return BLK_EH_RESET_TIMER ; -if (ctrl->ctrl.state !=NVME_CTRL_LIVE ) {/* -* Teardown immediately if controller times out while starting -* or we are already started error recovery. all outstanding -* requests are completed on shutdown, so we return BLK_EH_DONE. +* If we are resetting, connecting or deleting we should +* complete immediately because we may block controller +* teardown or setup sequence +* - ctrl disable/shutdown fabrics requests +* - connect requests +* - initialization admin requests +* - I/O requests that entered after unquiescing and +* the controller stopped responding +* +* All other requests should be cancelled by the error +* recovery work, so it's fine that we fail it here. */ -flush_work (&ctrl->err_work); -nvme_rdma_teardown_io_queues (ctrl, false); -nvme_rdma_teardown_admin_queue (ctrl, false); +nvme_rdma_complete_timed_out (rq);return BLK_EH_DONE ; } -dev_warn (ctrl->ctrl.device,"starting error recovery\n" ); +/* +* LIVE state should trigger the normal error recovery which will +* handle completing this request. +*/ nvme_rdma_error_recovery (ctrl); -return BLK_EH_RESET_TIMER ; }
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 28/43 nvme-rdma: fix reset hang if controller died in the middle of a reset
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit 2362acb6785611eda795bfc12e1ea6b202ecf62c ]
If the controller becomes unresponsive in the middle of a reset, we will hang because we are waiting for the freeze to complete, but that cannot happen since we have commands that are inflight holding the q_usage_counter, and we can't blindly fail requests that times out.
So give a timeout and if we cannot wait for queue freeze before unfreezing, fail and have the error handling take care how to proceed (either schedule a reconnect of remove the controller).
--- drivers/nvme/host/rdma.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-)
drivers/nvme/host/rdma.c +12 -1
@@ -899,7 +899,15 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new)if (!new) {nvme_start_queues (&ctrl->ctrl); -nvme_wait_freeze (&ctrl->ctrl); +if (!nvme_wait_freeze_timeout (&ctrl->ctrl,NVME_IO_TIMEOUT )) { +/* +* If we timed out waiting for freeze we are likely to +* be stuck. Fail the controller initialization just +* to be safe. +*/ + ret = -ENODEV ; + goto out_wait_freeze_timed_out; + }blk_mq_update_nr_hw_queues (ctrl->ctrl.tagset, ctrl->ctrl.queue_count -1 );nvme_unfreeze (&ctrl->ctrl);
@@ -907,6 +915,9 @@ static int nvme_rdma_configure_io_queues(struct nvme_rdma_ctrl *ctrl, bool new)return 0 ; +out_wait_freeze_timed_out: +nvme_stop_queues (&ctrl->ctrl); +nvme_rdma_stop_io_queues (ctrl); out_cleanup_connect_q:if (new)blk_cleanup_queue (ctrl->ctrl.connect_q);
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 29/43 nvme-pci: cancel nvme device request before disabling
In reply to Sasha LevinFrom: Tong Zhang <[email protected]>
[ Upstream commit 7ad92f656bddff4cf8f641e0e3b1acd4eb9644cb ]
This patch addresses an irq free warning and null pointer dereference error problem when nvme devices got timeout error during initialization. This problem happens when nvme_timeout() function is called while nvme_reset_work() is still in execution. This patch fixed the problem by setting flag of the problematic request to NVME_REQ_CANCELLED before calling nvme_dev_disable() to make sure __nvme_submit_sync_cmd() returns an error code and let nvme_submit_sync_cmd() fail gracefully. The following is console output.
[ 62.472097] nvme nvme0: I/O 13 QID 0 timeout, disable controller [ 62.488796] nvme nvme0: could not set timestamp (881) [ 62.494888] ------------[ cut here ]------------ [ 62.495142] Trying to free already-free IRQ 11 [ 62.495366] WARNING: CPU: 0 PID: 7 at kernel/irq/manage.c:1751 free_irq+0x1f7/0x370 [ 62.495742] Modules linked in: [ 62.495902] CPU: 0 PID: 7 Comm: kworker/u4:0 Not tainted 5.8.0+ #8 [ 62.496206] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-48-gd9c812dda519-p4 [ 62.496772] Workqueue: nvme-reset-wq nvme_reset_work [ 62.497019] RIP: 0010:free_irq+0x1f7/0x370 [ 62.497223] Code: e8 ce 49 11 00 48 83 c4 08 4c 89 e0 5b 5d 41 5c 41 5d 41 5e 41 5f c3 44 89 f6 48 c70 [ 62.498133] RSP: 0000:ffffa96800043d40 EFLAGS: 00010086 [ 62.498391] RAX: 0000000000000000 RBX: ffff9b87fc458400 RCX: 0000000000000000 [ 62.498741] RDX: 0000000000000001 RSI: 0000000000000096 RDI: ffffffff9693d72c [ 62.499091] RBP: ffff9b87fd4c8f60 R08: ffffa96800043bfd R09: 0000000000000163 [ 62.499440] R10: ffffa96800043bf8 R11: ffffa96800043bfd R12: ffff9b87fd4c8e00 [ 62.499790] R13: ffff9b87fd4c8ea4 R14: 000000000000000b R15: ffff9b87fd76b000 [ 62.500140] FS: 0000000000000000(0000) GS:ffff9b87fdc00000(0000) knlGS:0000000000000000 [ 62.500534] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 62.500816] CR2: 0000000000000000 CR3: 000000003aa0a000 CR4: 00000000000006f0 [ 62.501165] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 62.501515] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 62.501864] Call Trace: [ 62.501993] pci_free_irq+0x13/0x20 [ 62.502167] nvme_reset_work+0x5d0/0x12a0 [ 62.502369] ? update_load_avg+0x59/0x580 [ 62.502569] ? ttwu_queue_wakelist+0xa8/0xc0 [ 62.502780] ? try_to_wake_up+0x1a2/0x450 [ 62.502979] process_one_work+0x1d2/0x390 [ 62.503179] worker_thread+0x45/0x3b0 [ 62.503361] ? process_one_work+0x390/0x390 [ 62.503568] kthread+0xf9/0x130 [ 62.503726] ? kthread_park+0x80/0x80 [ 62.503911] ret_from_fork+0x22/0x30 [ 62.504090] ---[ end trace de9ed4a70f8d71e2 ]--- [ 123.912275] nvme nvme0: I/O 12 QID 0 timeout, disable controller [ 123.914670] nvme nvme0: 1/0/0 default/read/poll queues [ 123.916310] BUG: kernel NULL pointer dereference, address: 0000000000000000 [ 123.917469] #PF: supervisor write access in kernel mode [ 123.917725] #PF: error_code(0x0002) - not-present page [ 123.917976] PGD 0 P4D 0 [ 123.918109] Oops: 0002 [#1] SMP PTI [ 123.918283] CPU: 0 PID: 7 Comm: kworker/u4:0 Tainted: G W 5.8.0+ #8 [ 123.918650] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.13.0-48-gd9c812dda519-p4 [ 123.919219] Workqueue: nvme-reset-wq nvme_reset_work [ 123.919469] RIP: 0010:__blk_mq_alloc_map_and_request+0x21/0x80 [ 123.919757] Code: 66 0f 1f 84 00 00 00 00 00 41 55 41 54 55 48 63 ee 53 48 8b 47 68 89 ee 48 89 fb 8b4 [ 123.920657] RSP: 0000:ffffa96800043d40 EFLAGS: 00010286 [ 123.920912] RAX: ffff9b87fc4fee40 RBX: ffff9b87fc8cb008 RCX: 0000000000000000 [ 123.921258] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9b87fc618000 [ 123.921602] RBP: 0000000000000000 R08: ffff9b87fdc2c4a0 R09: ffff9b87fc616000 [ 123.921949] R10: 0000000000000000 R11: ffff9b87fffd1500 R12: 0000000000000000 [ 123.922295] R13: 0000000000000000 R14: ffff9b87fc8cb200 R15: ffff9b87fc8cb000 [ 123.922641] FS: 0000000000000000(0000) GS:ffff9b87fdc00000(0000) knlGS:0000000000000000 [ 123.923032] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 123.923312] CR2: 0000000000000000 CR3: 000000003aa0a000 CR4: 00000000000006f0 [ 123.923660] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 123.924007] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [ 123.924353] Call Trace: [ 123.924479] blk_mq_alloc_tag_set+0x137/0x2a0 [ 123.924694] nvme_reset_work+0xed6/0x12a0 [ 123.924898] process_one_work+0x1d2/0x390 [ 123.925099] worker_thread+0x45/0x3b0 [ 123.925280] ? process_one_work+0x390/0x390 [ 123.925486] kthread+0xf9/0x130 [ 123.925642] ? kthread_park+0x80/0x80 [ 123.925825] ret_from_fork+0x22/0x30 [ 123.926004] Modules linked in: [ 123.926158] CR2: 0000000000000000 [ 123.926322] ---[ end trace de9ed4a70f8d71e3 ]--- [ 123.926549] RIP: 0010:__blk_mq_alloc_map_and_request+0x21/0x80 [ 123.926832] Code: 66 0f 1f 84 00 00 00 00 00 41 55 41 54 55 48 63 ee 53 48 8b 47 68 89 ee 48 89 fb 8b4 [ 123.927734] RSP: 0000:ffffa96800043d40 EFLAGS: 00010286 [ 123.927989] RAX: ffff9b87fc4fee40 RBX: ffff9b87fc8cb008 RCX: 0000000000000000 [ 123.928336] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9b87fc618000 [ 123.928679] RBP: 0000000000000000 R08: ffff9b87fdc2c4a0 R09: ffff9b87fc616000 [ 123.929025] R10: 0000000000000000 R11: ffff9b87fffd1500 R12: 0000000000000000 [ 123.929370] R13: 0000000000000000 R14: ffff9b87fc8cb200 R15: ffff9b87fc8cb000 [ 123.929715] FS: 0000000000000000(0000) GS:ffff9b87fdc00000(0000) knlGS:0000000000000000 [ 123.930106] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 123.930384] CR2: 0000000000000000 CR3: 000000003aa0a000 CR4: 00000000000006f0 [ 123.930731] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 123.931077] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
--- drivers/nvme/host/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/nvme/host/pci.c +2 -2
@@ -1274,8 +1274,8 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)dev_warn_ratelimited (dev->ctrl.device,"I/O %d QID %d timeout, disable controller\n" , req->tag, nvmeq->qid); -nvme_dev_disable (dev, true);nvme_req (req)->flags |=NVME_REQ_CANCELLED ; +nvme_dev_disable (dev, true);return BLK_EH_DONE ;case NVME_CTRL_RESETTING :return BLK_EH_RESET_TIMER ;
@@ -1292,10 +1292,10 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)dev_warn (dev->ctrl.device,"I/O %d QID %d timeout, reset controller\n" , req->tag, nvmeq->qid); +nvme_req (req)->flags |=NVME_REQ_CANCELLED ;nvme_dev_disable (dev, false);nvme_reset_ctrl (&dev->ctrl); -nvme_req (req)->flags |=NVME_REQ_CANCELLED ;return BLK_EH_DONE ; }
Signature · 7 lines
2.25.1 _______________________________________________ Linux-nvme mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-nvme
Sasha Levin
maintainerPATCH 5/43 drivers/net/wan/lapbether: Added needed_tailroom
In reply to Sasha LevinFrom: Xie He <[email protected]>
[ Upstream commit 1ee39c1448c4e0d480c5b390e2db1987561fb5c2 ]
The underlying Ethernet device may request necessary tailroom to be allocated by setting needed_tailroom. This driver should also set needed_tailroom to request the tailroom needed by the underlying Ethernet device to be allocated.
--- drivers/net/wan/lapbether.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/wan/lapbether.c +1 -0
@@ -340,6 +340,7 @@ static int lapbeth_new_device(struct net_device *dev)*/ ndev->needed_headroom =-1 +3 +2 + dev->hard_header_len + dev->needed_headroom; + ndev->needed_tailroom = dev->needed_tailroom; lapbeth =netdev_priv (ndev); lapbeth->axdev = ndev;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 34/43 ARC: [plat-hsdk]: Switch ethernet phy-mode to rgmii-id
In reply to Sasha LevinFrom: Evgeniy Didin <[email protected]>
[ Upstream commit 26907eb605fbc3ba9dbf888f21d9d8d04471271d ]
HSDK board has Micrel KSZ9031, recent commitbcf3440c6dd ("net: phy: micrel: add phy-mode support for the KSZ9031 PHY") caused a breakdown of Ethernet.
Using 'phy-mode = "rgmii"' is not correct because accodring RGMII specification it is necessary to have delay on RX (PHY to MAX) which is not generated in case of "rgmii".
Using "rgmii-id" adds necessary delay and solves the issue.
Also adding name of PHY placed on HSDK board.
--- arch/arc/boot/dts/hsdk.dts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arc/boot/dts/hsdk.dts +2 -2
@@ -210,7 +210,7 @@ gmac: ethernet@8000 { reg = <0x8000 0x2000>; interrupts = <10>; interrupt-names = "macirq"; - phy-mode = "rgmii"; + phy-mode = "rgmii-id"; snps,pbl = <32>; snps,multicast-filter-bins = <256>; clocks = <&gmacclk>;
@@ -228,7 +228,7 @@ mdio { #address-cells = <1>; #size-cells = <0>; compatible = "snps,dwmac-mdio"; - phy0: ethernet-phy@0 { + phy0: ethernet-phy@0 { /* Micrel KSZ9031 */ reg = <0>; }; };
Signature · 7 lines
2.25.1 _______________________________________________ linux-snps-arc mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-snps-arc
Sasha Levin
maintainerPATCH 8/43 ALSA: hda: Fix 2 channel swapping for Tegra
In reply to Sasha LevinFrom: Mohan Kumar <[email protected]>
[ Upstream commit 216116eae43963c662eb84729507bad95214ca6b ]
The Tegra HDA codec HW implementation has an issue related to not swapping the 2 channel Audio Sample Packet(ASP) channel mapping. Whatever the FL and FR mapping specified the left channel always comes out of left speaker and right channel on right speaker. So add condition to disallow the swapping of FL,FR during the playback.
--- sound/pci/hda/patch_hdmi.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/pci/hda/patch_hdmi.c +5 -0
@@ -3677,6 +3677,7 @@ static int tegra_hdmi_build_pcms(struct hda_codec *codec)static int patch_tegra_hdmi (struct hda_codec *codec) { +struct hdmi_spec *spec;int err; err =patch_generic_hdmi (codec);
@@ -3684,6 +3685,10 @@ static int patch_tegra_hdmi(struct hda_codec *codec)return err; codec->patch_ops.build_pcms = tegra_hdmi_build_pcms; + spec = codec->spec; + spec->chmap.ops.chmap_cea_alloc_validate_get_type = + nvhdmi_chmap_cea_alloc_validate_get_type; + spec->chmap.ops.chmap_validate = nvhdmi_chmap_validate;return 0 ; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 10/43 drivers/dma/dma-jz4780: Fix race condition between probe and irq handler
In reply to Sasha LevinFrom: Madhuparna Bhowmik <[email protected]>
[ Upstream commit 6d6018fc30bee67290dbed2fa51123f7c6f3d691 ]
In probe, IRQ is requested before zchan->id is initialized which can be read in the irq handler. Hence, shift request irq after other initializations complete.
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/dma/dma-jz4780.c | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-)
drivers/dma/dma-jz4780.c +19 -19
@@ -885,24 +885,11 @@ static int jz4780_dma_probe(struct platform_device *pdev)return -EINVAL ; } - ret =platform_get_irq (pdev,0 ); -if (ret <0 ) -return ret; - - jzdma->irq = ret; - - ret =request_irq (jzdma->irq, jz4780_dma_irq_handler,0 ,dev_name (dev), - jzdma); -if (ret) { -dev_err (dev,"failed to request IRQ %u!\n" , jzdma->irq); -return ret; - } - jzdma->clk =devm_clk_get (dev,NULL );if (IS_ERR (jzdma->clk)) {dev_err (dev,"failed to get clock\n" ); ret =PTR_ERR (jzdma->clk); - goto err_free_irq; +return ret; }clk_prepare_enable (jzdma->clk);
@@ -955,10 +942,23 @@ static int jz4780_dma_probe(struct platform_device *pdev) jzchan->vchan.desc_free = jz4780_dma_desc_free; } + ret =platform_get_irq (pdev,0 ); +if (ret <0 ) + goto err_disable_clk; + + jzdma->irq = ret; + + ret =request_irq (jzdma->irq, jz4780_dma_irq_handler,0 ,dev_name (dev), + jzdma); +if (ret) { +dev_err (dev,"failed to request IRQ %u!\n" , jzdma->irq); + goto err_disable_clk; + } + ret =dmaenginem_async_device_register (dd);if (ret) {dev_err (dev,"failed to register device\n" ); - goto err_disable_clk; + goto err_free_irq; }/* Register with OF DMA helpers. */
@@ -966,17 +966,17 @@ static int jz4780_dma_probe(struct platform_device *pdev) jzdma);if (ret) {dev_err (dev,"failed to register OF DMA controller\n" ); - goto err_disable_clk; + goto err_free_irq; }dev_info (dev,"JZ4780 DMA controller initialised\n" );return 0 ; -err_disable_clk: -clk_disable_unprepare (jzdma->clk); - err_free_irq:free_irq (jzdma->irq, jzdma); + +err_disable_clk: +clk_disable_unprepare (jzdma->clk);return ret; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 9/43 ALSA: hda/tegra: Program WAKEEN register for Tegra
In reply to Sasha LevinFrom: Mohan Kumar <[email protected]>
[ Upstream commit 23d63a31d9f44d7daeac0d1fb65c6a73c70e5216 ]
The WAKEEN bits are used to indicate which bits in the STATESTS register may cause wake event during the codec state change request. Configure the WAKEEN register for the Tegra to detect the wake events.
--- sound/pci/hda/hda_tegra.c | 7 +++++++ 1 file changed, 7 insertions(+)
sound/pci/hda/hda_tegra.c +7 -0
@@ -169,6 +169,10 @@ static int __maybe_unused hda_tegra_runtime_suspend(struct device *dev)struct hdac_bus *bus =azx_bus (chip);if (chip && chip->running) { +/* enable controller wake up event */ +azx_writew (chip,WAKEEN ,azx_readw (chip,WAKEEN ) | +STATESTS_INT_MASK ); +azx_stop_chip (chip);synchronize_irq (bus->irq);azx_enter_link_reset (chip);
@@ -191,6 +195,9 @@ static int __maybe_unused hda_tegra_runtime_resume(struct device *dev)if (chip && chip->running) {hda_tegra_init (hda);azx_init_chip (chip,1 ); +/* disable controller wake up event*/ +azx_writew (chip,WAKEEN ,azx_readw (chip,WAKEEN ) & + ~STATESTS_INT_MASK ); }return 0 ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 39/43 ALSA: hda: hdmi - add Rocketlake support
In reply to Sasha LevinFrom: Rander Wang <[email protected]>
[ Upstream commit f804a324a41a880c1ab43cc5145d8b3e5790430d ]
Add Rocketlake HDMI codec support. Rocketlake shares the pin-to-port mapping table with Tigerlake.
--- sound/pci/hda/patch_hdmi.c | 1 + 1 file changed, 1 insertion(+)
sound/pci/hda/patch_hdmi.c +1 -0
@@ -4204,6 +4204,7 @@ HDA_CODEC_ENTRY(0x8086280c, "Cannonlake HDMI", patch_i915_glk_hdmi),HDA_CODEC_ENTRY (0x8086280d ,"Geminilake HDMI" , patch_i915_glk_hdmi),HDA_CODEC_ENTRY (0x8086280f ,"Icelake HDMI" , patch_i915_icl_hdmi),HDA_CODEC_ENTRY (0x80862812 ,"Tigerlake HDMI" , patch_i915_tgl_hdmi), +HDA_CODEC_ENTRY (0x80862816 ,"Rocketlake HDMI" , patch_i915_tgl_hdmi),HDA_CODEC_ENTRY (0x8086281a ,"Jasperlake HDMI" , patch_i915_icl_hdmi),HDA_CODEC_ENTRY (0x80862880 ,"CedarTrail HDMI" , patch_generic_hdmi), HDA_CODEC_ENTRY(0x80862882, "Valleyview2 HDMI", patch_i915_byt_hdmi),
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 43/43 gcov: Disable gcov build with GCC 10
In reply to Sasha LevinFrom: Leon Romanovsky <[email protected]>
[ Upstream commit cfc905f158eaa099d6258031614d11869e7ef71c ]
GCOV built with GCC 10 doesn't initialize n_function variable. This produces different kernel panics as was seen by Colin in Ubuntu and me in FC 32.
As a workaround, let's disable GCOV build for broken GCC 10 version.
--- kernel/gcov/Kconfig | 1 + 1 file changed, 1 insertion(+)
kernel/gcov/Kconfig +1 -0
@@ -4,6 +4,7 @@ menu "GCOV-based kernel profiling" config GCOV_KERNEL bool "Enable gcov-based kernel profiling" depends on DEBUG_FS + depends on !CC_IS_GCC || GCC_VERSION < 100000 select CONSTRUCTORS if !UML default n ---help---
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 40/43 ALSA: hda: fix a runtime pm issue in SOF when integrated GPU is disabled
In reply to Sasha LevinFrom: Rander Wang <[email protected]>
[ Upstream commit 13774d81f38538c5fa2924bdcdfa509155480fa6 ]
In snd_hdac_device_init pm_runtime_set_active is called to increase child_count in parent device. But when it is failed to build connection with GPU for one case that integrated graphic gpu is disabled, snd_hdac_ext_bus_device_exit will be invoked to clean up a HD-audio extended codec base device. At this time the child_count of parent is not decreased, which makes parent device can't get suspended.
This patch calls pm_runtime_set_suspended to decrease child_count in parent device in snd_hdac_device_exit to match with snd_hdac_device_init. pm_runtime_set_suspended can make sure that it will not decrease child_count if the device is already suspended.
--- sound/hda/hdac_device.c | 2 ++ 1 file changed, 2 insertions(+)
sound/hda/hdac_device.c +2 -0
@@ -127,6 +127,8 @@ EXPORT_SYMBOL_GPL(snd_hdac_device_init);void snd_hdac_device_exit (struct hdac_device *codec) {pm_runtime_put_noidle (&codec->dev); +/* keep balance of runtime PM child_count in parent device */ +pm_runtime_set_suspended (&codec->dev);snd_hdac_bus_remove_device (codec->bus, codec);kfree (codec->vendor_name);kfree (codec->chip_name);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 38/43 arm64/module: set trampoline section flags regardless of CONFIG_DYNAMIC_FTRACE
In reply to Sasha LevinFrom: Jessica Yu <[email protected]>
[ Upstream commit e0328feda79d9681b3e3245e6e180295550c8ee9 ]
In the arm64 module linker script, the section .text.ftrace_trampoline is specified unconditionally regardless of whether CONFIG_DYNAMIC_FTRACE is enabled (this is simply due to the limitation that module linker scripts are not preprocessed like the vmlinux one).
Normally, for .plt and .text.ftrace_trampoline, the section flags present in the module binary wouldn't matter since module_frob_arch_sections() would assign them manually anyway. However, the arm64 module loader only sets the section flags for .text.ftrace_trampoline when CONFIG_DYNAMIC_FTRACE=y. That's only become problematic recently due to a recent change in binutils-2.35, where the .text.ftrace_trampoline section (along with the .plt section) is now marked writable and executable (WAX).
We no longer allow writable and executable sections to be loaded due to commit 5c3a7db0c7ec ("module: Harden STRICT_MODULE_RWX"), so this is causing all modules linked with binutils-2.35 to be rejected under arm64. Drop the IS_ENABLED(CONFIG_DYNAMIC_FTRACE) check in module_frob_arch_sections() so that the section flags for .text.ftrace_trampoline get properly set to SHF_EXECINSTR|SHF_ALLOC, without SHF_WRITE.
--- arch/arm64/kernel/module-plts.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/arm64/kernel/module-plts.c +1 -2
@@ -270,8 +270,7 @@ int module_frob_arch_sections(Elf_Ehdr *ehdr, Elf_Shdr *sechdrs, mod->arch.core.plt_shndx = i; else if (!strcmp(secstrings + sechdrs[i].sh_name, ".init.plt")) mod->arch.init.plt_shndx = i; - else if (IS_ENABLED(CONFIG_DYNAMIC_FTRACE) && - !strcmp(secstrings + sechdrs[i].sh_name, + else if (!strcmp(secstrings + sechdrs[i].sh_name, ".text.ftrace_trampoline")) tramp = sechdrs + i; else if (sechdrs[i].sh_type == SHT_SYMTAB)
Signature · 7 lines
2.25.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 35/43 cpufreq: intel_pstate: Refuse to turn off with HWP enabled
In reply to Sasha LevinFrom: "Rafael J. Wysocki" <[email protected]>
[ Upstream commit 43298db3009f06fe5c69e1ca8b6cfc2565772fa1 ]
After commit f6ebbcf08f37 ("cpufreq: intel_pstate: Implement passive mode with HWP enabled") it is possible to change the driver status to "off" via sysfs with HWP enabled, which effectively causes the driver to unregister itself, but HWP remains active and it forces the minimum performance, so even if another cpufreq driver is loaded, it will not be able to control the CPU frequency.
For this reason, make the driver refuse to change the status to "off" with HWP enabled.
--- drivers/cpufreq/intel_pstate.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/cpufreq/intel_pstate.c +9 -3
@@ -2533,9 +2533,15 @@ static int intel_pstate_update_status(const char *buf, size_t size) {int ret; -if (size ==3 && !strncmp (buf,"off" , size)) -return intel_pstate_driver ? -intel_pstate_unregister_driver () : -EINVAL ; +if (size ==3 && !strncmp (buf,"off" , size)) { +if (!intel_pstate_driver) +return -EINVAL ; + +if (hwp_active) +return -EBUSY ; + +return intel_pstate_unregister_driver (); + }if (size ==6 && !strncmp (buf,"active" , size)) {if (intel_pstate_driver) {
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 37/43 net: usb: dm9601: Add USB ID of Keenetic Plus DSL
In reply to Sasha LevinFrom: Kamil Lorenc <[email protected]>
[ Upstream commit a609d0259183a841621f252e067f40f8cc25d6f6 ]
Keenetic Plus DSL is a xDSL modem that uses dm9620 as its USB interface.
--- drivers/net/usb/dm9601.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/usb/dm9601.c +4 -0
@@ -625,6 +625,10 @@ static const struct usb_device_id products[] = { USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */ .driver_info = (unsigned long)&dm9601_info, }, + { + USB_DEVICE(0x0586, 0x3427), /* ZyXEL Keenetic Plus DSL xDSL modem */ + .driver_info = (unsigned long)&dm9601_info, + }, {}, // END };
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 36/43 cpufreq: intel_pstate: Fix intel_pstate_get_hwp_max() for turbo disabled
In reply to Sasha LevinFrom: Francisco Jerez <[email protected]>
[ Upstream commit eacc9c5a927e474c173a5d53dd7fb8e306511768 ]
This fixes the behavior of the scaling_max_freq and scaling_min_freq sysfs files in systems which had turbo disabled by the BIOS.
Caleb noticed that the HWP is programmed to operate in the wrong P-state range on his system when the CPUFREQ policy min/max frequency is set via sysfs. This seems to be because in his system intel_pstate_get_hwp_max() is returning the maximum turbo P-state even though turbo was disabled by the BIOS, which causes intel_pstate to scale kHz frequencies incorrectly e.g. setting the maximum turbo frequency whenever the maximum guaranteed frequency is requested via sysfs.
--- drivers/cpufreq/intel_pstate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cpufreq/intel_pstate.c +1 -1
@@ -762,7 +762,7 @@ static void intel_pstate_get_hwp_max(unsigned int cpu, int *phy_max,rdmsrl_on_cpu (cpu,MSR_HWP_CAPABILITIES , &cap);WRITE_ONCE (all_cpu_data[cpu]->hwp_cap_cached, cap); -if (global.no_turbo) +if (global.no_turbo || global.turbo_disabled) *current_max =HWP_GUARANTEED_PERF (cap);else *current_max =HWP_HIGHEST_PERF (cap);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 31/43 HID: microsoft: Add rumble support for the 8bitdo SN30 Pro+ controller
In reply to Sasha LevinFrom: Nicholas Miell <[email protected]>
[ Upstream commit 724a419ea28f7514a391e80040230f69cf626707 ]
When operating in XInput mode, the 8bitdo SN30 Pro+ requires the same quirk as the official Xbox One Bluetooth controllers for rumble to function.
Other controllers like the N30 Pro 2, SF30 Pro, SN30 Pro, etc. probably also need this quirk, but I do not have the hardware to test.
--- drivers/hid/hid-ids.h | 1 + drivers/hid/hid-microsoft.c | 2 ++ 2 files changed, 3 insertions(+)
drivers/hid/hid-ids.h +1 -0
@@ -843,6 +843,7 @@#define USB_DEVICE_ID_MS_POWER_COVER 0x07da#define USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER 0x02fd#define USB_DEVICE_ID_MS_PIXART_MOUSE 0x00cb +#define USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS 0x02e0#define USB_VENDOR_ID_MOJO 0x8282#define USB_DEVICE_ID_RETRO_ADAPTER 0x3201
drivers/hid/hid-microsoft.c +2 -0
@@ -451,6 +451,8 @@ static const struct hid_device_id ms_devices[] = { .driver_data = MS_SURFACE_DIAL }, { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_MS_XBOX_ONE_S_CONTROLLER), .driver_data = MS_QUIRK_FF }, + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_MICROSOFT, USB_DEVICE_ID_8BITDO_SN30_PRO_PLUS), + .driver_data = MS_QUIRK_FF }, { } };MODULE_DEVICE_TABLE (hid, ms_devices);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 30/43 HID: quirks: Set INCREMENT_USAGE_ON_DUPLICATE for all Saitek X52 devices
In reply to Sasha LevinFrom: Nirenjan Krishnan <[email protected]>
[ Upstream commit 77df710ba633dfb6c65c65cf99ea9e084a1c9933 ]
The Saitek X52 family of joysticks has a pair of axes that were originally (by the Windows driver) used as mouse pointer controls. The corresponding usage page is the Game Controls page, which is not recognized by the generic HID driver, and therefore, both axes get mapped to ABS_MISC. The quirk makes the second axis get mapped to ABS_MISC+1, and therefore made available separately.
One Saitek X52 device is already fixed. This patch fixes the other two known devices with VID/PID 06a3:0255 and 06a3:0762.
--- drivers/hid/hid-ids.h | 2 ++ drivers/hid/hid-quirks.c | 2 ++ 2 files changed, 4 insertions(+)
drivers/hid/hid-ids.h +2 -0
@@ -1008,6 +1008,8 @@#define USB_DEVICE_ID_SAITEK_RAT9 0x0cfa#define USB_DEVICE_ID_SAITEK_MMO7 0x0cd0#define USB_DEVICE_ID_SAITEK_X52 0x075c +#define USB_DEVICE_ID_SAITEK_X52_2 0x0255 +#define USB_DEVICE_ID_SAITEK_X52_PRO 0x0762#define USB_VENDOR_ID_SAMSUNG 0x0419#define USB_DEVICE_ID_SAMSUNG_IR_REMOTE 0x0001
drivers/hid/hid-quirks.c +2 -0
@@ -147,6 +147,8 @@ static const struct hid_device_id hid_quirks[] = { { HID_USB_DEVICE(USB_VENDOR_ID_RETROUSB, USB_DEVICE_ID_RETROUSB_SNES_RETROPORT), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_RUMBLEPAD), HID_QUIRK_BADPAD }, { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, + { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52_2), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, + { HID_USB_DEVICE(USB_VENDOR_ID_SAITEK, USB_DEVICE_ID_SAITEK_X52_PRO), HID_QUIRK_INCREMENT_USAGE_ON_DUPLICATE }, { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD2), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_SEMICO, USB_DEVICE_ID_SEMICO_USB_KEYKOARD), HID_QUIRK_NO_INIT_REPORTS }, { HID_USB_DEVICE(USB_VENDOR_ID_SENNHEISER, USB_DEVICE_ID_SENNHEISER_BTD500USB), HID_QUIRK_NOGET },
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 22/43 nvme: have nvme_wait_freeze_timeout return if it timed out
In reply to Sasha LevinFrom: Sagi Grimberg <[email protected]>
[ Upstream commit 7cf0d7c0f3c3b0203aaf81c1bc884924d8fdb9bd ]
Users can detect if the wait has completed or not and take appropriate actions based on this information (e.g. weather to continue initialization or rather fail and schedule another initialization attempt).
--- drivers/nvme/host/core.c | 3 ++- drivers/nvme/host/nvme.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/host/core.c +2 -1
@@ -4148,7 +4148,7 @@ void nvme_unfreeze(struct nvme_ctrl *ctrl) }EXPORT_SYMBOL_GPL (nvme_unfreeze); -void nvme_wait_freeze_timeout (struct nvme_ctrl *ctrl,long timeout) +int nvme_wait_freeze_timeout (struct nvme_ctrl *ctrl,long timeout) {struct nvme_ns *ns;
@@ -4159,6 +4159,7 @@ void nvme_wait_freeze_timeout(struct nvme_ctrl *ctrl, long timeout)break ; }up_read (&ctrl->namespaces_rwsem); +return timeout; }EXPORT_SYMBOL_GPL (nvme_wait_freeze_timeout);
drivers/nvme/host/nvme.h +1 -1
@@ -485,7 +485,7 @@ void nvme_kill_queues(struct nvme_ctrl *ctrl);void nvme_sync_queues (struct nvme_ctrl *ctrl);void nvme_unfreeze (struct nvme_ctrl *ctrl);void nvme_wait_freeze (struct nvme_ctrl *ctrl); -void nvme_wait_freeze_timeout (struct nvme_ctrl *ctrl,long timeout); +int nvme_wait_freeze_timeout (struct nvme_ctrl *ctrl,long timeout);void nvme_start_freeze (struct nvme_ctrl *ctrl);#define NVME_QID_ANY -1
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 18/43 xfs: initialize the shortform attr header padding entry
In reply to Sasha LevinFrom: "Darrick J. Wong" <[email protected]>
[ Upstream commit 125eac243806e021f33a1fdea3687eccbb9f7636 ]
Don't leak kernel memory contents into the shortform attr fork.
--- fs/xfs/libxfs/xfs_attr_leaf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/xfs/libxfs/xfs_attr_leaf.c +2 -2
@@ -583,8 +583,8 @@ xfs_attr_shortform_create(xfs_da_args_t *args)ASSERT (ifp->if_flags &XFS_IFINLINE ); }xfs_idata_realloc (dp,sizeof (*hdr),XFS_ATTR_FORK ); - hdr = (xfs_attr_sf_hdr_t *)ifp->if_u1.if_data; - hdr->count =0 ; + hdr = (struct xfs_attr_sf_hdr *)ifp->if_u1.if_data; +memset (hdr,0 ,sizeof (*hdr)); hdr->totsize =cpu_to_be16 (sizeof (*hdr));xfs_trans_log_inode (args->trans, dp,XFS_ILOG_CORE |XFS_ILOG_ADATA ); }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 17/43 net: usb: Fix uninit-was-stored issue in asix_read_phy_addr()
In reply to Sasha LevinFrom: Himadri Pandya <[email protected]>
[ Upstream commit a092b7233f0e000cc6f2c71a49e2ecc6f917a5fc ]
The buffer size is 2 Bytes and we expect to receive the same amount of data. But sometimes we receive less data and run into uninit-was-stored issue upon read. Hence modify the error check on the return value to match with the buffer size as a prevention.
Reported-and-tested by: [email protected]
--- drivers/net/usb/asix_common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/usb/asix_common.c +1 -1
@@ -296,7 +296,7 @@ int asix_read_phy_addr(struct usbnet *dev, int internal)netdev_dbg (dev->net,"asix_get_phy_addr()\n" ); -if (ret <0 ) { +if (ret <2 ) {netdev_err (dev->net,"Error reading PHYID register: %02x\n" , ret); goto out; }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 15/43 cfg80211: regulatory: reject invalid hints
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 47caf685a6854593348f216e0b489b71c10cbe03 ]
Reject invalid hints early in order to not cause a kernel WARN later if they're restored to or similar.
--- net/wireless/reg.c | 3 +++ 1 file changed, 3 insertions(+)
net/wireless/reg.c +3 -0
@@ -2941,6 +2941,9 @@ int regulatory_hint_user(const char *alpha2,if (WARN_ON (!alpha2))return -EINVAL ; +if (!is_world_regdom (alpha2) && !is_an_alpha2 (alpha2)) +return -EINVAL ; + request =kzalloc (sizeof (struct regulatory_request ),GFP_KERNEL );if (!request)return -ENOMEM ;
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 14/43 drivers/net/wan/lapbether: Set network_header before transmitting
In reply to Sasha LevinFrom: Xie He <[email protected]>
[ Upstream commit 91244d108441013b7367b3b4dcc6869998676473 ]
Set the skb's network_header before it is passed to the underlying Ethernet device for transmission.
This patch fixes the following issue:
When we use this driver with AF_PACKET sockets, there would be error messages of:
protocol 0805 is buggy, dev (Ethernet interface name)
printed in the system "dmesg" log.
This is because skbs passed down to the Ethernet device for transmission don't have their network_header properly set, and the dev_queue_xmit_nit function in net/core/dev.c complains about this.
Reason of setting the network_header to this place (at the end of the Ethernet header, and at the beginning of the Ethernet payload):
Because when this driver receives an skb from the Ethernet device, the network_header is also set at this place.
--- drivers/net/wan/lapbether.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/wan/lapbether.c +2 -0
@@ -210,6 +210,8 @@ static void lapbeth_data_transmit(struct net_device *ndev, struct sk_buff *skb) skb->dev = dev = lapbeth->ethdev; +skb_reset_network_header (skb); +dev_hard_header (skb, dev,ETH_P_DEC , bcast_addr,NULL ,0 );dev_queue_xmit (skb);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 16/43 cfg80211: Adjust 6 GHz frequency to channel conversion
In reply to Sasha LevinFrom: Amar Singhal <[email protected]>
[ Upstream commit 2d9b55508556ccee6410310fb9ea2482fd3328eb ]
Adjust the 6 GHz frequency to channel conversion function, the other way around was previously handled.
--- net/wireless/util.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
net/wireless/util.c +5 -3
@@ -116,11 +116,13 @@ int ieee80211_frequency_to_channel(int freq)return (freq -2407 ) /5 ; else if (freq >= 4910 && freq <= 4980)return (freq -4000 ) /5 ; - else if (freq < 5945) + else if (freq < 5925) return (freq - 5000) / 5; + else if (freq == 5935) + return 2; else if (freq <= 45000) /* DMG band lower limit */ - /* see 802.11ax D4.1 27.3.22.2 */ - return (freq - 5940) / 5; + /* see 802.11ax D6.1 27.3.22.2 */ + return (freq - 5950) / 5; else if (freq >= 58320 && freq <= 70200)return (freq -56160 ) /2160 ; else
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 7/43 firestream: Fix memleak in fs_open
In reply to Sasha LevinFrom: Dinghao Liu <[email protected]>
[ Upstream commit 15ac5cdafb9202424206dc5bd376437a358963f9 ]
When make_rate() fails, vcc should be freed just like other error paths in fs_open().
--- drivers/atm/firestream.c | 1 + 1 file changed, 1 insertion(+)
drivers/atm/firestream.c +1 -0
@@ -998,6 +998,7 @@ static int fs_open(struct atm_vcc *atm_vcc) error =make_rate (pcr, r, &tmc0,NULL );if (error) {kfree (tc); +kfree (vcc);return error; } }
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 4/43 rxrpc: Keep the ACK serial in a var in rxrpc_input_ack()
In reply to Sasha LevinFrom: David Howells <[email protected]>
[ Upstream commit 68528d937dcd675e79973061c1a314db598162d1 ]
Keep the ACK serial number in a variable in rxrpc_input_ack() as it's used frequently.
--- net/rxrpc/input.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
net/rxrpc/input.c +11 -10
@@ -844,7 +844,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)struct rxrpc_ackinfo info;u8 acks[RXRPC_MAXACKS ]; } buf; -rxrpc_serial_t acked_serial; +rxrpc_serial_t ack_serial, acked_serial;rxrpc_seq_t first_soft_ack, hard_ack, prev_pkt;int nr_acks, offset, ioffset;
@@ -857,6 +857,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb) } offset +=sizeof (buf.ack); + ack_serial = sp->hdr.serial; acked_serial =ntohl (buf.ack.serial); first_soft_ack =ntohl (buf.ack.firstPacket); prev_pkt =ntohl (buf.ack.previousPacket);
@@ -865,31 +866,31 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb) summary.ack_reason = (buf.ack.reason <RXRPC_ACK__INVALID ? buf.ack.reason :RXRPC_ACK__INVALID ); -trace_rxrpc_rx_ack (call, sp->hdr.serial, acked_serial, +trace_rxrpc_rx_ack (call, ack_serial, acked_serial, first_soft_ack, prev_pkt, summary.ack_reason, nr_acks);if (buf.ack.reason ==RXRPC_ACK_PING_RESPONSE )rxrpc_input_ping_response (call, skb->tstamp, acked_serial, - sp->hdr.serial); + ack_serial);if (buf.ack.reason ==RXRPC_ACK_REQUESTED )rxrpc_input_requested_ack (call, skb->tstamp, acked_serial, - sp->hdr.serial); + ack_serial);if (buf.ack.reason ==RXRPC_ACK_PING ) { -_proto ("Rx ACK %%%u PING Request" , sp->hdr.serial); +_proto ("Rx ACK %%%u PING Request" , ack_serial);rxrpc_propose_ACK (call,RXRPC_ACK_PING_RESPONSE , - sp->hdr.serial, true, true, + ack_serial, true, true, rxrpc_propose_ack_respond_to_ping); }else if (sp->hdr.flags &RXRPC_REQUEST_ACK ) {rxrpc_propose_ACK (call,RXRPC_ACK_REQUESTED , - sp->hdr.serial, true, true, + ack_serial, true, true, rxrpc_propose_ack_respond_to_ack); }/* Discard any out-of-order or duplicate ACKs (outside lock). */ if (!rxrpc_is_ack_valid (call, first_soft_ack, prev_pkt)) { -trace_rxrpc_rx_discard_ack (call->debug_id, sp->hdr.serial, +trace_rxrpc_rx_discard_ack (call->debug_id, ack_serial, first_soft_ack, call->ackr_first_seq, prev_pkt, call->ackr_prev_seq);return ;
@@ -905,7 +906,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb)/* Discard any out-of-order or duplicate ACKs (inside lock). */ if (!rxrpc_is_ack_valid (call, first_soft_ack, prev_pkt)) { -trace_rxrpc_rx_discard_ack (call->debug_id, sp->hdr.serial, +trace_rxrpc_rx_discard_ack (call->debug_id, ack_serial, first_soft_ack, call->ackr_first_seq, prev_pkt, call->ackr_prev_seq); goto out;
@@ -965,7 +966,7 @@ static void rxrpc_input_ack(struct rxrpc_call *call, struct sk_buff *skb) RXRPC_TX_ANNO_LAST && summary.nr_acks == call->tx_top - hard_ack && rxrpc_is_client_call(call)) -rxrpc_propose_ACK (call,RXRPC_ACK_PING , sp->hdr.serial, +rxrpc_propose_ACK (call,RXRPC_ACK_PING , ack_serial, false, true, rxrpc_propose_ack_ping_for_lost_reply);
Signature · 1 line
2.25.1
Sasha Levin
maintainerPATCH 6/43 NFC: st95hf: Fix memleak in st95hf_in_send_cmd
In reply to Sasha LevinFrom: Dinghao Liu <[email protected]>
[ Upstream commit f97c04c316d8fea16dca449fdfbe101fbdfee6a2 ]
When down_killable() fails, skb_resp should be freed just like when st95hf_spi_send() fails.
--- drivers/nfc/st95hf/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nfc/st95hf/core.c +1 -1
@@ -966,7 +966,7 @@ static int st95hf_in_send_cmd(struct nfc_digital_dev *ddev, rc =down_killable (&stcontext->exchange_lock);if (rc) {WARN (1 ,"Semaphore is not found up in st95hf_in_send_cmd\n" ); -return rc; + goto free_skb_resp; } rc = st95hf_spi_send(&stcontext->spicontext, skb->data,
Signature · 1 line
2.25.1