5.15.141-rc1 review
Greg Kroah-Hartman
maintainerPATCH 1/69 afs: Fix afs_server_list to be cleaned up with RCU
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit e6bace7313d61e31f2b16fa3d774fd8cb3cb869e ]
afs_server_list is accessed with the rcu_read_lock() held from volume->servers, so it needs to be cleaned up correctly.
Fix this by using kfree_rcu() instead of kfree().
--- fs/afs/internal.h | 1 + fs/afs/server_list.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
fs/afs/internal.h +1 -0
@@ -556,6 +556,7 @@ struct afs_server_entry { };struct afs_server_list { +struct rcu_head rcu;afs_volid_t vids[AFS_MAXTYPES ];/* Volume IDs */ refcount_t usage;unsigned char nr_servers;
fs/afs/server_list.c +1 -1
@@ -17,7 +17,7 @@ void afs_put_serverlist(struct afs_net *net, struct afs_server_list *slist)for (i =0 ; i < slist->nr_servers; i++)afs_unuse_server (net, slist->servers[i].server, afs_server_trace_put_slist); -kfree (slist); +kfree_rcu (slist, rcu); } }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 10/69 drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jonas Karlman <[email protected]>
[ Upstream commit bb0a05acd6121ff0e810b44fdc24dbdfaa46b642 ]
Use of DRM_FORMAT_RGB888 and DRM_FORMAT_BGR888 on e.g. RK3288, RK3328 and RK3399 result in wrong colors being displayed.
The issue can be observed using modetest:
modetest -s <connector_id>@<crtc_id>:1920x1080-60@RG24 modetest -s <connector_id>@<crtc_id>:1920x1080-60@BG24
Vendor 4.4 kernel apply an inverted rb swap for these formats on VOP full framework (IP version 3.x) compared to VOP little framework (2.x).
Fix colors by applying different rb swap for VOP full framework (3.x) and VOP little framework (2.x) similar to vendor 4.4 kernel.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop.c +11 -3
@@ -249,14 +249,22 @@ static inline void vop_cfg_done(struct vop *vop)VOP_REG_SET (vop, common, cfg_done,1 ); } -static bool has_rb_swapped (uint32_t format) +static bool has_rb_swapped (uint32_t version,uint32_t format) {switch (format) {case DRM_FORMAT_XBGR8888 :case DRM_FORMAT_ABGR8888 : -case DRM_FORMAT_BGR888 :case DRM_FORMAT_BGR565 :return true; +/* +* full framework (IP version 3.x) only need rb swapped for RGB888 and +* little framework (IP version 2.x) only need rb swapped for BGR888, +* check for 3.x to also only rb swap BGR888 for unknown vop version +*/ +case DRM_FORMAT_RGB888 : +return VOP_MAJOR (version) ==3 ; +case DRM_FORMAT_BGR888 : +return VOP_MAJOR (version) !=3 ;default :return false; }
@@ -998,7 +1006,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,VOP_WIN_SET (vop, win, dsp_info, dsp_info);VOP_WIN_SET (vop, win, dsp_st, dsp_st); - rb_swap =has_rb_swapped (fb->format->format); + rb_swap =has_rb_swapped (vop->data->version, fb->format->format);VOP_WIN_SET (vop, win, rb_swap, rb_swap);/*
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 11/69 HID: core: store the unique system identifier in hid_device
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Tissoires <[email protected]>
[ Upstream commit 1e839143d674603b0bbbc4c513bca35404967dbc ]
This unique identifier is currently used only for ensuring uniqueness in sysfs. However, this could be handful for userspace to refer to a specific hid_device by this id.
2 use cases are in my mind: LEDs (and their naming convention), and HID-BPF.
Stable-dep-of: fc43e9c857b7 ("HID: fix HID device resource race between HID core and debugging support")
--- drivers/hid/hid-core.c | 4 +++- include/linux/hid.h | 2 ++ 2 files changed, 5 insertions(+), 1 deletion(-)
drivers/hid/hid-core.c +3 -1
@@ -2442,10 +2442,12 @@ int hid_add_device(struct hid_device *hdev)hid_warn (hdev,"bad device descriptor (%d)\n" , ret); } + hdev->id =atomic_inc_return (&id); +/* XXX hack, any other cleaner solution after the driver core * is converted to allow more than 20 bytes as the device name? */ dev_set_name (&hdev->dev,"%04X:%04X:%04X.%04X" , hdev->bus, - hdev->vendor, hdev->product,atomic_inc_return (&id)); + hdev->vendor, hdev->product, hdev->id);hid_debug_register (hdev,dev_name (&hdev->dev)); ret =device_add (&hdev->dev);
include/linux/hid.h +2 -0
@@ -630,6 +630,8 @@ struct hid_device { /* device report descriptor */struct list_head debug_list;spinlock_t debug_list_lock;wait_queue_head_t debug_wait; + +unsigned int id;/* system unique id */ };#define to_hid_device (pdev) \
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 12/69 HID: fix HID device resource race between HID core and debugging support
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Yi <[email protected]>
[ Upstream commit fc43e9c857b7aa55efba9398419b14d9e35dcc7d ]
hid_debug_events_release releases resources bound to the HID device instance. hid_device_release releases the underlying HID device instance potentially before hid_debug_events_release has completed releasing debug resources bound to the same HID device instance.
Reference count to prevent the HID device instance from being torn down preemptively when HID debugging support is used. When count reaches zero, release core resources of HID device instance using hiddev_free.
The crash:
[ 120.728477][ T4396] kernel BUG at lib/list_debug.c:53! [ 120.728505][ T4396] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [ 120.739806][ T4396] Modules linked in: bcmdhd dhd_static_buf 8822cu pcie_mhi r8168 [ 120.747386][ T4396] CPU: 1 PID: 4396 Comm: hidt_bridge Not tainted 5.10.110 #257 [ 120.754771][ T4396] Hardware name: Rockchip RK3588 EVB4 LP4 V10 Board (DT) [ 120.761643][ T4396] pstate: 60400089 (nZCv daIf +PAN -UAO -TCO BTYPE=--) [ 120.768338][ T4396] pc : __list_del_entry_valid+0x98/0xac [ 120.773730][ T4396] lr : __list_del_entry_valid+0x98/0xac [ 120.779120][ T4396] sp : ffffffc01e62bb60 [ 120.783126][ T4396] x29: ffffffc01e62bb60 x28: ffffff818ce3a200 [ 120.789126][ T4396] x27: 0000000000000009 x26: 0000000000980000 [ 120.795126][ T4396] x25: ffffffc012431000 x24: ffffff802c6d4e00 [ 120.801125][ T4396] x23: ffffff8005c66f00 x22: ffffffc01183b5b8 [ 120.807125][ T4396] x21: ffffff819df2f100 x20: 0000000000000000 [ 120.813124][ T4396] x19: ffffff802c3f0700 x18: ffffffc01d2cd058 [ 120.819124][ T4396] x17: 0000000000000000 x16: 0000000000000000 [ 120.825124][ T4396] x15: 0000000000000004 x14: 0000000000003fff [ 120.831123][ T4396] x13: ffffffc012085588 x12: 0000000000000003 [ 120.837123][ T4396] x11: 00000000ffffbfff x10: 0000000000000003 [ 120.843123][ T4396] x9 : 455103d46b329300 x8 : 455103d46b329300 [ 120.849124][ T4396] x7 : 74707572726f6320 x6 : ffffffc0124b8cb5 [ 120.855124][ T4396] x5 : ffffffffffffffff x4 : 0000000000000000 [ 120.861123][ T4396] x3 : ffffffc011cf4f90 x2 : ffffff81fee7b948 [ 120.867122][ T4396] x1 : ffffffc011cf4f90 x0 : 0000000000000054 [ 120.873122][ T4396] Call trace: [ 120.876259][ T4396] __list_del_entry_valid+0x98/0xac [ 120.881304][ T4396] hid_debug_events_release+0x48/0x12c [ 120.886617][ T4396] full_proxy_release+0x50/0xbc [ 120.891323][ T4396] __fput+0xdc/0x238 [ 120.895075][ T4396] ____fput+0x14/0x24 [ 120.898911][ T4396] task_work_run+0x90/0x148 [ 120.903268][ T4396] do_exit+0x1bc/0x8a4 [ 120.907193][ T4396] do_group_exit+0x8c/0xa4 [ 120.911458][ T4396] get_signal+0x468/0x744 [ 120.915643][ T4396] do_signal+0x84/0x280 [ 120.919650][ T4396] do_notify_resume+0xd0/0x218 [ 120.924262][ T4396] work_pending+0xc/0x3f0
--- drivers/hid/hid-core.c | 12 ++++++++++-- drivers/hid/hid-debug.c | 3 +++ include/linux/hid.h | 3 +++ 3 files changed, 16 insertions(+), 2 deletions(-)
drivers/hid/hid-core.c +10 -2
@@ -702,15 +702,22 @@ static void hid_close_report(struct hid_device *device)* Free a device structure, all reports, and all fields. */ -static void hid_device_release (struct device *dev) +void hiddev_free (struct kref *ref) { -struct hid_device *hid =to_hid_device (dev); + struct hid_device *hid = container_of(ref, struct hid_device, ref);hid_close_report (hid);kfree (hid->dev_rdesc);kfree (hid); } +static void hid_device_release (struct device *dev) +{ +struct hid_device *hid =to_hid_device (dev); + +kref_put (&hid->ref, hiddev_free); +} +/* * Fetch a report description item from the data stream. We support long * items, though they are not used yet.
@@ -2490,6 +2497,7 @@ struct hid_device *hid_allocate_device(void)spin_lock_init (&hdev->debug_list_lock);sema_init (&hdev->driver_input_lock,1 );mutex_init (&hdev->ll_open_lock); +kref_init (&hdev->ref);return hdev; }
drivers/hid/hid-debug.c +3 -0
@@ -1096,6 +1096,7 @@ static int hid_debug_events_open(struct inode *inode, struct file *file) goto out; } list->hdev = (struct hid_device *) inode->i_private; +kref_get (&list->hdev->ref); file->private_data = list;mutex_init (&list->read_mutex);
@@ -1188,6 +1189,8 @@ static int hid_debug_events_release(struct inode *inode, struct file *file)list_del (&list->node);spin_unlock_irqrestore (&list->hdev->debug_list_lock, flags);kfifo_free (&list->hid_debug_fifo); + +kref_put (&list->hdev->ref, hiddev_free);kfree (list);return 0 ;
include/linux/hid.h +3 -0
@@ -630,10 +630,13 @@ struct hid_device { /* device report descriptor */struct list_head debug_list;spinlock_t debug_list_lock;wait_queue_head_t debug_wait; +struct kref ref;unsigned int id;/* system unique id */ }; +void hiddev_free (struct kref *ref); +#define to_hid_device (pdev) \ container_of(pdev, struct hid_device, dev)
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 13/69 ipv4: Correct/silence an endian warning in __ip_do_redirect
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kunwu Chan <[email protected]>
[ Upstream commit c0e2926266af3b5acf28df0a8fc6e4d90effe0bb ]
net/ipv4/route.c:783:46: warning: incorrect type in argument 2 (different base types)net/ipv4/route.c:783:46: expected unsigned int [usertype] keynet/ipv4/route.c:783:46: got restricted __be32 [usertype] new_gw
--- net/ipv4/route.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/route.c +1 -1
@@ -786,7 +786,7 @@ static void __ip_do_redirect(struct rtable *rt, struct sk_buff *skb, struct flow goto reject_redirect; } - n =__ipv4_neigh_lookup (rt->dst.dev, new_gw); + n =__ipv4_neigh_lookup (rt->dst.dev, (__force u32 )new_gw);if (!n) n =neigh_create (&arp_tbl, &new_gw, rt->dst.dev);if (!IS_ERR (n)) {
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 14/69 net: usb: ax88179_178a: fix failed operations during ax88179_reset
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jose Ignacio Tornos Martinez <[email protected]>
[ Upstream commit 0739af07d1d947af27c877f797cb82ceee702515 ]
Using generic ASIX Electronics Corp. AX88179 Gigabit Ethernet device, the following test cycle has been implemented:
- power on
- check logs
- shutdown
- after detecting the system shutdown, disconnect power
- after approximately 60 seconds of sleep, power is restored
Running some cycles, sometimes error logs like this appear:
kernel: ax88179_178a 2-9:1.0 (unnamed net_device) (uninitialized): Failed to write reg index 0x0001: -19
kernel: ax88179_178a 2-9:1.0 (unnamed net_device) (uninitialized): Failed to read reg index 0x0001: -19
...These failed operation are happening during ax88179_reset execution, so the initialization could not be correct.
In order to avoid this, we need to increase the delay after reset and clock initial operations. By using these larger values, many cycles have been run and no failed operations appear.
It would be better to check some status register to verify when the operation has finished, but I do not have found any available information (neither in the public datasheets nor in the manufacturer's driver). The only available information for the necessary delays is the maufacturer's driver (original values) but the proposed values are not enough for the tested devices.
--- drivers/net/usb/ax88179_178a.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/usb/ax88179_178a.c +2 -2
@@ -1700,11 +1700,11 @@ static int ax88179_reset(struct usbnet *dev) *tmp16 =AX_PHYPWR_RSTCTL_IPRL ;ax88179_write_cmd (dev,AX_ACCESS_MAC ,AX_PHYPWR_RSTCTL ,2 ,2 , tmp16); -msleep (200 ); +msleep (500 ); *tmp =AX_CLK_SELECT_ACS |AX_CLK_SELECT_BCS ;ax88179_write_cmd (dev,AX_ACCESS_MAC ,AX_CLK_SELECT ,1 ,1 , tmp); -msleep (100 ); +msleep (200 );/* Ethernet PHY Auto Detach*/ ax88179_auto_detach (dev,0 );
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 15/69 net/smc: avoid data corruption caused by decline
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: D. Wythe <[email protected]>
[ Upstream commit e6d71b437abc2f249e3b6a1ae1a7228e09c6e563 ]
We found a data corruption issue during testing of SMC-R on Redis applications.
The benchmark has a low probability of reporting a strange error as shown below.
"Error: Protocol error, got "\xe2" as reply type byte"
Finally, we found that the retrieved error data was as follows:
0xE2 0xD4 0xC3 0xD9 0x04 0x00 0x2C 0x20 0xA6 0x56 0x00 0x16 0x3E 0x0C 0xCB 0x04 0x02 0x01 0x00 0x00 0x20 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0xE2
It is quite obvious that this is a SMC DECLINE message, which means that the applications received SMC protocol message.
We found that this was caused by the following situations:
client server
¦ clc proposal
------------->
¦ clc accept
<-------------
¦ clc confirm
------------->
wait llc confirm
send llc confirm
¦failed llc confirm
¦ x------
(after 2s)timeout
wait llc confirm rsp
wait decline
(after 1s) timeout
(after 2s) timeout
¦ decline
-------------->
¦ decline
<--------------As a result, a decline message was sent in the implementation, and this message was read from TCP by the already-fallback connection.
This patch double the client timeout as 2x of the server value, With this simple change, the Decline messages should never cross or collide (during Confirm link timeout).
This issue requires an immediate solution, since the protocol updates involve a more long-term solution.
--- net/smc/af_smc.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
net/smc/af_smc.c +6 -2
@@ -398,8 +398,12 @@ static int smcr_clnt_conf_first_link(struct smc_sock *smc)struct smc_llc_qentry *qentry;int rc; -/* receive CONFIRM LINK request from server over RoCE fabric */ - qentry =smc_llc_wait (link->lgr,NULL ,SMC_LLC_WAIT_TIME , +/* Receive CONFIRM LINK request from server over RoCE fabric. +* Increasing the client's timeout by twice as much as the server's +* timeout by default can temporarily avoid decline messages of +* both sides crossing or colliding +*/ + qentry =smc_llc_wait (link->lgr,NULL ,2 *SMC_LLC_WAIT_TIME ,SMC_LLC_CONFIRM_LINK );if (!qentry) {struct smc_clc_msg_decline dclc;
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 16/69 arm/xen: fix xen_vcpu_info allocation alignment
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Stefano Stabellini <[email protected]>
[ Upstream commit 7bf9a6b46549852a37e6d07e52c601c3c706b562 ]
xen_vcpu_info is a percpu area than needs to be mapped by Xen. Currently, it could cross a page boundary resulting in Xen being unable to map it:
[ 0.567318] kernel BUG at arch/arm64/xen/../../arm/xen/enlighten.c:164! [ 0.574002] Internal error: Oops - BUG: 00000000f2000800 [#1] PREEMPT SMP
Fix the issue by using __alloc_percpu and requesting alignment for the memory allocation.
--- arch/arm/xen/enlighten.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm/xen/enlighten.c +2 -1
@@ -359,7 +359,8 @@ static int __init xen_guest_init(void)* for secondary CPUs as they are brought up. * For uniformity we use VCPUOP_register_vcpu_info even on cpu0. */ - xen_vcpu_info = alloc_percpu(struct vcpu_info); + xen_vcpu_info =__alloc_percpu (sizeof (struct vcpu_info ), +1 <<fls (sizeof (struct vcpu_info ) -1 ));if (xen_vcpu_info ==NULL )return -ENOMEM ;
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 17/69 octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PF
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suman Ghosh <[email protected]>
[ Upstream commit 4aa1d8f89b10cdc25a231dabf808d8935e0b137a ]
It is possible to add a ntuple rule which would like to direct packet to a VF whose number of queues are greater/less than its PF's queue numbers. For example a PF can have 2 Rx queues but a VF created on that PF can have 8 Rx queues. As of today, ntuple rule will reject rule because it is checking the requested queue number against PF's number of Rx queues. As a part of this fix if the action of a ntuple rule is to move a packet to a VF's queue then the check is removed. Also, a debug information is printed to aware user that it is user's responsibility to cross check if the requested queue number on that VF is a valid one.
--- .../marvell/octeontx2/nic/otx2_flows.c | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_flows.c +19 -1
@@ -1002,6 +1002,7 @@ int otx2_add_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc)struct ethhdr *eth_hdr;bool new = false;int err =0 ; +u64 vf_num;u32 ring;if (!flow_cfg->max_flows) {
@@ -1014,7 +1015,21 @@ int otx2_add_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc)if (!(pfvf->flags &OTX2_FLAG_NTUPLE_SUPPORT ))return -ENOMEM ; -if (ring >= pfvf->hw.rx_queues && fsp->ring_cookie !=RX_CLS_FLOW_DISC ) +/* Number of queues on a VF can be greater or less than +* the PF's queue. Hence no need to check for the +* queue count. Hence no need to check queue count if PF +* is installing for its VF. Below is the expected vf_num value +* based on the ethtool commands. +* +* e.g. +* 1. ethtool -U <netdev> ... action -1 ==> vf_num:255 +* 2. ethtool -U <netdev> ... action <queue_num> ==> vf_num:0 +* 3. ethtool -U <netdev> ... vf <vf_idx> queue <queue_num> ==> +* vf_num:vf_idx+1 +*/ + vf_num =ethtool_get_flow_spec_ring_vf (fsp->ring_cookie); +if (!is_otx2_vf (pfvf->pcifunc) && !vf_num && + ring >= pfvf->hw.rx_queues && fsp->ring_cookie !=RX_CLS_FLOW_DISC )return -EINVAL ;if (fsp->location >=otx2_get_maxflows (flow_cfg))
@@ -1096,6 +1111,9 @@ int otx2_add_flow(struct otx2_nic *pfvf, struct ethtool_rxnfc *nfc) flow_cfg->nr_flows++; } +if (flow->is_vf) +netdev_info (pfvf->netdev, +"Make sure that VF's queue number is within its queue limit\n" );return 0 ; }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 18/69 amd-xgbe: handle corner-case during sfp hotplug
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raju Rangoju <[email protected]>
[ Upstream commit 676ec53844cbdf2f47e68a076cdff7f0ec6cbe3f ]
Force the mode change for SFI in Fixed PHY configurations. Fixed PHY configurations needs PLL to be enabled while doing mode set. When the SFP module isn't connected during boot, driver assumes AN is ON and attempts auto-negotiation. However, if the connected SFP comes up in Fixed PHY configuration the link will not come up as PLL isn't enabled while the initial mode set command is issued. So, force the mode change for SFI in Fixed PHY configuration to fix link issues.
--- drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-)
drivers/net/ethernet/amd/xgbe/xgbe-mdio.c +13 -1
@@ -1178,7 +1178,19 @@ static int xgbe_phy_config_fixed(struct xgbe_prv_data *pdata)if (pdata->phy.duplex !=DUPLEX_FULL )return -EINVAL ; -xgbe_set_mode (pdata, mode); +/* Force the mode change for SFI in Fixed PHY config. +* Fixed PHY configs needs PLL to be enabled while doing mode set. +* When the SFP module isn't connected during boot, driver assumes +* AN is ON and attempts autonegotiation. However, if the connected +* SFP comes up in Fixed PHY config, the link will not come up as +* PLL isn't enabled while the initial mode set command is issued. +* So, force the mode change for SFI in Fixed PHY configuration to +* fix link issues. +*/ +if (mode ==XGBE_MODE_SFI ) +xgbe_change_mode (pdata, mode); +else +xgbe_set_mode (pdata, mode);return 0 ; }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 19/69 amd-xgbe: handle the corner-case during tx completion
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raju Rangoju <[email protected]>
[ Upstream commit 7121205d5330c6a3cb3379348886d47c77b78d06 ]
The existing implementation uses software logic to accumulate tx completions until the specified time (1ms) is met and then poll them. However, there exists a tiny gap which leads to a race between resetting and checking the tx_activate flag. Due to this the tx completions are not reported to upper layer and tx queue timeout kicks-in restarting the device.
To address this, introduce a tx cleanup mechanism as part of the periodic maintenance process.
--- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +14 -0
@@ -682,10 +682,24 @@ static void xgbe_service(struct work_struct *work)static void xgbe_service_timer (struct timer_list *t) {struct xgbe_prv_data *pdata =from_timer (pdata, t, service_timer); +struct xgbe_channel *channel; +unsigned int i;queue_work (pdata->dev_workqueue, &pdata->service_work);mod_timer (&pdata->service_timer, jiffies +HZ ); + +if (!pdata->tx_usecs) +return ; + +for (i =0 ; i < pdata->channel_count; i++) { + channel = pdata->channel[i]; +if (!channel->tx_ring || channel->tx_timer_active) +break ; + channel->tx_timer_active =1 ; +mod_timer (&channel->tx_timer, + jiffies +usecs_to_jiffies (pdata->tx_usecs)); + } }static void xgbe_init_timers (struct xgbe_prv_data *pdata)
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 2/69 afs: Make error on cell lookup failure consistent with OpenAFS
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 2a4ca1b4b77850544408595e2433f5d7811a9daa ]
When kafs tries to look up a cell in the DNS or the local config, it will translate a lookup failure into EDESTADDRREQ whereas OpenAFS translates it into ENOENT. Applications such as West expect the latter behaviour and fail if they see the former.
This can be seen by trying to mount an unknown cell:
# mount -t afs %example.com:cell.root /mnt mount: /mnt: mount(2) system call failed: Destination address required.
--- fs/afs/dynroot.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/afs/dynroot.c +2 -2
@@ -131,8 +131,8 @@ static int afs_probe_cell_name(struct dentry *dentry) ret =dns_query (net->net,"afsdb" , name, len,"srv=1" ,NULL ,NULL , false); -if (ret == -ENODATA ) - ret = -EDESTADDRREQ ; +if (ret == -ENODATA || ret == -ENOKEY ) + ret = -ENOENT ;return ret; }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 20/69 amd-xgbe: propagate the correct speed and duplex status
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Raju Rangoju <[email protected]>
[ Upstream commit 7a2323ac24a50311f64a3a9b54ed5bef5821ecae ]
xgbe_get_link_ksettings() does not propagate correct speed and duplex information to ethtool during cable unplug. Due to which ethtool reports incorrect values for speed and duplex.
Address this by propagating correct information.
--- drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c +8 -3
@@ -314,10 +314,15 @@ static int xgbe_get_link_ksettings(struct net_device *netdev, cmd->base.phy_address = pdata->phy.address; - cmd->base.autoneg = pdata->phy.autoneg; - cmd->base.speed = pdata->phy.speed; - cmd->base.duplex = pdata->phy.duplex; +if (netif_carrier_ok (netdev)) { + cmd->base.speed = pdata->phy.speed; + cmd->base.duplex = pdata->phy.duplex; + }else { + cmd->base.speed =SPEED_UNKNOWN ; + cmd->base.duplex =DUPLEX_UNKNOWN ; + } + cmd->base.autoneg = pdata->phy.autoneg; cmd->base.port =PORT_NONE ;XGBE_LM_COPY (cmd, supported, lks, supported);
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 3/69 drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shuijing Li <[email protected]>
[ Upstream commit 812562b8d881ce6d33fed8052b3a10b718430fb5 ]
For "boe,tv105wum-nw0" this special panel, it is stipulated in the panel spec that MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high.
Stable-dep-of: 6965809e5269 ("drm/panel: auo,b101uan08.3: Fine tune the panel power sequence")
--- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +6 -0
@@ -36,6 +36,7 @@ struct panel_desc {const struct panel_init_cmd *init_cmds;unsigned int lanes;bool discharge_on_disable; +bool lp11_before_reset; };struct boe_panel {
@@ -551,6 +552,10 @@ static int boe_panel_prepare(struct drm_panel *panel)usleep_range (5000 ,10000 ); +if (boe->desc->lp11_before_reset) { +mipi_dsi_dcs_nop (boe->dsi); +usleep_range (1000 ,2000 ); + }gpiod_set_value (boe->enable_gpio,1 );usleep_range (1000 ,2000 );gpiod_set_value (boe->enable_gpio,0 );
@@ -719,6 +724,7 @@ static const struct panel_desc boe_tv105wum_nw0_desc = { .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_LPM, .init_cmds = boe_init_cmd, + .lp11_before_reset = true, }; static int boe_panel_get_modes(struct drm_panel *panel,
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 4/69 drm/panel: auo,b101uan08.3: Fine tune the panel power sequence
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xuxin Xiong <[email protected]>
[ Upstream commit 6965809e526917b73c8f9178173184dcf13cec4b ]
For "auo,b101uan08.3" this panel, it is stipulated in the panel spec that MIPI needs to keep the LP11 state before the lcm_reset pin is pulled high.
--- drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c +1 -0
@@ -697,6 +697,7 @@ static const struct panel_desc auo_b101uan08_3_desc = { .mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_SYNC_PULSE | MIPI_DSI_MODE_LPM, .init_cmds = auo_b101uan08_3_init_cmd, + .lp11_before_reset = true, };static const struct drm_display_mode boe_tv105wum_nw0_default_mode = {
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 5/69 drm/panel: simple: Fix Innolux G101ICE-L01 bus flags
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit 06fc41b09cfbc02977acd9189473593a37d82d9b ]
Add missing .bus_flags = DRM_BUS_FLAG_DE_HIGH to this panel description, ones which match both the datasheet and the panel display_timing flags .
--- drivers/gpu/drm/panel/panel-simple.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/panel/panel-simple.c +1 -0
@@ -2555,6 +2555,7 @@ static const struct panel_desc innolux_g101ice_l01 = { .disable = 200, }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, .connector_type = DRM_MODE_CONNECTOR_LVDS, };
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 6/69 drm/panel: simple: Fix Innolux G101ICE-L01 timings
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marek Vasut <[email protected]>
[ Upstream commit 3f9a91b6c00e655d27bd785dcda1742dbdc31bda ]
The Innolux G101ICE-L01 datasheet [1] page 17 table 6.1 INPUT SIGNAL TIMING SPECIFICATIONS
indicates that maximum vertical blanking time is 40 lines. Currently the driver uses 29 lines.
Fix it, and since this panel is a DE panel, adjust the timings to make them less hostile to controllers which cannot do 1 px HSA/VSA, distribute the delays evenly between all three parts.
[1] https://www.data-modul.com/sites/default/files/products/G101ICE-L01-C2-specification-12042389.pdf
--- drivers/gpu/drm/panel/panel-simple.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/panel/panel-simple.c +6 -6
@@ -2532,13 +2532,13 @@ static const struct panel_desc innolux_g070y2_l01 = {static const struct display_timing innolux_g101ice_l01_timing = { .pixelclock = {60400000 ,71100000 ,74700000 }, .hactive = {1280 ,1280 ,1280 }, - .hfront_porch = {41 ,80 ,100 }, - .hback_porch = {40 ,79 ,99 }, - .hsync_len = {1 ,1 ,1 }, + .hfront_porch = {30 ,60 ,70 }, + .hback_porch = {30 ,60 ,70 }, + .hsync_len = {22 ,40 ,60 }, .vactive = {800 ,800 ,800 }, - .vfront_porch = {5 ,11 ,14 }, - .vback_porch = {4 ,11 ,14 }, - .vsync_len = {1 ,1 ,1 }, + .vfront_porch = {3 ,8 ,14 }, + .vback_porch = {3 ,8 ,14 }, + .vsync_len = {4 ,7 ,12 }, .flags =DISPLAY_FLAGS_DE_HIGH , };
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 7/69 wireguard: use DEV_STATS_INC()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Eric Dumazet <[email protected]>
[ Upstream commit 93da8d75a66568ba4bb5b14ad2833acd7304cd02 ]
wg_xmit() can be called concurrently, KCSAN reported [1] some device stats updates can be lost.
Use DEV_STATS_INC() for this unlikely case.
[1]
BUG: KCSAN: data-race in wg_xmit / wg_xmit
read-write to 0xffff888104239160 of 8 bytes by task 1375 on cpu 0:
wg_xmit+0x60f/0x680 drivers/net/wireguard/device.c:231 __netdev_start_xmit include/linux/netdevice.h:4918 [inline] netdev_start_xmit include/linux/netdevice.h:4932 [inline] xmit_one net/core/dev.c:3543 [inline] dev_hard_start_xmit+0x11b/0x3f0 net/core/dev.c:3559
...
read-write to 0xffff888104239160 of 8 bytes by task 1378 on cpu 1:
wg_xmit+0x60f/0x680 drivers/net/wireguard/device.c:231 __netdev_start_xmit include/linux/netdevice.h:4918 [inline] netdev_start_xmit include/linux/netdevice.h:4932 [inline] xmit_one net/core/dev.c:3543 [inline] dev_hard_start_xmit+0x11b/0x3f0 net/core/dev.c:3559
...
v2: also change wg_packet_consume_data_done() (Hangbin Liu)
and wg_packet_purge_staged_packets()
--- drivers/net/wireguard/device.c | 4 ++-- drivers/net/wireguard/receive.c | 12 ++++++------ drivers/net/wireguard/send.c | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-)
drivers/net/wireguard/device.c +2 -2
@@ -193,7 +193,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)*/ while (skb_queue_len (&peer->staged_packet_queue) >MAX_STAGED_PACKETS ) {dev_kfree_skb (__skb_dequeue (&peer->staged_packet_queue)); - ++dev->stats.tx_dropped; +DEV_STATS_INC (dev, tx_dropped); }skb_queue_splice_tail (&packets, &peer->staged_packet_queue);spin_unlock_bh (&peer->staged_packet_queue.lock);
@@ -211,7 +211,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)else if (skb->protocol ==htons (ETH_P_IPV6 ))icmpv6_ndo_send (skb,ICMPV6_DEST_UNREACH ,ICMPV6_ADDR_UNREACH ,0 ); err: - ++dev->stats.tx_errors; +DEV_STATS_INC (dev, tx_errors);kfree_skb (skb);return ret; }
drivers/net/wireguard/receive.c +6 -6
@@ -423,20 +423,20 @@ static void wg_packet_consume_data_done(struct wg_peer *peer,net_dbg_skb_ratelimited ("%s: Packet has unallowed src IP (%pISc) from peer %llu (%pISpfsc)\n" , dev->name, skb, peer->internal_id, &peer->endpoint.addr); - ++dev->stats.rx_errors; - ++dev->stats.rx_frame_errors; +DEV_STATS_INC (dev, rx_errors); +DEV_STATS_INC (dev, rx_frame_errors); goto packet_processed; dishonest_packet_type:net_dbg_ratelimited ("%s: Packet is neither ipv4 nor ipv6 from peer %llu (%pISpfsc)\n" , dev->name, peer->internal_id, &peer->endpoint.addr); - ++dev->stats.rx_errors; - ++dev->stats.rx_frame_errors; +DEV_STATS_INC (dev, rx_errors); +DEV_STATS_INC (dev, rx_frame_errors); goto packet_processed; dishonest_packet_size:net_dbg_ratelimited ("%s: Packet has incorrect size from peer %llu (%pISpfsc)\n" , dev->name, peer->internal_id, &peer->endpoint.addr); - ++dev->stats.rx_errors; - ++dev->stats.rx_length_errors; +DEV_STATS_INC (dev, rx_errors); +DEV_STATS_INC (dev, rx_length_errors); goto packet_processed; packet_processed:dev_kfree_skb (skb);
drivers/net/wireguard/send.c +2 -1
@@ -333,7 +333,8 @@ static void wg_packet_create_data(struct wg_peer *peer, struct sk_buff *first)void wg_packet_purge_staged_packets (struct wg_peer *peer) {spin_lock_bh (&peer->staged_packet_queue.lock); - peer->device->dev->stats.tx_dropped += peer->staged_packet_queue.qlen; +DEV_STATS_ADD (peer->device->dev, tx_dropped, + peer->staged_packet_queue.qlen);__skb_queue_purge (&peer->staged_packet_queue);spin_unlock_bh (&peer->staged_packet_queue.lock); }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 8/69 octeontx2-pf: Fix memory leak during interface down
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Suman Ghosh <[email protected]>
[ Upstream commit 5f228d7c8a539714c1e9b7e7534f76bb7979f268 ]
During 'ifconfig <netdev> down' one RSS memory was not getting freed. This patch fixes the same.
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_pf.c +2 -0
@@ -1838,6 +1838,8 @@ int otx2_stop(struct net_device *netdev)/* Clear RSS enable flag */ rss = &pf->hw.rss_info; rss->enable = false; +if (!netif_is_rxfh_configured (netdev)) +kfree (rss->rss_ctx[DEFAULT_RSS_CONTEXT_GROUP ]);/* Cleanup Queue IRQ */ vec = pci_irq_vector(pf->pdev,
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 9/69 ata: pata_isapnp: Add missing error check for devm_ioport_map()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chen Ni <[email protected]>
[ Upstream commit a6925165ea82b7765269ddd8dcad57c731aa00de ]
Add missing error return check for devm_ioport_map() and return the error if this function call fails.
--- drivers/ata/pata_isapnp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/ata/pata_isapnp.c +3 -0
@@ -82,6 +82,9 @@ static int isapnp_init_one(struct pnp_dev *idev, const struct pnp_device_id *devif (pnp_port_valid (idev,1 )) { ctl_addr =devm_ioport_map (&idev->dev,pnp_port_start (idev,1 ),1 ); +if (!ctl_addr) +return -ENOMEM ; + ap->ioaddr.altstatus_addr = ctl_addr; ap->ioaddr.ctl_addr = ctl_addr; ap->ops = &isapnp_port_ops;
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainercover 5.15.141-rc1 review
This is the start of the stable review cycle for the 5.15.141 release. There are 69 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 02 Dec 2023 16:21:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.141-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.15.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.15.141-rc1
Keith Busch <[email protected]>
io_uring: fix off-by one bvec index
Johan Hovold <[email protected]>
USB: dwc3: qcom: fix wakeup after probe deferral
Johan Hovold <[email protected]>
USB: dwc3: qcom: fix software node leak on probe errors
Ricardo Ribalda <[email protected]>
usb: dwc3: set the dma max_seg_size
Alexander Stein <[email protected]>
usb: dwc3: Fix default mode initialization
Oliver Neukum <[email protected]>
USB: dwc2: write HCINT with INTMASK applied
Badhri Jagan Sridharan <[email protected]>
usb: typec: tcpm: Skip hard reset when in error recovery
Lech Perczak <[email protected]>
USB: serial: option: don't claim interface 4 for ZTE MF290
Puliang Lu <[email protected]>
USB: serial: option: fix FM101R-GL defines
Victor Fragoso <[email protected]>
USB: serial: option: add Fibocom L7xx modules
Pawel Laszczak <[email protected]>
usb: cdnsp: Fix deadlock issue during using NCM gadget
Mingzhe Zou <[email protected]>
bcache: fixup lock c->root error
Mingzhe Zou <[email protected]>
bcache: fixup init dirty data errors
Rand Deeb <[email protected]>
bcache: prevent potential division by zero error
Coly Li <[email protected]>
bcache: check return value from btree_node_alloc_replacement()
Mikulas Patocka <[email protected]>
dm-delay: fix a race between delay_presuspend and delay_bio
Long Li <[email protected]>
hv_netvsc: Mark VF as slave before exposing it to user-mode
Haiyang Zhang <[email protected]>
hv_netvsc: Fix race of register_netdevice_notifier and VF register
Asuna Yang <[email protected]>
USB: serial: option: add Luat Air72*U series products
Jan Höppner <[email protected]>
s390/dasd: protect device queue against concurrent access
Charles Mirabile <[email protected]>
io_uring/fs: consider link->flags when getting path for LINKAT
Mingzhe Zou <[email protected]>
bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race
Song Liu <[email protected]>
md: fix bi_status reporting in md_end_clone_io
Coly Li <[email protected]>
bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in btree_gc_coalesce()
Keith Busch <[email protected]>
swiotlb-xen: provide the "max_mapping_size" method
Hans de Goede <[email protected]>
ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA
Krister Johansen <[email protected]>
proc: sysctl: prevent aliased sysctls from getting passed to init
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
Zhang Yi <[email protected]>
ext4: make sure allocate pending entry not fail
Baokun Li <[email protected]>
ext4: fix slab-use-after-free in ext4_es_insert_extent()
Baokun Li <[email protected]>
ext4: using nofail preallocation in ext4_es_insert_extent()
Baokun Li <[email protected]>
ext4: using nofail preallocation in ext4_es_insert_delayed_block()
Baokun Li <[email protected]>
ext4: using nofail preallocation in ext4_es_remove_extent()
Baokun Li <[email protected]>
ext4: use pre-allocated es in __es_remove_extent()
Baokun Li <[email protected]>
ext4: use pre-allocated es in __es_insert_extent()
Baokun Li <[email protected]>
ext4: factor out __es_alloc_extent() and __es_free_extent()
Baokun Li <[email protected]>
ext4: add a new helper to check if es must be kept
Andrey Konovalov <[email protected]>
media: qcom: camss: Fix csid-gen2 for test pattern generator
Bryan O'Donoghue <[email protected]>
media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3
Milen Mitkov <[email protected]>
media: camss: sm8250: Virtual channels for CSID
Souptick Joarder (HPE) <[email protected]>
media: camss: Replace hard coded value with parameter
Huacai Chen <[email protected]>
MIPS: KVM: Fix a build warning about variable set but not used
Peter Zijlstra <[email protected]>
lockdep: Fix block chain corruption
Johan Hovold <[email protected]>
USB: dwc3: qcom: fix ACPI platform device leak
Johan Hovold <[email protected]>
USB: dwc3: qcom: fix resource leaks on probe deferral
Christoph Hellwig <[email protected]>
nvmet: nul-terminate the NQNs passed in the connect command
David Howells <[email protected]>
afs: Fix file locking on R/O volumes to operate in local mode
David Howells <[email protected]>
afs: Return ENOENT if no cell DNS record can be found
Samuel Holland <[email protected]>
net: axienet: Fix check for partial TX checksum
Raju Rangoju <[email protected]>
amd-xgbe: propagate the correct speed and duplex status
Raju Rangoju <[email protected]>
amd-xgbe: handle the corner-case during tx completion
Raju Rangoju <[email protected]>
amd-xgbe: handle corner-case during sfp hotplug
Suman Ghosh <[email protected]>
octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PF
Stefano Stabellini <[email protected]>
arm/xen: fix xen_vcpu_info allocation alignment
D. Wythe <[email protected]>
net/smc: avoid data corruption caused by decline
Jose Ignacio Tornos Martinez <[email protected]>
net: usb: ax88179_178a: fix failed operations during ax88179_reset
Kunwu Chan <[email protected]>
ipv4: Correct/silence an endian warning in __ip_do_redirect
Charles Yi <[email protected]>
HID: fix HID device resource race between HID core and debugging support
Benjamin Tissoires <[email protected]>
HID: core: store the unique system identifier in hid_device
Jonas Karlman <[email protected]>
drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP full
Chen Ni <[email protected]>
ata: pata_isapnp: Add missing error check for devm_ioport_map()
Suman Ghosh <[email protected]>
octeontx2-pf: Fix memory leak during interface down
Eric Dumazet <[email protected]>
wireguard: use DEV_STATS_INC()
Marek Vasut <[email protected]>
drm/panel: simple: Fix Innolux G101ICE-L01 timings
Marek Vasut <[email protected]>
drm/panel: simple: Fix Innolux G101ICE-L01 bus flags
Xuxin Xiong <[email protected]>
drm/panel: auo,b101uan08.3: Fine tune the panel power sequence
Shuijing Li <[email protected]>
drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequence
David Howells <[email protected]>
afs: Make error on cell lookup failure consistent with OpenAFS
David Howells <[email protected]>
afs: Fix afs_server_list to be cleaned up with RCU
-------------
Diffstat:
Makefile | 4 +- arch/arm/xen/enlighten.c | 3 +- arch/mips/kvm/mmu.c | 3 +- drivers/acpi/resource.c | 7 + drivers/ata/pata_isapnp.c | 3 + drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 + drivers/gpu/drm/panel/panel-simple.c | 13 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 14 +- drivers/hid/hid-core.c | 16 +- drivers/hid/hid-debug.c | 3 + drivers/md/bcache/btree.c | 4 +- drivers/md/bcache/sysfs.c | 2 +- drivers/md/bcache/writeback.c | 22 +- drivers/md/dm-delay.c | 17 +- drivers/md/md.c | 3 +- drivers/media/platform/qcom/camss/camss-csid-170.c | 65 +++-- drivers/media/platform/qcom/camss/camss-csid.c | 44 ++- drivers/media/platform/qcom/camss/camss-csid.h | 11 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 14 + drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 11 +- drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 14 +- .../ethernet/marvell/octeontx2/nic/otx2_flows.c | 20 +- .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +- drivers/net/hyperv/netvsc_drv.c | 41 ++- drivers/net/usb/ax88179_178a.c | 4 +- drivers/net/wireguard/device.c | 4 +- drivers/net/wireguard/receive.c | 12 +- drivers/net/wireguard/send.c | 3 +- drivers/nvme/target/fabrics-cmd.c | 4 + drivers/s390/block/dasd.c | 24 +- drivers/usb/cdns3/cdnsp-ring.c | 3 + drivers/usb/dwc2/hcd_intr.c | 15 +- drivers/usb/dwc3/core.c | 2 + drivers/usb/dwc3/drd.c | 2 +- drivers/usb/dwc3/dwc3-qcom.c | 65 +++-- drivers/usb/serial/option.c | 11 +- drivers/usb/typec/tcpm/tcpm.c | 9 + drivers/xen/swiotlb-xen.c | 1 + fs/afs/dynroot.c | 4 +- fs/afs/internal.h | 1 + fs/afs/server_list.c | 2 +- fs/afs/super.c | 2 + fs/afs/vl_rotate.c | 10 + fs/ext4/extents_status.c | 306 +++++++++++++++------ fs/proc/proc_sysctl.c | 7 + include/linux/hid.h | 5 + include/linux/sysctl.h | 6 + init/main.c | 4 + io_uring/io_uring.c | 4 +- kernel/locking/lockdep.c | 3 +- kernel/trace/trace_kprobe.c | 74 +++++ kernel/trace/trace_probe.h | 1 + net/ipv4/route.c | 2 +- net/smc/af_smc.c | 8 +- 55 files changed, 704 insertions(+), 239 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 22/69 afs: Return ENOENT if no cell DNS record can be found
5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit 0167236e7d66c5e1e85d902a6abc2529b7544539 ]
Make AFS return error ENOENT if no cell SRV or AFSDB DNS record (or cellservdb config file record) can be found rather than returning EDESTADDRREQ.
Also add cell name lookup info to the cursor dump.
--- fs/afs/vl_rotate.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
fs/afs/vl_rotate.c +10 -0
@@ -58,6 +58,12 @@ static bool afs_start_vl_iteration(struct afs_vl_cursor *vc) }/* Status load is ordered after lookup counter load */ +if (cell->dns_status ==DNS_LOOKUP_GOT_NOT_FOUND ) { +pr_warn ("No record of cell %s\n" , cell->name); + vc->error = -ENOENT ; +return false; + } +if (cell->dns_source ==DNS_RECORD_UNAVAILABLE ) { vc->error = -EDESTADDRREQ ;return false;
@@ -285,6 +291,7 @@ bool afs_select_vlserver(struct afs_vl_cursor *vc)*/ static void afs_vl_dump_edestaddrreq (const struct afs_vl_cursor *vc) { +struct afs_cell *cell = vc->cell;static int count;int i;
@@ -294,6 +301,9 @@ static void afs_vl_dump_edestaddrreq(const struct afs_vl_cursor *vc)rcu_read_lock ();pr_notice ("EDESTADDR occurred\n" ); +pr_notice ("CELL: %s err=%d\n" , cell->name, cell->error); +pr_notice ("DNS: src=%u st=%u lc=%x\n" , + cell->dns_source, cell->dns_status, cell->dns_lookup_count);pr_notice ("VC: ut=%lx ix=%u ni=%hu fl=%hx err=%hd\n" , vc->untried, vc->index, vc->nr_iterations, vc->flags, vc->error);
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 31/69 media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bryan O'Donoghue <[email protected]>
[ Upstream commit e655d1ae9703286cef7fda8675cad62f649dc183 ]
VC_MODE = 0 implies a two bit VC address.VC_MODE = 1 is required for VCs with a larger address than two bits.
--- drivers/media/platform/qcom/camss/camss-csid-170.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/media/platform/qcom/camss/camss-csid-170.c +2 -0
@@ -442,6 +442,8 @@ static void __csid_configure_stream(struct csid_device *csid, u8 enable, u8 vc)writel_relaxed (val, csid->base +CSID_CSI2_RX_CFG0 ); val =1 <<CSI2_RX_CFG1_PACKET_ECC_CORRECTION_EN ; +if (vc >3 ) + val |=1 <<CSI2_RX_CFG1_VC_MODE ; val |=1 <<CSI2_RX_CFG1_MISR_EN ;writel_relaxed (val, csid->base +CSID_CSI2_RX_CFG1 );// csi2_vc_mode_shift_val ?
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 32/69 media: qcom: camss: Fix csid-gen2 for test pattern generator
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Konovalov <[email protected]>
[ Upstream commit 87889f1b7ea40d2544b49c62092e6ef2792dced7 ]
In the current driver csid Test Pattern Generator (TPG) doesn't work. This change:
- fixes writing frame width and height values into CSID_TPG_DT_n_CFG_0
- fixes the shift by one between test_pattern control value and the actual pattern.
- drops fixed VC of 0x0a which testing showed prohibited some test patterns in the CSID to produce output.
So that TPG starts working, but with the below limitations:
- only test_pattern=9 works as it should
- test_pattern=8 and test_pattern=7 produce black frame (all zeroes)
- the rest of test_pattern's don't work (yavta doesn't get the data)
- regardless of the CFA pattern set by 'media-ctl -V' the actual pixel order is always the same (RGGB for any RAW8 or RAW10P format in 4608x2592 resolution).
Tested with:
RAW10P format, VC0:
media-ctl -V '"msm_csid0":0[fmt:SRGGB10/4608x2592 field:none]' media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB10/4608x2592 field:none]' media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
v4l2-ctl -d /dev/v4l-subdev6 -c test_pattern=9
yavta -B capture-mplane --capture=3 -n 3 -f SRGGB10P -s 4608x2592 /dev/video0
RAW10P format, VC1:
media-ctl -V '"msm_csid0":2[fmt:SRGGB10/4608x2592 field:none]' media-ctl -V '"msm_vfe0_rdi1":0[fmt:SRGGB10/4608x2592 field:none]' media-ctl -l '"msm_csid0":2->"msm_vfe0_rdi1":0[1]'
v4l2-ctl -d /dev/v4l-subdev6 -c test_pattern=9
yavta -B capture-mplane --capture=3 -n 3 -f SRGGB10P -s 4608x2592 /dev/video1
RAW8 format, VC0:
media-ctl --reset
media-ctl -V '"msm_csid0":0[fmt:SRGGB8/4608x2592 field:none]' media-ctl -V '"msm_vfe0_rdi0":0[fmt:SRGGB8/4608x2592 field:none]' media-ctl -l '"msm_csid0":1->"msm_vfe0_rdi0":0[1]'
yavta -B capture-mplane --capture=3 -n 3 -f SRGGB8 -s 4608x2592 /dev/video0
--- drivers/media/platform/qcom/camss/camss-csid-170.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-)
drivers/media/platform/qcom/camss/camss-csid-170.c +3 -6
@@ -348,9 +348,6 @@ static void __csid_configure_stream(struct csid_device *csid, u8 enable, u8 vc)u8 dt_id = vc;if (tg->enabled) { -/* Config Test Generator */ - vc =0xa ; -/* configure one DT, infinite frames */ val = vc <<TPG_VC_CFG0_VC_NUM ; val |=INTELEAVING_MODE_ONE_SHOT <<TPG_VC_CFG0_LINE_INTERLEAVING_MODE ;
@@ -363,14 +360,14 @@ static void __csid_configure_stream(struct csid_device *csid, u8 enable, u8 vc)writel_relaxed (0x12345678 , csid->base +CSID_TPG_LFSR_SEED ); - val = input_format->height &0x1fff << TPG_DT_n_CFG_0_FRAME_HEIGHT; - val |= input_format->width &0x1fff << TPG_DT_n_CFG_0_FRAME_WIDTH; + val = (input_format->height &0x1fff ) << TPG_DT_n_CFG_0_FRAME_HEIGHT; + val |= (input_format->width &0x1fff ) << TPG_DT_n_CFG_0_FRAME_WIDTH;writel_relaxed (val, csid->base +CSID_TPG_DT_n_CFG_0 (0 )); val = format->data_type << TPG_DT_n_CFG_1_DATA_TYPE;writel_relaxed (val, csid->base +CSID_TPG_DT_n_CFG_1 (0 )); - val = tg->mode << TPG_DT_n_CFG_2_PAYLOAD_MODE; + val = (tg->mode -1 ) << TPG_DT_n_CFG_2_PAYLOAD_MODE; val |=0xBE << TPG_DT_n_CFG_2_USER_SPECIFIED_PAYLOAD; val |= format->decode_format << TPG_DT_n_CFG_2_ENCODE_FORMAT;writel_relaxed (val, csid->base +CSID_TPG_DT_n_CFG_2 (0 ));
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 33/69 ext4: add a new helper to check if es must be kept
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 9649eb18c6288f514cacffdd699d5cd999c2f8f6 ]
In the extent status tree, we have extents which we can just drop without issues and extents we must not drop - this depends on the extent's status
- currently ext4_es_is_delayed() extents must stay, others may be dropped.
A helper function is added to help determine if the current extent can be dropped, although only ext4_es_is_delayed() extents cannot be dropped currently.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-)
fs/ext4/extents_status.c +21 -13
@@ -448,6 +448,19 @@ static void ext4_es_list_del(struct inode *inode)spin_unlock (&sbi->s_es_lock); } +/* +* Returns true if we cannot fail to allocate memory for this extent_status +* entry and cannot reclaim it until its status changes. +*/ +static inline bool ext4_es_must_keep (struct extent_status *es) +{ +/* fiemap, bigalloc, and seek_data/hole need to use it. */ +if (ext4_es_is_delayed (es)) +return true; + +return false; +} +static struct extent_status *ext4_es_alloc_extent (struct inode *inode,ext4_lblk_t lblk,ext4_lblk_t len,ext4_fsblk_t pblk)
@@ -460,10 +473,8 @@ ext4_es_alloc_extent(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len, es->es_len = len; es->es_pblk = pblk; -/* -* We don't count delayed extent because we never try to reclaim them -*/ - if (!ext4_es_is_delayed(es)) { +/* We never try to reclaim a must kept extent, so we don't count it. */ + if (!ext4_es_must_keep(es)) { if (!EXT4_I(inode)->i_es_shk_nr++) ext4_es_list_add(inode); percpu_counter_inc(&EXT4_SB(inode->i_sb)->
@@ -481,8 +492,8 @@ static void ext4_es_free_extent(struct inode *inode, struct extent_status *es)EXT4_I (inode)->i_es_all_nr--;percpu_counter_dec (&EXT4_SB (inode->i_sb)->s_es_stats.es_stats_all_cnt); -/* Decrease the shrink counter when this es is not delayed */ -if (!ext4_es_is_delayed (es)) { +/* Decrease the shrink counter when we can reclaim the extent. */ +if (!ext4_es_must_keep (es)) {BUG_ON (EXT4_I (inode)->i_es_shk_nr ==0 );if (!--EXT4_I (inode)->i_es_shk_nr)ext4_es_list_del (inode);
@@ -854,7 +865,7 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,if (err == -ENOMEM &&__es_shrink (EXT4_SB (inode->i_sb),128 ,EXT4_I (inode))) goto retry; -if (err == -ENOMEM && !ext4_es_is_delayed (&newes)) +if (err == -ENOMEM && !ext4_es_must_keep (&newes)) err =0 ; if (sbi->s_cluster_ratio > 1 && test_opt(inode->i_sb, DELALLOC) &&
@@ -1704,11 +1715,8 @@ static int es_do_reclaim_extents(struct ext4_inode_info *ei, ext4_lblk_t end, (*nr_to_scan)--; node =rb_next (&es->rb_node); -/* -* We can't reclaim delayed extent from status tree because -* fiemap, bigallic, and seek_data/hole need to use it. -*/ -if (ext4_es_is_delayed (es)) + +if (ext4_es_must_keep (es)) goto next;if (ext4_es_is_referenced (es)) {ext4_es_clear_referenced (es);
@@ -1772,7 +1780,7 @@ void ext4_clear_inode_es(struct inode *inode)while (node) { es = rb_entry(node, struct extent_status, rb_node); node =rb_next (node); -if (!ext4_es_is_delayed (es)) { +if (!ext4_es_must_keep (es)) {rb_erase (&es->rb_node, &tree->root);ext4_es_free_extent (inode, es); }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 34/69 ext4: factor out __es_alloc_extent() and __es_free_extent()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 73a2f033656be11298912201ad50615307b4477a ]
Factor out __es_alloc_extent() and __es_free_extent(), which only allocate and free extent_status in these two helpers.
The ext4_es_alloc_extent() function is split into __es_alloc_extent() and ext4_es_init_extent(). In __es_alloc_extent() we allocate memory using GFP_KERNEL | __GFP_NOFAIL | __GFP_ZERO if the memory allocation cannot fail, otherwise we use GFP_ATOMIC. and the ext4_es_init_extent() is used to initialize extent_status and update related variables after a successful allocation.
This is to prepare for the use of pre-allocated extent_status later.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 30 +++++++++++++++++++----------- 1 file changed, 19 insertions(+), 11 deletions(-)
fs/ext4/extents_status.c +19 -11
@@ -461,14 +461,17 @@ static inline bool ext4_es_must_keep(struct extent_status *es)return false; } -static struct extent_status * -ext4_es_alloc_extent (struct inode *inode,ext4_lblk_t lblk,ext4_lblk_t len, -ext4_fsblk_t pblk) +static inline struct extent_status *__es_alloc_extent (bool nofail) +{ +if (!nofail) +return kmem_cache_alloc (ext4_es_cachep,GFP_ATOMIC ); + +return kmem_cache_zalloc (ext4_es_cachep,GFP_KERNEL | __GFP_NOFAIL); +} + +static void ext4_es_init_extent (struct inode *inode,struct extent_status *es, +ext4_lblk_t lblk,ext4_lblk_t len,ext4_fsblk_t pblk) { -struct extent_status *es; - es =kmem_cache_alloc (ext4_es_cachep,GFP_ATOMIC ); -if (es ==NULL ) -return NULL ; es->es_lblk = lblk; es->es_len = len; es->es_pblk = pblk;
@@ -483,8 +486,11 @@ ext4_es_alloc_extent(struct inode *inode, ext4_lblk_t lblk, ext4_lblk_t len,EXT4_I (inode)->i_es_all_nr++;percpu_counter_inc (&EXT4_SB (inode->i_sb)->s_es_stats.es_stats_all_cnt); +} -return es; +static inline void __es_free_extent (struct extent_status *es) +{ +kmem_cache_free (ext4_es_cachep, es); }static void ext4_es_free_extent (struct inode *inode,struct extent_status *es)
@@ -501,7 +507,7 @@ static void ext4_es_free_extent(struct inode *inode, struct extent_status *es) s_es_stats.es_stats_shk_cnt); } -kmem_cache_free (ext4_es_cachep, es); +__es_free_extent (es); }/*
@@ -803,10 +809,12 @@ static int __es_insert_extent(struct inode *inode, struct extent_status *newes) } } - es =ext4_es_alloc_extent (inode, newes->es_lblk, newes->es_len, - newes->es_pblk); + es =__es_alloc_extent (false);if (!es)return -ENOMEM ; +ext4_es_init_extent (inode, es, newes->es_lblk, newes->es_len, + newes->es_pblk); +rb_link_node (&es->rb_node, parent, p);rb_insert_color (&es->rb_node, &tree->root);
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 35/69 ext4: use pre-allocated es in __es_insert_extent()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 95f0b320339a977cf69872eac107122bf536775d ]
Pass a extent_status pointer prealloc to __es_insert_extent(). If the pointer is non-null, it is used directly when a new extent_status is needed to avoid memory allocation failures.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-)
fs/ext4/extents_status.c +12 -7
@@ -144,7 +144,8 @@static struct kmem_cache *ext4_es_cachep;static struct kmem_cache *ext4_pending_cachep; -static int __es_insert_extent (struct inode *inode,struct extent_status *newes); +static int __es_insert_extent (struct inode *inode,struct extent_status *newes, +struct extent_status *prealloc);static int __es_remove_extent (struct inode *inode,ext4_lblk_t lblk,ext4_lblk_t end,int *reserved);static int es_reclaim_extents (struct ext4_inode_info *ei,int *nr_to_scan);
@@ -769,7 +770,8 @@ static inline void ext4_es_insert_extent_check(struct inode *inode, }#endif -static int __es_insert_extent (struct inode *inode,struct extent_status *newes) +static int __es_insert_extent (struct inode *inode,struct extent_status *newes, +struct extent_status *prealloc) {struct ext4_es_tree *tree = &EXT4_I (inode)->i_es_tree;struct rb_node **p = &tree->root.rb_node;
@@ -809,7 +811,10 @@ static int __es_insert_extent(struct inode *inode, struct extent_status *newes) } } - es =__es_alloc_extent (false); +if (prealloc) + es = prealloc; +else + es =__es_alloc_extent (false);if (!es)return -ENOMEM ; ext4_es_init_extent(inode, es, newes->es_lblk, newes->es_len,
@@ -869,7 +874,7 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,if (err !=0 ) goto error; retry: - err =__es_insert_extent (inode, &newes); + err =__es_insert_extent (inode, &newes,NULL );if (err == -ENOMEM &&__es_shrink (EXT4_SB (inode->i_sb),128 ,EXT4_I (inode))) goto retry;
@@ -919,7 +924,7 @@ void ext4_es_cache_extent(struct inode *inode, ext4_lblk_t lblk, es =__es_tree_search (&EXT4_I (inode)->i_es_tree.root, lblk);if (!es || es->es_lblk > end) -__es_insert_extent (inode, &newes); +__es_insert_extent (inode, &newes,NULL );write_unlock (&EXT4_I (inode)->i_es_lock); }
@@ -1365,7 +1370,7 @@ static int __es_remove_extent(struct inode *inode, ext4_lblk_t lblk, orig_es.es_len - len2;ext4_es_store_pblock_status (&newes, block,ext4_es_status (&orig_es)); - err =__es_insert_extent (inode, &newes); + err =__es_insert_extent (inode, &newes,NULL );if (err) { es->es_lblk = orig_es.es_lblk; es->es_len = orig_es.es_len;
@@ -2020,7 +2025,7 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk,if (err !=0 ) goto error; retry: - err =__es_insert_extent (inode, &newes); + err =__es_insert_extent (inode, &newes,NULL );if (err == -ENOMEM &&__es_shrink (EXT4_SB (inode->i_sb),128 ,EXT4_I (inode))) goto retry;
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 36/69 ext4: use pre-allocated es in __es_remove_extent()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit bda3efaf774fb687c2b7a555aaec3006b14a8857 ]
When splitting extent, if the second extent can not be dropped, we return -ENOMEM and use GFP_NOFAIL to preallocate an extent_status outside of i_es_lock and pass it to __es_remove_extent() to be used as the second extent. This ensures that __es_remove_extent() is executed successfully, thus ensuring consistency in the extent status tree. If the second extent is not undroppable, we simply drop it and return 0. Then retry is no longer necessary, remove it.
Now, __es_remove_extent() will always remove what it should, maybe more.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-)
fs/ext4/extents_status.c +13 -13
@@ -147,7 +147,8 @@ static struct kmem_cache *ext4_pending_cachep;static int __es_insert_extent (struct inode *inode,struct extent_status *newes,struct extent_status *prealloc);static int __es_remove_extent (struct inode *inode,ext4_lblk_t lblk, -ext4_lblk_t end,int *reserved); +ext4_lblk_t end,int *reserved, +struct extent_status *prealloc);static int es_reclaim_extents (struct ext4_inode_info *ei,int *nr_to_scan);static int __es_shrink (struct ext4_sb_info *sbi,int nr_to_scan,struct ext4_inode_info *locked_ei);
@@ -870,7 +871,7 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,ext4_es_insert_extent_check (inode, &newes);write_lock (&EXT4_I (inode)->i_es_lock); - err =__es_remove_extent (inode, lblk, end,NULL ); + err =__es_remove_extent (inode, lblk, end,NULL ,NULL );if (err !=0 ) goto error; retry:
@@ -1314,6 +1315,7 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end,* @lblk - first block in range * @end - last block in range * @reserved - number of cluster reservations released +* @prealloc - pre-allocated es to avoid memory allocation failures * * If @reserved is not NULL and delayed allocation is enabled, counts * block/cluster reservations freed by removing range and if bigalloc
@@ -1321,7 +1323,8 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end,* error code on failure. */ static int __es_remove_extent (struct inode *inode,ext4_lblk_t lblk, -ext4_lblk_t end,int *reserved) +ext4_lblk_t end,int *reserved, +struct extent_status *prealloc) {struct ext4_es_tree *tree = &EXT4_I (inode)->i_es_tree;struct rb_node *node;
@@ -1329,14 +1332,12 @@ static int __es_remove_extent(struct inode *inode, ext4_lblk_t lblk,struct extent_status orig_es;ext4_lblk_t len1, len2;ext4_fsblk_t block; -int err; +int err =0 ;bool count_reserved = true;struct rsvd_count rc;if (reserved ==NULL || !test_opt (inode->i_sb,DELALLOC )) count_reserved = false; -retry: - err =0 ; es =__es_tree_search (&tree->root, lblk);if (!es)
@@ -1370,14 +1371,13 @@ static int __es_remove_extent(struct inode *inode, ext4_lblk_t lblk, orig_es.es_len - len2;ext4_es_store_pblock_status (&newes, block,ext4_es_status (&orig_es)); - err =__es_insert_extent (inode, &newes,NULL ); + err =__es_insert_extent (inode, &newes, prealloc);if (err) { +if (!ext4_es_must_keep (&newes)) +return 0 ; + es->es_lblk = orig_es.es_lblk; es->es_len = orig_es.es_len; -if ((err == -ENOMEM ) && -__es_shrink (EXT4_SB (inode->i_sb), -128 ,EXT4_I (inode))) - goto retry; goto out; } }else {
@@ -1477,7 +1477,7 @@ int ext4_es_remove_extent(struct inode *inode, ext4_lblk_t lblk,* is reclaimed. */ write_lock (&EXT4_I (inode)->i_es_lock); - err =__es_remove_extent (inode, lblk, end, &reserved); + err =__es_remove_extent (inode, lblk, end, &reserved,NULL );write_unlock (&EXT4_I (inode)->i_es_lock);ext4_es_print_tree (inode);ext4_da_release_space (inode, reserved);
@@ -2021,7 +2021,7 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk,write_lock (&EXT4_I (inode)->i_es_lock); - err =__es_remove_extent (inode, lblk, lblk,NULL ); + err =__es_remove_extent (inode, lblk, lblk,NULL ,NULL );if (err !=0 ) goto error; retry:
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 37/69 ext4: using nofail preallocation in ext4_es_remove_extent()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit e9fe2b882bd5b26b987c9ba110c2222796f72af5 ]
If __es_remove_extent() returns an error it means that when splitting extent, allocating an extent that must be kept failed, where returning an error directly would cause the extent tree to be inconsistent. So we use GFP_NOFAIL to pre-allocate an extent_status and pass it to __es_remove_extent() to avoid this problem.
In addition, since the allocated memory is outside the i_es_lock, the extent_status tree may change and the pre-allocated extent_status is no longer needed, so we release the pre-allocated extent_status when es->es_len is not initialized.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-)
fs/ext4/extents_status.c +11 -2
@@ -1457,6 +1457,7 @@ int ext4_es_remove_extent(struct inode *inode, ext4_lblk_t lblk,ext4_lblk_t end;int err =0 ;int reserved =0 ; +struct extent_status *es =NULL ;if (EXT4_SB (inode->i_sb)->s_mount_state &EXT4_FC_REPLAY )return 0 ;
@@ -1471,17 +1472,25 @@ int ext4_es_remove_extent(struct inode *inode, ext4_lblk_t lblk, end = lblk + len -1 ;BUG_ON (end < lblk); +retry: +if (err && !es) + es =__es_alloc_extent (true);/* * ext4_clear_inode() depends on us taking i_es_lock unconditionally * so that we are sure __es_shrink() is done with the inode before it * is reclaimed. */ write_lock (&EXT4_I (inode)->i_es_lock); - err =__es_remove_extent (inode, lblk, end, &reserved,NULL ); + err =__es_remove_extent (inode, lblk, end, &reserved, es); +if (es && !es->es_len) +__es_free_extent (es);write_unlock (&EXT4_I (inode)->i_es_lock); +if (err) + goto retry; +ext4_es_print_tree (inode);ext4_da_release_space (inode, reserved); -return err; +return 0 ; } static int __es_shrink(struct ext4_sb_info *sbi, int nr_to_scan,
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 38/69 ext4: using nofail preallocation in ext4_es_insert_delayed_block()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 4a2d98447b37bcb68a7f06a1078edcb4f7e6ce7e ]
Similar to in ext4_es_remove_extent(), we use a no-fail preallocation to avoid inconsistencies, except that here we may have to preallocate two extent_status.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 33 ++++++++++++++++++++++----------- 1 file changed, 22 insertions(+), 11 deletions(-)
fs/ext4/extents_status.c +22 -11
@@ -2013,7 +2013,10 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, bool allocated) {struct extent_status newes; -int err =0 ; +int err1 =0 ; +int err2 =0 ; +struct extent_status *es1 =NULL ; +struct extent_status *es2 =NULL ;if (EXT4_SB (inode->i_sb)->s_mount_state &EXT4_FC_REPLAY )return 0 ;
@@ -2028,29 +2031,37 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk,ext4_es_insert_extent_check (inode, &newes); +retry: +if (err1 && !es1) + es1 =__es_alloc_extent (true); +if ((err1 || err2) && !es2) + es2 =__es_alloc_extent (true);write_lock (&EXT4_I (inode)->i_es_lock); - err =__es_remove_extent (inode, lblk, lblk,NULL ,NULL ); -if (err !=0 ) + err1 =__es_remove_extent (inode, lblk, lblk,NULL , es1); +if (err1 !=0 ) goto error; -retry: - err =__es_insert_extent (inode, &newes,NULL ); -if (err == -ENOMEM &&__es_shrink (EXT4_SB (inode->i_sb), -128 ,EXT4_I (inode))) - goto retry; -if (err !=0 ) + + err2 =__es_insert_extent (inode, &newes, es2); +if (err2 !=0 ) goto error;if (allocated)__insert_pending (inode, lblk); +/* es is pre-allocated but not used, free it. */ +if (es1 && !es1->es_len) +__es_free_extent (es1); +if (es2 && !es2->es_len) +__es_free_extent (es2); error:write_unlock (&EXT4_I (inode)->i_es_lock); +if (err1 || err2) + goto retry;ext4_es_print_tree (inode);ext4_print_pending_tree (inode); - -return err; +return 0 ; }/*
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 39/69 ext4: using nofail preallocation in ext4_es_insert_extent()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 2a69c450083db164596c75c0f5b4d9c4c0e18eba ]
Similar to in ext4_es_insert_delayed_block(), we use preallocations that do not fail to avoid inconsistencies, but we do not care about es that are not must be kept, and we return 0 even if such es memory allocation fails.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 38 ++++++++++++++++++++++++++------------ 1 file changed, 26 insertions(+), 12 deletions(-)
fs/ext4/extents_status.c +26 -12
@@ -841,8 +841,11 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, {struct extent_status newes;ext4_lblk_t end = lblk + len -1 ; -int err =0 ; +int err1 =0 ; +int err2 =0 ;struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb); +struct extent_status *es1 =NULL ; +struct extent_status *es2 =NULL ;if (EXT4_SB (inode->i_sb)->s_mount_state &EXT4_FC_REPLAY )return 0 ;
@@ -870,29 +873,40 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,ext4_es_insert_extent_check (inode, &newes); +retry: +if (err1 && !es1) + es1 =__es_alloc_extent (true); +if ((err1 || err2) && !es2) + es2 =__es_alloc_extent (true);write_lock (&EXT4_I (inode)->i_es_lock); - err =__es_remove_extent (inode, lblk, end,NULL ,NULL ); -if (err !=0 ) + + err1 =__es_remove_extent (inode, lblk, end,NULL , es1); +if (err1 !=0 ) + goto error; + + err2 =__es_insert_extent (inode, &newes, es2); +if (err2 == -ENOMEM && !ext4_es_must_keep (&newes)) + err2 =0 ; +if (err2 !=0 ) goto error; -retry: - err =__es_insert_extent (inode, &newes,NULL ); -if (err == -ENOMEM &&__es_shrink (EXT4_SB (inode->i_sb), -128 ,EXT4_I (inode))) - goto retry; -if (err == -ENOMEM && !ext4_es_must_keep (&newes)) - err =0 ;if (sbi->s_cluster_ratio >1 &&test_opt (inode->i_sb,DELALLOC ) && (status &EXTENT_STATUS_WRITTEN || status &EXTENT_STATUS_UNWRITTEN ))__revise_pending (inode, lblk, len); +/* es is pre-allocated but not used, free it. */ +if (es1 && !es1->es_len) +__es_free_extent (es1); +if (es2 && !es2->es_len) +__es_free_extent (es2); error:write_unlock (&EXT4_I (inode)->i_es_lock); +if (err1 || err2) + goto retry;ext4_es_print_tree (inode); - -return err; +return 0 ; }/*
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 40/69 ext4: fix slab-use-after-free in ext4_es_insert_extent()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Baokun Li <[email protected]>
[ Upstream commit 768d612f79822d30a1e7d132a4d4b05337ce42ec ]
Yikebaer reported an issue:
==================================================================
BUG: KASAN: slab-use-after-free in ext4_es_insert_extent+0xc68/0xcb0 fs/ext4/extents_status.c:894 Read of size 4 at addr ffff888112ecc1a4 by task syz-executor/8438 CPU: 1 PID: 8438 Comm: syz-executor Not tainted 6.5.0-rc5 #1 Call Trace: [...] kasan_report+0xba/0xf0 mm/kasan/report.c:588 ext4_es_insert_extent+0xc68/0xcb0 fs/ext4/extents_status.c:894 ext4_map_blocks+0x92a/0x16f0 fs/ext4/inode.c:680 ext4_alloc_file_blocks.isra.0+0x2df/0xb70 fs/ext4/extents.c:4462 ext4_zero_range fs/ext4/extents.c:4622 [inline] ext4_fallocate+0x251c/0x3ce0 fs/ext4/extents.c:4721 [...] Allocated by task 8438: [...] kmem_cache_zalloc include/linux/slab.h:693 [inline] __es_alloc_extent fs/ext4/extents_status.c:469 [inline] ext4_es_insert_extent+0x672/0xcb0 fs/ext4/extents_status.c:873 ext4_map_blocks+0x92a/0x16f0 fs/ext4/inode.c:680 ext4_alloc_file_blocks.isra.0+0x2df/0xb70 fs/ext4/extents.c:4462 ext4_zero_range fs/ext4/extents.c:4622 [inline] ext4_fallocate+0x251c/0x3ce0 fs/ext4/extents.c:4721 [...] Freed by task 8438: [...] kmem_cache_free+0xec/0x490 mm/slub.c:3823 ext4_es_try_to_merge_right fs/ext4/extents_status.c:593 [inline] __es_insert_extent+0x9f4/0x1440 fs/ext4/extents_status.c:802 ext4_es_insert_extent+0x2ca/0xcb0 fs/ext4/extents_status.c:882 ext4_map_blocks+0x92a/0x16f0 fs/ext4/inode.c:680 ext4_alloc_file_blocks.isra.0+0x2df/0xb70 fs/ext4/extents.c:4462 ext4_zero_range fs/ext4/extents.c:4622 [inline] ext4_fallocate+0x251c/0x3ce0 fs/ext4/extents.c:4721 [...] ==================================================================
The flow of issue triggering is as follows:
1. remove es
raw es es removed es1
|-------------------| -> |----|.......|------|
2. insert es
es insert es1 merge with es es1 merge with es and free es1
|----|.......|------| -> |------------|------| -> |-------------------|
es merges with newes, then merges with es1, frees es1, then determines if es1->es_len is 0 and triggers a UAF.
The code flow is as follows:ext4_es_insert_extent
es1 = __es_alloc_extent(true);
es2 = __es_alloc_extent(true);
__es_remove_extent(inode, lblk, end, NULL, es1)
__es_insert_extent(inode, &newes, es1) ---> insert es1 to es tree
__es_insert_extent(inode, &newes, es2)
ext4_es_try_to_merge_right
ext4_es_free_extent(inode, es1) ---> es1 is freed
if (es1 && !es1->es_len)
// Trigger UAF by determining if es1 is used.We determine whether es1 or es2 is used immediately after calling __es_remove_extent() or __es_insert_extent() to avoid triggering a UAF if es1 or es2 is freed.
Stable-dep-of: 8e387c89e96b ("ext4: make sure allocate pending entry not fail")
--- fs/ext4/extents_status.c | 44 +++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 14 deletions(-)
fs/ext4/extents_status.c +30 -14
@@ -883,23 +883,29 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, err1 =__es_remove_extent (inode, lblk, end,NULL , es1);if (err1 !=0 ) goto error; +/* Free preallocated extent if it didn't get used. */ +if (es1) { +if (!es1->es_len) +__es_free_extent (es1); + es1 =NULL ; + } err2 =__es_insert_extent (inode, &newes, es2);if (err2 == -ENOMEM && !ext4_es_must_keep (&newes)) err2 =0 ;if (err2 !=0 ) goto error; +/* Free preallocated extent if it didn't get used. */ +if (es2) { +if (!es2->es_len) +__es_free_extent (es2); + es2 =NULL ; + }if (sbi->s_cluster_ratio >1 &&test_opt (inode->i_sb,DELALLOC ) && (status &EXTENT_STATUS_WRITTEN || status &EXTENT_STATUS_UNWRITTEN ))__revise_pending (inode, lblk, len); - -/* es is pre-allocated but not used, free it. */ -if (es1 && !es1->es_len) -__es_free_extent (es1); -if (es2 && !es2->es_len) -__es_free_extent (es2); error:write_unlock (&EXT4_I (inode)->i_es_lock);if (err1 || err2)
@@ -1496,8 +1502,12 @@ int ext4_es_remove_extent(struct inode *inode, ext4_lblk_t lblk,*/ write_lock (&EXT4_I (inode)->i_es_lock); err =__es_remove_extent (inode, lblk, end, &reserved, es); -if (es && !es->es_len) -__es_free_extent (es); +/* Free preallocated extent if it didn't get used. */ +if (es) { +if (!es->es_len) +__es_free_extent (es); + es =NULL ; + }write_unlock (&EXT4_I (inode)->i_es_lock);if (err) goto retry;
@@ -2055,19 +2065,25 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, err1 =__es_remove_extent (inode, lblk, lblk,NULL , es1);if (err1 !=0 ) goto error; +/* Free preallocated extent if it didn't get used. */ +if (es1) { +if (!es1->es_len) +__es_free_extent (es1); + es1 =NULL ; + } err2 =__es_insert_extent (inode, &newes, es2);if (err2 !=0 ) goto error; +/* Free preallocated extent if it didn't get used. */ +if (es2) { +if (!es2->es_len) +__es_free_extent (es2); + es2 =NULL ; + }if (allocated)__insert_pending (inode, lblk); - -/* es is pre-allocated but not used, free it. */ -if (es1 && !es1->es_len) -__es_free_extent (es1); -if (es2 && !es2->es_len) -__es_free_extent (es2); error:write_unlock (&EXT4_I (inode)->i_es_lock);if (err1 || err2)
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 23/69 afs: Fix file locking on R/O volumes to operate in local mode
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Howells <[email protected]>
[ Upstream commit b590eb41be766c5a63acc7e8896a042f7a4e8293 ]
AFS doesn't really do locking on R/O volumes as fileservers don't maintain state with each other and thus a lock on a R/O volume file on one fileserver will not be be visible to someone looking at the same file on another fileserver.
Further, the server may return an error if you try it.
Fix this by doing what other AFS clients do and handle filelocking on R/O volume files entirely within the client and don't touch the server.
--- fs/afs/super.c | 2 ++ 1 file changed, 2 insertions(+)
fs/afs/super.c +2 -0
@@ -406,6 +406,8 @@ static int afs_validate_fc(struct fs_context *fc)return PTR_ERR (volume); ctx->volume = volume; +if (volume->type !=AFSVL_RWVOL ) + ctx->flock_mode = afs_flock_mode_local; }return 0 ;
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 41/69 ext4: make sure allocate pending entry not fail
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zhang Yi <[email protected]>
[ Upstream commit 8e387c89e96b9543a339f84043cf9df15fed2632 ]
__insert_pending() allocate memory in atomic context, so the allocation could fail, but we are not handling that failure now. It could lead ext4_es_remove_extent() to get wrong reserved clusters, and the global data blocks reservation count will be incorrect. The same to extents_status entry preallocation, preallocate pending entry out of the i_es_lock with __GFP_NOFAIL, make sure __insert_pending() and __revise_pending() always succeeds.
--- fs/ext4/extents_status.c | 123 ++++++++++++++++++++++++++++----------- 1 file changed, 89 insertions(+), 34 deletions(-)
fs/ext4/extents_status.c +89 -34
@@ -152,8 +152,9 @@ static int __es_remove_extent(struct inode *inode, ext4_lblk_t lblk,static int es_reclaim_extents (struct ext4_inode_info *ei,int *nr_to_scan);static int __es_shrink (struct ext4_sb_info *sbi,int nr_to_scan,struct ext4_inode_info *locked_ei); -static void __revise_pending (struct inode *inode,ext4_lblk_t lblk, -ext4_lblk_t len); +static int __revise_pending (struct inode *inode,ext4_lblk_t lblk, +ext4_lblk_t len, +struct pending_reservation **prealloc);int __init ext4_init_es (void ) {
@@ -450,6 +451,19 @@ static void ext4_es_list_del(struct inode *inode)spin_unlock (&sbi->s_es_lock); } +static inline struct pending_reservation *__alloc_pending (bool nofail) +{ +if (!nofail) +return kmem_cache_alloc (ext4_pending_cachep,GFP_ATOMIC ); + +return kmem_cache_zalloc (ext4_pending_cachep,GFP_KERNEL | __GFP_NOFAIL); +} + +static inline void __free_pending (struct pending_reservation *pr) +{ +kmem_cache_free (ext4_pending_cachep, pr); +} +/* * Returns true if we cannot fail to allocate memory for this extent_status * entry and cannot reclaim it until its status changes.
@@ -841,11 +855,12 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, {struct extent_status newes;ext4_lblk_t end = lblk + len -1 ; -int err1 =0 ; -int err2 =0 ; +int err1 =0 , err2 =0 , err3 =0 ;struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb);struct extent_status *es1 =NULL ;struct extent_status *es2 =NULL ; +struct pending_reservation *pr =NULL ; +bool revise_pending = false;if (EXT4_SB (inode->i_sb)->s_mount_state &EXT4_FC_REPLAY )return 0 ;
@@ -873,11 +888,17 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk,ext4_es_insert_extent_check (inode, &newes); + revise_pending = sbi->s_cluster_ratio >1 && +test_opt (inode->i_sb,DELALLOC ) && + (status & (EXTENT_STATUS_WRITTEN | +EXTENT_STATUS_UNWRITTEN )); retry:if (err1 && !es1) es1 =__es_alloc_extent (true);if ((err1 || err2) && !es2) es2 =__es_alloc_extent (true); +if ((err1 || err2 || err3) && revise_pending && !pr) + pr =__alloc_pending (true);write_lock (&EXT4_I (inode)->i_es_lock); err1 =__es_remove_extent (inode, lblk, end,NULL , es1);
@@ -902,13 +923,18 @@ int ext4_es_insert_extent(struct inode *inode, ext4_lblk_t lblk, es2 =NULL ; } -if (sbi->s_cluster_ratio >1 &&test_opt (inode->i_sb,DELALLOC ) && - (status &EXTENT_STATUS_WRITTEN || - status &EXTENT_STATUS_UNWRITTEN )) -__revise_pending (inode, lblk, len); +if (revise_pending) { + err3 =__revise_pending (inode, lblk, len, &pr); +if (err3 !=0 ) + goto error; +if (pr) { +__free_pending (pr); + pr =NULL ; + } + } error:write_unlock (&EXT4_I (inode)->i_es_lock); -if (err1 || err2) +if (err1 || err2 || err3) goto retry;ext4_es_print_tree (inode);
@@ -1316,7 +1342,7 @@ static unsigned int get_rsvd(struct inode *inode, ext4_lblk_t end, rc->ndelonly--; node =rb_next (&pr->rb_node);rb_erase (&pr->rb_node, &tree->root); -kmem_cache_free (ext4_pending_cachep, pr); +__free_pending (pr);if (!node)break ; pr = rb_entry(node, struct pending_reservation,
@@ -1913,11 +1939,13 @@ static struct pending_reservation *__get_pending(struct inode *inode,* * @inode - file containing the cluster * @lblk - logical block in the cluster to be added +* @prealloc - preallocated pending entry * * Returns 0 on successful insertion and -ENOMEM on failure. If the * pending reservation is already in the set, returns successfully. */ -static int __insert_pending (struct inode *inode,ext4_lblk_t lblk) +static int __insert_pending (struct inode *inode,ext4_lblk_t lblk, +struct pending_reservation **prealloc) {struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb);struct ext4_pending_tree *tree = &EXT4_I (inode)->i_pending_tree;
@@ -1943,10 +1971,15 @@ static int __insert_pending(struct inode *inode, ext4_lblk_t lblk) } } - pr =kmem_cache_alloc (ext4_pending_cachep,GFP_ATOMIC ); -if (pr ==NULL ) { - ret = -ENOMEM ; - goto out; +if (likely (*prealloc ==NULL )) { + pr =__alloc_pending (false); +if (!pr) { + ret = -ENOMEM ; + goto out; + } + }else { + pr = *prealloc; + *prealloc =NULL ; } pr->lclu = lclu;
@@ -1976,7 +2009,7 @@ static void __remove_pending(struct inode *inode, ext4_lblk_t lblk)if (pr !=NULL ) { tree = &EXT4_I (inode)->i_pending_tree;rb_erase (&pr->rb_node, &tree->root); -kmem_cache_free (ext4_pending_cachep, pr); +__free_pending (pr); } }
@@ -2037,10 +2070,10 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, bool allocated) {struct extent_status newes; -int err1 =0 ; -int err2 =0 ; +int err1 =0 , err2 =0 , err3 =0 ;struct extent_status *es1 =NULL ;struct extent_status *es2 =NULL ; +struct pending_reservation *pr =NULL ;if (EXT4_SB (inode->i_sb)->s_mount_state &EXT4_FC_REPLAY )return 0 ;
@@ -2060,6 +2093,8 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, es1 =__es_alloc_extent (true);if ((err1 || err2) && !es2) es2 =__es_alloc_extent (true); +if ((err1 || err2 || err3) && allocated && !pr) + pr =__alloc_pending (true);write_lock (&EXT4_I (inode)->i_es_lock); err1 =__es_remove_extent (inode, lblk, lblk,NULL , es1);
@@ -2082,11 +2117,18 @@ int ext4_es_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk, es2 =NULL ; } -if (allocated) -__insert_pending (inode, lblk); +if (allocated) { + err3 =__insert_pending (inode, lblk, &pr); +if (err3 !=0 ) + goto error; +if (pr) { +__free_pending (pr); + pr =NULL ; + } + } error:write_unlock (&EXT4_I (inode)->i_es_lock); -if (err1 || err2) +if (err1 || err2 || err3) goto retry;ext4_es_print_tree (inode);
@@ -2192,21 +2234,24 @@ unsigned int ext4_es_delayed_clu(struct inode *inode, ext4_lblk_t lblk,* @inode - file containing the range * @lblk - logical block defining the start of range * @len - length of range in blocks +* @prealloc - preallocated pending entry * * Used after a newly allocated extent is added to the extents status tree. * Requires that the extents in the range have either written or unwritten * status. Must be called while holding i_es_lock. */ -static void __revise_pending (struct inode *inode,ext4_lblk_t lblk, -ext4_lblk_t len) +static int __revise_pending (struct inode *inode,ext4_lblk_t lblk, +ext4_lblk_t len, +struct pending_reservation **prealloc) {struct ext4_sb_info *sbi =EXT4_SB (inode->i_sb);ext4_lblk_t end = lblk + len -1 ;ext4_lblk_t first, last;bool f_del = false, l_del = false; +int ret =0 ;if (len ==0 ) -return ; +return 0 ;/* * Two cases - block range within single cluster and block range
@@ -2227,7 +2272,9 @@ static void __revise_pending(struct inode *inode, ext4_lblk_t lblk, f_del =__es_scan_range (inode, &ext4_es_is_delonly, first, lblk -1 );if (f_del) { -__insert_pending (inode, first); + ret =__insert_pending (inode, first, prealloc); +if (ret <0 ) + goto out; }else { last =EXT4_LBLK_CMASK (sbi, end) + sbi->s_cluster_ratio -1 ;
@@ -2235,9 +2282,11 @@ static void __revise_pending(struct inode *inode, ext4_lblk_t lblk, l_del =__es_scan_range (inode, &ext4_es_is_delonly, end +1 , last); -if (l_del) -__insert_pending (inode, last); -else +if (l_del) { + ret =__insert_pending (inode, last, prealloc); +if (ret <0 ) + goto out; + }else __remove_pending (inode, last); } }else {
@@ -2245,18 +2294,24 @@ static void __revise_pending(struct inode *inode, ext4_lblk_t lblk,if (first != lblk) f_del =__es_scan_range (inode, &ext4_es_is_delonly, first, lblk -1 ); -if (f_del) -__insert_pending (inode, first); -else +if (f_del) { + ret =__insert_pending (inode, first, prealloc); +if (ret <0 ) + goto out; + }else __remove_pending (inode, first); last =EXT4_LBLK_CMASK (sbi, end) + sbi->s_cluster_ratio -1 ;if (last != end) l_del =__es_scan_range (inode, &ext4_es_is_delonly, end +1 , last); -if (l_del) -__insert_pending (inode, last); -else +if (l_del) { + ret =__insert_pending (inode, last, prealloc); +if (ret <0 ) + goto out; + }else __remove_pending (inode, last); } +out: +return ret; }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 42/69 tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Francis Laniel <[email protected]>
commit b022f0c7e404887a7c5229788fc99eff9f9a80d5 upstream.
When a kprobe is attached to a function that's name is not unique (is static and shares the name with other functions in the kernel), the kprobe is attached to the first function it finds. This is a bug as the function that it is attaching to is not necessarily the one that the user wants to attach to.
Instead of blindly picking a function to attach to what is ambiguous, error with EADDRNOTAVAIL to let the user know that this function is not unique, and that the user must use another unique function with an address offset to get to the function they want to attach to.
--- kernel/trace/trace_kprobe.c | 74 ++++++++++++++++++++++++++++++++++++++++++++ kernel/trace/trace_probe.h | 1 2 files changed, 75 insertions(+)
kernel/trace/trace_kprobe.c +74 -0
@@ -708,6 +708,36 @@ static struct notifier_block trace_kprob .priority = 1 /* Invoked after kprobe module callback */ }; +struct count_symbols_struct { +const char *func_name; +unsigned int count; +}; + +static int count_symbols (void *data,const char *name,struct module *unused0, +unsigned long unused1) +{ +struct count_symbols_struct *args = data; + +if (strcmp (args->func_name, name)) +return 0 ; + + args->count++; + +return 0 ; +} + +static unsigned int number_of_same_symbols (char *func_name) +{ +struct count_symbols_struct args = { + .func_name = func_name, + .count =0 , + }; + +kallsyms_on_each_symbol (count_symbols, &args); + +return args.count; +} +static int __trace_kprobe_create (int argc,const char *argv[]) {/*
@@ -836,6 +866,31 @@ static int __trace_kprobe_create(int arg } } +if (symbol && !strchr (symbol,':' )) { +unsigned int count; + + count =number_of_same_symbols (symbol); +if (count >1 ) { +/* +* Users should use ADDR to remove the ambiguity of +* using KSYM only. +*/ +trace_probe_log_err (0 ,NON_UNIQ_SYMBOL ); + ret = -EADDRNOTAVAIL ; + + goto error; + }else if (count ==0 ) { +/* +* We can return ENOENT earlier than when register the +* kprobe. +*/ +trace_probe_log_err (0 ,BAD_PROBE_ADDR ); + ret = -ENOENT ; + + goto error; + } + } +trace_probe_log_set_index (0 );if (event) { ret = traceprobe_parse_event_name(&event, &group, buf,
@@ -1755,6 +1810,7 @@ static int unregister_kprobe_event(struc }#ifdef CONFIG_PERF_EVENTS +/* create a trace_kprobe, but don't add it to global lists */ struct trace_event_call * create_local_trace_kprobe(char *func, void *addr, unsigned long offs,
@@ -1765,6 +1821,24 @@ create_local_trace_kprobe(char *func, voint ret;char *event; +if (func) { +unsigned int count; + + count =number_of_same_symbols (func); +if (count >1 ) +/* +* Users should use addr to remove the ambiguity of +* using func only. +*/ +return ERR_PTR (-EADDRNOTAVAIL ); +else if (count ==0 ) +/* +* We can return ENOENT earlier than when register the +* kprobe. +*/ +return ERR_PTR (-ENOENT ); + } +/* * local trace_kprobes are not added to dyn_event, so they are never * searched in find_trace_kprobe(). Therefore, there is no concern of
kernel/trace/trace_probe.h +1 -0
@@ -405,6 +405,7 @@ extern int traceprobe_define_arg_fields(C (BAD_MAXACT ,"Invalid maxactive number" ), \C (MAXACT_TOO_BIG ,"Maxactive is too big" ), \C (BAD_PROBE_ADDR ,"Invalid probed address or symbol" ), \ +C (NON_UNIQ_SYMBOL ,"The symbol is not unique" ), \C (BAD_RETPROBE ,"Retprobe address must be an function entry" ), \C (BAD_ADDR_SUFFIX ,"Invalid probed address suffix" ), \ C(NO_GROUP_NAME, "Group name is not specified"), \
Greg Kroah-Hartman
maintainerPATCH 43/69 proc: sysctl: prevent aliased sysctls from getting passed to init
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krister Johansen <[email protected]>
commit 8001f49394e353f035306a45bcf504f06fca6355 upstream.
The code that checks for unknown boot options is unaware of the sysctl alias facility, which maps bootparams to sysctl values. If a user sets an old value that has a valid alias, a message about an invalid parameter will be printed during boot, and the parameter will get passed to init. Fix by checking for the existence of aliased parameters in the unknown boot parameter code. If an alias exists, don't return an error or pass the value to init.
--- fs/proc/proc_sysctl.c | 7 +++++++ include/linux/sysctl.h | 6 ++++++ init/main.c | 4 ++++ 3 files changed, 17 insertions(+)
fs/proc/proc_sysctl.c +7 -0
@@ -1780,6 +1780,13 @@ static const char *sysctl_find_alias(chareturn NULL ; } +bool sysctl_is_alias (char *param) +{ +const char *alias =sysctl_find_alias (param); + +return alias !=NULL ; +} +/* Set sysctl value passed on kernel command line. */ static int process_sysctl_arg (char *param,char *val,const char *unused,void *arg)
include/linux/sysctl.h +6 -0
@@ -210,6 +210,7 @@ extern void __register_sysctl_init(const const char *table_name);#define register_sysctl_init (path, table) __register_sysctl_init(path, table, #table)void do_sysctl_args (void ); +bool sysctl_is_alias (char *param);extern int pwrsw_enabled;extern int unaligned_enabled;
@@ -251,6 +252,11 @@ static inline void setup_sysctl_set(strustatic inline void do_sysctl_args (void ) { } + +static inline bool sysctl_is_alias (char *param) +{ +return false; +}#endif /* CONFIG_SYSCTL */ int sysctl_max_threads(struct ctl_table *table, int write, void *buffer,
init/main.c +4 -0
@@ -540,6 +540,10 @@ static int __init unknown_bootoption(cha {size_t len =strlen (param); +/* Handle params aliased to sysctls */ +if (sysctl_is_alias (param)) +return 0 ; +repair_env_string (param, val);/* Handle obsolete-style parameters */
Greg Kroah-Hartman
maintainerPATCH 44/69 ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVA
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hans de Goede <[email protected]>
commit bd911485294a6f0596e4592ed442438015cffc8a upstream.
Like various other ASUS ExpertBook-s, the ASUS ExpertBook B1402CVA has an ACPI DSDT table that describes IRQ 1 as ActiveLow while the kernel overrides it to EdgeHigh.
This prevents the keyboard from working. To fix this issue, add this laptop to the skip_override_table so that the kernel does not override IRQ 1.
--- drivers/acpi/resource.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/acpi/resource.c +7 -0
@@ -440,6 +440,13 @@ static const struct dmi_system_id lenovo }, }, { +/* Asus ExpertBook B1402CVA */ + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), + DMI_MATCH(DMI_BOARD_NAME, "B1402CVA"), + }, + }, + { .ident ="LENOVO IdeaPad Flex 5 16ALC7" , .matches = { DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
Greg Kroah-Hartman
maintainerPATCH 45/69 swiotlb-xen: provide the "max_mapping_size" method
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <[email protected]>
commit bff2a2d453a1b683378b4508b86b84389f551a00 upstream.
There's a bug that when using the XEN hypervisor with bios with large multi-page bio vectors on NVMe, the kernel deadlocks [1].
The deadlocks are caused by inability to map a large bio vector - dma_map_sgtable always returns an error, this gets propagated to the block layer as BLK_STS_RESOURCE and the block layer retries the request indefinitely.
XEN uses the swiotlb framework to map discontiguous pages into contiguous runs that are submitted to the PCIe device. The swiotlb framework has a limitation on the length of a mapping - this needs to be announced with the max_mapping_size method to make sure that the hardware drivers do not create larger mappings.
Without max_mapping_size, the NVMe block driver would create large mappings that overrun the maximum mapping size.
--- drivers/xen/swiotlb-xen.c | 1 + 1 file changed, 1 insertion(+)
drivers/xen/swiotlb-xen.c +1 -0
@@ -564,4 +564,5 @@ const struct dma_map_ops xen_swiotlb_dma .get_sgtable = dma_common_get_sgtable, .alloc_pages = dma_common_alloc_pages, .free_pages = dma_common_free_pages, + .max_mapping_size = swiotlb_max_mapping_size, };
Greg Kroah-Hartman
maintainerPATCH 46/69 bcache: replace a mistaken IS_ERR() by IS_ERR_OR_NULL() in btree_gc_coalesce()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Coly Li <[email protected]>
commit f72f4312d4388376fc8a1f6cf37cb21a0d41758b upstream.
Commit 028ddcac477b ("bcache: Remove unnecessary NULL point check in node allocations") do the following change inside btree_gc_coalesce(),
31 @@ -1340,7 +1340,7 @@ static int btree_gc_coalesce(
32 memset(new_nodes, 0, sizeof(new_nodes));
33 closure_init_stack(&cl);
34
35 - while (nodes < GC_MERGE_NODES && !IS_ERR_OR_NULL(r[nodes].b))
36 + while (nodes < GC_MERGE_NODES && !IS_ERR(r[nodes].b))
37 keys += r[nodes++].keys;
38
39 blocks = btree_default_blocks(b->c) * 2 / 3;
At line 35 the original r[nodes].b is not always allocatored from __bch_btree_node_alloc(), and possibly initialized as NULL pointer by caller of btree_gc_coalesce(). Therefore the change at line 36 is not correct.
This patch replaces the mistaken IS_ERR() by IS_ERR_OR_NULL() to avoid potential issue.
--- drivers/md/bcache/btree.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/btree.c +1 -1
@@ -1342,7 +1342,7 @@ static int btree_gc_coalesce(struct btrememset (new_nodes,0 ,sizeof (new_nodes));closure_init_stack (&cl); -while (nodes <GC_MERGE_NODES && !IS_ERR (r[nodes].b)) +while (nodes <GC_MERGE_NODES && !IS_ERR_OR_NULL (r[nodes].b)) keys += r[nodes++].keys; blocks =btree_default_blocks (b->c) *2 /3 ;
Greg Kroah-Hartman
maintainerPATCH 47/69 md: fix bi_status reporting in md_end_clone_io
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Song Liu <[email protected]>
commit 45b478951b2ba5aea70b2850c49c1aa83aedd0d2 upstream.
md_end_clone_io() may overwrite error status in orig_bio->bi_status with BLK_STS_OK. This could happen when orig_bio has BIO_CHAIN (split by md_submit_bio => bio_split_to_limits, for example). As a result, upper layer may miss error reported from md (or the device) and consider the failed IO was successful.
Fix this by only update orig_bio->bi_status when current bio reports error and orig_bio is BLK_STS_OK. This is the same behavior as __bio_chain_endio().
--- drivers/md/md.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/md.c +2 -1
@@ -8627,7 +8627,8 @@ static void md_end_io_acct(struct bio *bstruct md_io_acct *md_io_acct = bio->bi_private;struct bio *orig_bio = md_io_acct->orig_bio; - orig_bio->bi_status = bio->bi_status; +if (bio->bi_status && !orig_bio->bi_status) + orig_bio->bi_status = bio->bi_status;bio_end_io_acct (orig_bio, md_io_acct->start_time);bio_put (bio);
Greg Kroah-Hartman
maintainerPATCH 24/69 nvmet: nul-terminate the NQNs passed in the connect command
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christoph Hellwig <[email protected]>
[ Upstream commit 1c22e0295a5eb571c27b53c7371f95699ef705ff ]
The host and subsystem NQNs are passed in the connect command payload and interpreted as nul-terminated strings. Ensure they actually are nul-terminated before using them.
--- drivers/nvme/target/fabrics-cmd.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/nvme/target/fabrics-cmd.c +4 -0
@@ -206,6 +206,8 @@ static void nvmet_execute_admin_connect(struct nvmet_req *req) goto out; } + d->subsysnqn[NVMF_NQN_FIELD_LEN -1 ] ='\0' ; + d->hostnqn[NVMF_NQN_FIELD_LEN -1 ] ='\0' ; status =nvmet_alloc_ctrl (d->subsysnqn, d->hostnqn, req,le32_to_cpu (c->kato), &ctrl);if (status)
@@ -263,6 +265,8 @@ static void nvmet_execute_io_connect(struct nvmet_req *req) goto out; } + d->subsysnqn[NVMF_NQN_FIELD_LEN -1 ] ='\0' ; + d->hostnqn[NVMF_NQN_FIELD_LEN -1 ] ='\0' ; ctrl =nvmet_ctrl_find_get (d->subsysnqn, d->hostnqn,le16_to_cpu (d->cntlid), req);if (!ctrl) {
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 25/69 USB: dwc3: qcom: fix resource leaks on probe deferral
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 51392a1879ff06dc21b68aef4825f6ef68a7be42 ]
The driver needs to deregister and free the newly allocated dwc3 core platform device on ACPI probe errors (e.g. probe deferral) and on driver unbind but instead it leaked those resources while erroneously dropping a reference to the parent platform device which is still in use.
For OF probing the driver takes a reference to the dwc3 core platform device which has also always been leaked.
Fix the broken ACPI tear down and make sure to drop the dwc3 core reference for both OF and ACPI.
Stable-dep-of: 9cf87666fc6e ("USB: dwc3: qcom: fix ACPI platform device leak")
--- drivers/usb/dwc3/dwc3-qcom.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/usb/dwc3/dwc3-qcom.c +6 -3
@@ -695,6 +695,7 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev)if (!qcom->dwc3) { ret = -ENODEV ;dev_err (dev,"failed to get dwc3 platform device\n" ); +of_platform_depopulate (dev); } node_put:
@@ -836,7 +837,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)if (ret) {dev_err (dev,"failed to register DWC3 Core, err=%d\n" , ret); - goto depopulate; + goto clk_disable; } ret =dwc3_qcom_interconnect_init (qcom);
@@ -868,7 +869,8 @@ static int dwc3_qcom_probe(struct platform_device *pdev)if (np)of_platform_depopulate (&pdev->dev);else -platform_device_put (pdev); +platform_device_del (qcom->dwc3); +platform_device_put (qcom->dwc3); clk_disable:for (i = qcom->num_clocks -1 ; i >=0 ; i--) {clk_disable_unprepare (qcom->clks[i]);
@@ -891,7 +893,8 @@ static int dwc3_qcom_remove(struct platform_device *pdev)if (np)of_platform_depopulate (&pdev->dev);else -platform_device_put (pdev); +platform_device_del (qcom->dwc3); +platform_device_put (qcom->dwc3);for (i = qcom->num_clocks -1 ; i >=0 ; i--) {clk_disable_unprepare (qcom->clks[i]);
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 26/69 USB: dwc3: qcom: fix ACPI platform device leak
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 9cf87666fc6e08572341fe08ecd909935998fbbd ]
Make sure to free the "urs" platform device, which is created for some ACPI platforms, on probe errors and on driver unbind.
Compile-tested only.
--- drivers/usb/dwc3/dwc3-qcom.c | 37 +++++++++++++++++++++++++++++------- 1 file changed, 30 insertions(+), 7 deletions(-)
drivers/usb/dwc3/dwc3-qcom.c +30 -7
@@ -704,9 +704,9 @@ static int dwc3_qcom_of_register_core(struct platform_device *pdev)return ret; } -static struct platform_device * -dwc3_qcom_create_urs_usb_platdev (struct device *dev) +static struct platform_device *dwc3_qcom_create_urs_usb_platdev (struct device *dev) { +struct platform_device *urs_usb =NULL ;struct fwnode_handle *fwh;struct acpi_device *adev;char name[8 ];
@@ -726,9 +726,26 @@ dwc3_qcom_create_urs_usb_platdev(struct device *dev) adev =to_acpi_device_node (fwh);if (!adev) -return NULL ; + goto err_put_handle; + + urs_usb =acpi_create_platform_device (adev,NULL ); +if (IS_ERR_OR_NULL (urs_usb)) + goto err_put_handle; + +return urs_usb; -return acpi_create_platform_device (adev,NULL ); +err_put_handle: +fwnode_handle_put (fwh); + +return urs_usb; +} + +static void dwc3_qcom_destroy_urs_usb_platdev (struct platform_device *urs_usb) +{ +struct fwnode_handle *fwh = urs_usb->dev.fwnode; + +platform_device_unregister (urs_usb); +fwnode_handle_put (fwh); }static int dwc3_qcom_probe (struct platform_device *pdev)
@@ -812,13 +829,13 @@ static int dwc3_qcom_probe(struct platform_device *pdev) qcom->qscratch_base =devm_ioremap_resource (dev, parent_res);if (IS_ERR (qcom->qscratch_base)) { ret =PTR_ERR (qcom->qscratch_base); - goto clk_disable; + goto free_urs; } ret =dwc3_qcom_setup_irq (pdev);if (ret) {dev_err (dev,"failed to setup IRQs, err=%d\n" , ret); - goto clk_disable; + goto free_urs; }/*
@@ -837,7 +854,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev)if (ret) {dev_err (dev,"failed to register DWC3 Core, err=%d\n" , ret); - goto clk_disable; + goto free_urs; } ret =dwc3_qcom_interconnect_init (qcom);
@@ -871,6 +888,9 @@ static int dwc3_qcom_probe(struct platform_device *pdev)else platform_device_del (qcom->dwc3);platform_device_put (qcom->dwc3); +free_urs: +if (qcom->urs_usb) +dwc3_qcom_destroy_urs_usb_platdev (qcom->urs_usb); clk_disable:for (i = qcom->num_clocks -1 ; i >=0 ; i--) {clk_disable_unprepare (qcom->clks[i]);
@@ -896,6 +916,9 @@ static int dwc3_qcom_remove(struct platform_device *pdev)platform_device_del (qcom->dwc3);platform_device_put (qcom->dwc3); +if (qcom->urs_usb) +dwc3_qcom_destroy_urs_usb_platdev (qcom->urs_usb); +for (i = qcom->num_clocks -1 ; i >=0 ; i--) {clk_disable_unprepare (qcom->clks[i]);clk_put (qcom->clks[i]);
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 27/69 lockdep: Fix block chain corruption
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Peter Zijlstra <[email protected]>
[ Upstream commit bca4104b00fec60be330cd32818dd5c70db3d469 ]
Kent reported an occasional KASAN splat in lockdep. Mark then noted:
Quoted 3 lines
I suspect the dodgy access is to chain_block_buckets[-1], which hits the last 4 bytes of the redzone and gets (incorrectly/misleadingly) attributed to
nr_large_chain_blocks.
That would mean @size == 0, at which point size_to_bucket() returns -1 and the above happens.
alloc_chain_hlocks() has 'size - req', for the first with the precondition 'size >= rq', which allows the 0.
This code is trying to split a block, del_chain_block() takes what we need, and add_chain_block() puts back the remainder, except in the above case the remainder is 0 sized and things go sideways.
--- kernel/locking/lockdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/locking/lockdep.c +2 -1
@@ -3416,7 +3416,8 @@ static int alloc_chain_hlocks(int req) size =chain_block_size (curr);if (likely (size >= req)) {del_chain_block (0 , size,chain_block_next (curr)); -add_chain_block (curr + req, size - req); +if (size > req) +add_chain_block (curr + req, size - req);return curr; } }
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 28/69 MIPS: KVM: Fix a build warning about variable set but not used
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
[ Upstream commit 83767a67e7b6a0291cde5681ec7e3708f3f8f877 ]
After commit 411740f5422a ("KVM: MIPS/MMU: Implement KVM_CAP_SYNC_MMU") old_pte is no longer used in kvm_mips_map_page(). So remove it to fix a build warning about variable set but not used:
arch/mips/kvm/mmu.c: In function 'kvm_mips_map_page':
Quoted 1 line
Quoted 1 line
arch/mips/kvm/mmu.c:701:29: warning: variable 'old_pte' set but not used [-Wunused-but-set-variable]
701 | pte_t *ptep, entry, old_pte;
| ^~~~~~~--- arch/mips/kvm/mmu.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
arch/mips/kvm/mmu.c +1 -2
@@ -593,7 +593,7 @@ static int kvm_mips_map_page(struct kvm_vcpu *vcpu, unsigned long gpa,gfn_t gfn = gpa >>PAGE_SHIFT ;int srcu_idx, err;kvm_pfn_t pfn; -pte_t *ptep, entry, old_pte; +pte_t *ptep, entry;bool writeable;unsigned long prot_bits;unsigned long mmu_seq;
@@ -665,7 +665,6 @@ static int kvm_mips_map_page(struct kvm_vcpu *vcpu, unsigned long gpa, entry =pfn_pte (pfn,__pgprot (prot_bits));/* Write the PTE */ - old_pte = *ptep;set_pte (ptep, entry); err =0 ;
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 29/69 media: camss: Replace hard coded value with parameter
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Souptick Joarder (HPE) <[email protected]>
[ Upstream commit a312f8982632fb1a882a8dc3c9fd127d082c1c02 ]
Kernel test robot reported below warning -> drivers/media/platform/qcom/camss/camss-csid-gen2.c:407:3:
warning: Value stored to 'val' is never read [clang-analyzer-deadcode.DeadStores]
Replace hard coded value with val.
Stable-dep-of: e655d1ae9703 ("media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3")
--- drivers/media/platform/qcom/camss/camss-csid-170.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/qcom/camss/camss-csid-170.c +1 -1
@@ -398,7 +398,7 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable)writel_relaxed (val, csid->base +CSID_RDI_FRM_DROP_PERIOD (0 )); val =0 ; -writel_relaxed (0 , csid->base +CSID_RDI_FRM_DROP_PATTERN (0 )); +writel_relaxed (val, csid->base +CSID_RDI_FRM_DROP_PATTERN (0 )); val =1 ;writel_relaxed (val, csid->base +CSID_RDI_IRQ_SUBSAMPLE_PERIOD (0 ));
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 30/69 media: camss: sm8250: Virtual channels for CSID
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Milen Mitkov <[email protected]>
[ Upstream commit 3c4ed72a16bc6733cda9c65048af74a2e8eaa0eb ]
CSID hardware on SM8250 can demux up to 4 simultaneous streams based on virtual channel (vc) or datatype (dt).
The CSID subdevice entity now has 4 source ports that can be enabled/disabled and thus can control which virtual channels are enabled. Datatype demuxing not tested.
In order to keep a valid internal state of the subdevice, implicit format propagation from the sink to the source pads has been preserved. However, the format on each source pad can be different and in that case it must be configured explicitly.
CSID's s_stream is called when any stream is started or stopped. It will call configure_streams() that will rewrite IRQ settings to HW. When multiple streams are running simultaneously there is an issue when writing IRQ settings for one stream while another is still running, thus avoid re-writing settings if they were not changed in link setup, or by fully powering off the CSID hardware.
Stable-dep-of: e655d1ae9703 ("media: qcom: camss: Fix set CSI2_RX_CFG1_VC_MODE when VC is greater than 3")
--- .../platform/qcom/camss/camss-csid-170.c | 54 ++++++++++++------- .../media/platform/qcom/camss/camss-csid.c | 44 ++++++++++----- .../media/platform/qcom/camss/camss-csid.h | 11 +++- 3 files changed, 74 insertions(+), 35 deletions(-)
drivers/media/platform/qcom/camss/camss-csid-170.c +34 -20
@@ -327,13 +327,14 @@ static const struct csid_format csid_formats[] = { }, }; -static void csid_configure_stream (struct csid_device *csid,u8 enable) +static void __csid_configure_stream (struct csid_device *csid,u8 enable,u8 vc) {struct csid_testgen_config *tg = &csid->testgen;u32 val;u32 phy_sel =0 ;u8 lane_cnt = csid->phy.lane_cnt; -struct v4l2_mbus_framefmt *input_format = &csid->fmt[MSM_CSID_PAD_SRC ]; +/* Source pads matching RDI channels on hardware. Pad 1 -> RDI0, Pad 2 -> RDI1, etc. */ +struct v4l2_mbus_framefmt *input_format = &csid->fmt[MSM_CSID_PAD_FIRST_SRC + vc];const struct csid_format *format =csid_get_fmt_entry (csid->formats, csid->nformats, input_format->code);
@@ -344,8 +345,7 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable) phy_sel = csid->phy.csiphy_id;if (enable) { -u8 vc =0 ;/* Virtual Channel 0 */ -u8 dt_id = vc *4 ; +u8 dt_id = vc;if (tg->enabled) {/* Config Test Generator */
@@ -388,42 +388,42 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable) val |= format->data_type <<RDI_CFG0_DATA_TYPE ; val |= vc <<RDI_CFG0_VIRTUAL_CHANNEL ; val |= dt_id <<RDI_CFG0_DT_ID ; -writel_relaxed (val, csid->base +CSID_RDI_CFG0 (0 )); +writel_relaxed (val, csid->base +CSID_RDI_CFG0 (vc));/* CSID_TIMESTAMP_STB_POST_IRQ */ val =2 <<RDI_CFG1_TIMESTAMP_STB_SEL ; -writel_relaxed (val, csid->base +CSID_RDI_CFG1 (0 )); +writel_relaxed (val, csid->base +CSID_RDI_CFG1 (vc)); val =1 ; -writel_relaxed (val, csid->base +CSID_RDI_FRM_DROP_PERIOD (0 )); +writel_relaxed (val, csid->base +CSID_RDI_FRM_DROP_PERIOD (vc)); val =0 ; -writel_relaxed (val, csid->base +CSID_RDI_FRM_DROP_PATTERN (0 )); +writel_relaxed (val, csid->base +CSID_RDI_FRM_DROP_PATTERN (vc)); val =1 ; -writel_relaxed (val, csid->base +CSID_RDI_IRQ_SUBSAMPLE_PERIOD (0 )); +writel_relaxed (val, csid->base +CSID_RDI_IRQ_SUBSAMPLE_PERIOD (vc)); val =0 ; -writel_relaxed (val, csid->base +CSID_RDI_IRQ_SUBSAMPLE_PATTERN (0 )); +writel_relaxed (val, csid->base +CSID_RDI_IRQ_SUBSAMPLE_PATTERN (vc)); val =1 ; -writel_relaxed (val, csid->base +CSID_RDI_RPP_PIX_DROP_PERIOD (0 )); +writel_relaxed (val, csid->base +CSID_RDI_RPP_PIX_DROP_PERIOD (vc)); val =0 ; -writel_relaxed (val, csid->base +CSID_RDI_RPP_PIX_DROP_PATTERN (0 )); +writel_relaxed (val, csid->base +CSID_RDI_RPP_PIX_DROP_PATTERN (vc)); val =1 ; -writel_relaxed (val, csid->base +CSID_RDI_RPP_LINE_DROP_PERIOD (0 )); +writel_relaxed (val, csid->base +CSID_RDI_RPP_LINE_DROP_PERIOD (vc)); val =0 ; -writel_relaxed (val, csid->base +CSID_RDI_RPP_LINE_DROP_PATTERN (0 )); +writel_relaxed (val, csid->base +CSID_RDI_RPP_LINE_DROP_PATTERN (vc)); val =0 ; -writel_relaxed (val, csid->base +CSID_RDI_CTRL (0 )); +writel_relaxed (val, csid->base +CSID_RDI_CTRL (vc)); - val =readl_relaxed (csid->base +CSID_RDI_CFG0 (0 )); + val =readl_relaxed (csid->base +CSID_RDI_CFG0 (vc)); val |=1 <<RDI_CFG0_ENABLE ; -writel_relaxed (val, csid->base +CSID_RDI_CFG0 (0 )); +writel_relaxed (val, csid->base +CSID_RDI_CFG0 (vc)); }if (tg->enabled) {
@@ -449,7 +449,16 @@ static void csid_configure_stream(struct csid_device *csid, u8 enable) val =HALT_CMD_RESUME_AT_FRAME_BOUNDARY <<RDI_CTRL_HALT_CMD ; else val =HALT_CMD_HALT_AT_FRAME_BOUNDARY <<RDI_CTRL_HALT_CMD ; -writel_relaxed (val, csid->base +CSID_RDI_CTRL (0 )); +writel_relaxed (val, csid->base +CSID_RDI_CTRL (vc)); +} + +static void csid_configure_stream (struct csid_device *csid,u8 enable) +{ +u8 i; +/* Loop through all enabled VCs and configure stream for each */ +for (i =0 ; i <MSM_CSID_MAX_SRC_STREAMS ; i++) +if (csid->phy.en_vc &BIT (i)) +__csid_configure_stream (csid, enable, i); }static int csid_configure_testgen_pattern (struct csid_device *csid,s32 val)
@@ -495,6 +504,7 @@ static irqreturn_t csid_isr(int irq, void *dev)struct csid_device *csid = dev;u32 val;u8 reset_done; +int i; val =readl_relaxed (csid->base +CSID_TOP_IRQ_STATUS );writel_relaxed (val, csid->base +CSID_TOP_IRQ_CLEAR );
@@ -503,8 +513,12 @@ static irqreturn_t csid_isr(int irq, void *dev) val =readl_relaxed (csid->base +CSID_CSI2_RX_IRQ_STATUS );writel_relaxed (val, csid->base +CSID_CSI2_RX_IRQ_CLEAR ); - val =readl_relaxed (csid->base +CSID_CSI2_RDIN_IRQ_STATUS (0 )); -writel_relaxed (val, csid->base +CSID_CSI2_RDIN_IRQ_CLEAR (0 )); +/* Read and clear IRQ status for each enabled RDI channel */ +for (i =0 ; i <MSM_CSID_MAX_SRC_STREAMS ; i++) +if (csid->phy.en_vc &BIT (i)) { + val =readl_relaxed (csid->base +CSID_CSI2_RDIN_IRQ_STATUS (i)); +writel_relaxed (val, csid->base +CSID_CSI2_RDIN_IRQ_CLEAR (i)); + } val =1 <<IRQ_CMD_CLEAR ;writel_relaxed (val, csid->base +CSID_IRQ_CMD );
drivers/media/platform/qcom/camss/camss-csid.c +31 -13
95 lines not on this page · raw message
drivers/media/platform/qcom/camss/camss-csid.h +9 -2
@@ -19,8 +19,13 @@#include <media/v4l2-subdev.h> #define MSM_CSID_PAD_SINK 0 -#define MSM_CSID_PAD_SRC 1 -#define MSM_CSID_PADS_NUM 2 +#define MSM_CSID_PAD_FIRST_SRC 1 +#define MSM_CSID_PADS_NUM 5 + +#define MSM_CSID_PAD_SRC (MSM_CSID_PAD_FIRST_SRC) + +/* CSID hardware can demultiplex up to 4 outputs */ +#define MSM_CSID_MAX_SRC_STREAMS 4#define DATA_TYPE_EMBEDDED_DATA_8BIT 0x12#define DATA_TYPE_YUV420_8BIT 0x18
@@ -81,6 +86,8 @@ struct csid_phy_config {u8 csiphy_id;u8 lane_cnt;u32 lane_assign; +u32 en_vc; +u8 need_vc_update; };struct csid_device ;
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 21/69 net: axienet: Fix check for partial TX checksum
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samuel Holland <[email protected]>
[ Upstream commit fd0413bbf8b11f56e8aa842783b0deda0dfe2926 ]
Due to a typo, the code checked the RX checksum feature in the TX path.
--- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +1 -1
@@ -763,7 +763,7 @@ axienet_start_xmit(struct sk_buff *skb, struct net_device *ndev)if (lp->features &XAE_FEATURE_FULL_TX_CSUM ) {/* Tx Full Checksum Offload Enabled */ cur_p->app0 |=2 ; - }else if (lp->features &XAE_FEATURE_PARTIAL_RX_CSUM ) { + }else if (lp->features &XAE_FEATURE_PARTIAL_TX_CSUM ) { csum_start_off =skb_transport_offset (skb); csum_index_off = csum_start_off + skb->csum_offset;/* Tx Partial Checksum Offload Enabled */
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 49/69 io_uring/fs: consider link->flags when getting path for LINKAT
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charles Mirabile <[email protected]>
commit 8479063f1fbee201a8739130e816cc331b675838 upstream.
In order for AT_EMPTY_PATH to work as expected, the fact that the user wants that behavior needs to make it to getname_flags or it will return ENOENT.
--- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/io_uring.c +1 -1
@@ -4049,7 +4049,7 @@ static int io_linkat_prep(struct io_kioc newf =u64_to_user_ptr (READ_ONCE (sqe->addr2)); lnk->flags =READ_ONCE (sqe->hardlink_flags); - lnk->oldpath =getname (oldf); + lnk->oldpath =getname_uflags (oldf, lnk->flags);if (IS_ERR (lnk->oldpath))return PTR_ERR (lnk->oldpath);
Greg Kroah-Hartman
maintainerPATCH 58/69 bcache: fixup lock c->root error
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingzhe Zou <[email protected]>
commit e34820f984512b433ee1fc291417e60c47d56727 upstream.
We had a problem with io hung because it was waiting for c->root to release the lock.
crash> cache_set.root -l cache_set.list ffffa03fde4c0050
root = 0xffff802ef454c800
crash> btree -o 0xffff802ef454c800 | grep rw_semaphore
[ffff802ef454c858] struct rw_semaphore lock;
crash> struct rw_semaphore ffff802ef454c858 struct rw_semaphore {
count = {
counter = -4294967297
},
wait_list = {
next = 0xffff00006786fc28,
prev = 0xffff00005d0efac8
},
wait_lock = {
raw_lock = {
{
val = {
counter = 0
},
{
locked = 0 '\000',
pending = 0 '\000'
},
{
locked_pending = 0,
tail = 0
}
}
}
},
osq = {
tail = {
counter = 0
} },
owner = 0xffffa03fdc586603
}
The "counter = -4294967297" means that lock count is -1 and a write lock is being attempted. Then, we found that there is a btree with a counter of 1 in btree_cache_freeable.
crash> cache_set -l cache_set.list ffffa03fde4c0050 -o|grep btree_cache
[ffffa03fde4c1140] struct list_head btree_cache; [ffffa03fde4c1150] struct list_head btree_cache_freeable; [ffffa03fde4c1160] struct list_head btree_cache_freed; [ffffa03fde4c1170] unsigned int btree_cache_used; [ffffa03fde4c1178] wait_queue_head_t btree_cache_wait; [ffffa03fde4c1190] struct task_struct *btree_cache_alloc_lock;
crash> list -H ffffa03fde4c1140|wc -l
973
crash> list -H ffffa03fde4c1150|wc -l
1123
crash> cache_set.btree_cache_used -l cache_set.list ffffa03fde4c0050
btree_cache_used = 2097
crash> list -s btree -l btree.list -H ffffa03fde4c1140|grep -E -A2 "^ lock = {" > btree_cache.txt
crash> list -s btree -l btree.list -H ffffa03fde4c1150|grep -E -A2 "^ lock = {" > btree_cache_freeable.txt[root@node-3 127.0.0.1-2023-08-04-16:40:28]# pwd/var/crash/127.0.0.1-2023-08-04-16:40:28
[root@node-3 127.0.0.1-2023-08-04-16:40:28]# cat btree_cache.txt|grep counter|grep -v "counter = 0" [root@node-3 127.0.0.1-2023-08-04-16:40:28]# cat btree_cache_freeable.txt|grep counter|grep -v "counter = 0"
counter = 1
We found that this is a bug in bch_sectors_dirty_init() when locking c->root:
(1). Thread X has locked c->root(A) write.
(2). Thread Y failed to lock c->root(A), waiting for the lock(c->root A).
(3). Thread X bch_btree_set_root() changes c->root from A to B.
(4). Thread X releases the lock(c->root A).
(5). Thread Y successfully locks c->root(A).
(6). Thread Y releases the lock(c->root B).
down_write locked ---(1)----------------------┐
| |
| down_read waiting ---(2)----┐ |
| | ┌-------------┐ ┌-------------┐
bch_btree_set_root ===(3)========>> | c->root A | | c->root B |
| | └-------------┘ └-------------┘
up_write ---(4)---------------------┘ | |
| | |
down_read locked ---(5)-----------┘ |
| |
up_read ---(6)-----------------------------┘Since c->root may change, the correct steps to lock c->root should be the same as bch_root_usage(), compare after locking.
static unsigned int bch_root_usage(struct cache_set *c)
{
unsigned int bytes = 0;
struct bkey *k;
struct btree *b;
struct btree_iter iter;
goto lock_root;
do {
rw_unlock(false, b);
lock_root:
b = c->root;
rw_lock(false, b, b->level);
} while (b != c->root);
for_each_key_filter(&b->keys, k, &iter, bch_ptr_bad)
bytes += bkey_bytes(k);
rw_unlock(false, b);
return (bytes * 100) / btree_bytes(c);
}--- drivers/md/bcache/writeback.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-)
drivers/md/bcache/writeback.c +11 -3
@@ -967,14 +967,22 @@ static int bch_btre_dirty_init_thread_nrvoid bch_sectors_dirty_init (struct bcache_device *d) {int i; +struct btree *b =NULL ;struct bkey *k =NULL ;struct btree_iter iter;struct sectors_dirty_init op;struct cache_set *c = d->c;struct bch_dirty_init_state state; +retry_lock: + b = c->root; +rw_lock (0 , b, b->level); +if (b != c->root) { +rw_unlock (0 , b); + goto retry_lock; + } +/* Just count root keys if no leaf node */ -rw_lock (0 , c->root, c->root->level);if (c->root->level ==0 ) {bch_btree_op_init (&op.op,-1 ); op.inode = d->id;
@@ -987,7 +995,7 @@ void bch_sectors_dirty_init(struct bcachsectors_dirty_init_fn (&op.op, c->root, k); } -rw_unlock (0 , c->root); +rw_unlock (0 , b);return ; }
@@ -1024,7 +1032,7 @@ void bch_sectors_dirty_init(struct bcach out:/* Must wait for all threads to stop. */ wait_event (state.wait,atomic_read (&state.started) ==0 ); -rw_unlock (0 , c->root); +rw_unlock (0 , b); }void bch_cached_dev_writeback_init (struct cached_dev *dc)
Greg Kroah-Hartman
maintainerPATCH 59/69 usb: cdnsp: Fix deadlock issue during using NCM gadget
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pawel Laszczak <[email protected]>
commit 58f2fcb3a845fcbbad2f3196bb37d744e0506250 upstream.
The interrupt service routine registered for the gadget is a primary handler which mask the interrupt source and a threaded handler which handles the source of the interrupt. Since the threaded handler is voluntary threaded, the IRQ-core does not disable bottom halves before invoke the handler like it does for the forced-threaded handler.
Due to changes in networking it became visible that a network gadget's completions handler may schedule a softirq which remains unprocessed. The gadget's completion handler is usually invoked either in hard-IRQ or soft-IRQ context. In this context it is enough to just raise the softirq because the softirq itself will be handled once that context is left. In the case of the voluntary threaded handler, there is nothing that will process pending softirqs. Which means it remain queued until another random interrupt (on this CPU) fires and handles it on its exit path or another thread locks and unlocks a lock with the bh suffix. Worst case is that the CPU goes idle and the NOHZ complains about unhandled softirqs.
Disable bottom halves before acquiring the lock (and disabling interrupts) and enable them after dropping the lock. This ensures that any pending softirqs will handled right away.
--- drivers/usb/cdns3/cdnsp-ring.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/cdns3/cdnsp-ring.c +3 -0
@@ -1522,6 +1522,7 @@ irqreturn_t cdnsp_thread_irq_handler(intunsigned long flags;int counter =0 ; +local_bh_disable ();spin_lock_irqsave (&pdev->lock, flags);if (pdev->cdnsp_state & (CDNSP_STATE_HALTED |CDNSP_STATE_DYING )) {
@@ -1534,6 +1535,7 @@ irqreturn_t cdnsp_thread_irq_handler(intcdnsp_died (pdev);spin_unlock_irqrestore (&pdev->lock, flags); +local_bh_enable ();return IRQ_HANDLED ; }
@@ -1550,6 +1552,7 @@ irqreturn_t cdnsp_thread_irq_handler(intcdnsp_update_erst_dequeue (pdev, event_ring_deq,1 );spin_unlock_irqrestore (&pdev->lock, flags); +local_bh_enable ();return IRQ_HANDLED ; }
Greg Kroah-Hartman
maintainerPATCH 60/69 USB: serial: option: add Fibocom L7xx modules
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Victor Fragoso <[email protected]>
commit e389fe8b68137344562fb6e4d53d8a89ef6212dd upstream.
Add support for Fibocom L716-EU module series.
L716-EU is a Fibocom module based on ZTE's V3E/V3T chipset.
Device creates multiple interfaces when connected to PC as follows:
- Network Interface: ECM or RNDIS (set by FW or AT Command)
- ttyUSB0: AT port
- ttyUSB1: Modem port
- ttyUSB2: AT2 port
- ttyUSB3: Trace port for log information
- ADB: ADB port for debugging. ("Driver=usbfs" when ADB server enabled)
Here are the outputs of lsusb and usb-devices:
$ ls /dev/ttyUSB* /dev/ttyUSB0 /dev/ttyUSB1 /dev/ttyUSB2 /dev/ttyUSB3
usb-devices:
L716-EU (ECM mode):
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 51 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0001 Rev= 1.00 S: Manufacturer=Fibocom,Incorporated S: Product=Fibocom Mobile Boardband S: SerialNumber=1234567890ABCDEF C:* #Ifs= 7 Cfg#= 1 Atr=e0 MxPwr=500mA A: FirstIf#= 0 IfCount= 2 Cls=02(comm.) Sub=06 Prot=00 I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=06 Prot=00 Driver=cdc_ether E: Ad=87(I) Atr=03(Int.) MxPS= 16 Ivl=32ms I: If#= 1 Alt= 0 #EPs= 0 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether I:* If#= 1 Alt= 1 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=cdc_ether E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
L716-EU (RNDIS mode):
T: Bus=03 Lev=01 Prnt=01 Port=01 Cnt=01 Dev#= 49 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=2cb7 ProdID=0001 Rev= 1.00 S: Manufacturer=Fibocom,Incorporated S: Product=Fibocom Mobile Boardband S: SerialNumber=1234567890ABCDEF
C:* #Ifs= 7 Cfg#= 1 Atr=e0 MxPwr=500mA
A: FirstIf#= 0 IfCount= 2 Cls=e0(wlcon) Sub=01 Prot=03
I:* If#= 0 Alt= 0 #EPs= 1 Cls=02(comm.) Sub=02 Prot=ff Driver=rndis_host
E: Ad=87(I) Atr=03(Int.) MxPS= 8 Ivl=32ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 5 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms I:* If#= 6 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=42 Prot=01 Driver=usbfs E: Ad=86(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=06(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
--- drivers/usb/serial/option.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/option.c +1 -0
@@ -2251,6 +2251,7 @@ static const struct usb_device_id option .driver_info = RSVD(4) | RSVD(5) | RSVD(6) }, { USB_DEVICE(0x1782, 0x4d10) }, /* Fibocom L610 (AT mode) */ { USB_DEVICE_INTERFACE_CLASS(0x1782, 0x4d11, 0xff) }, /* Fibocom L610 (ECM/RNDIS mode) */ + { USB_DEVICE_AND_INTERFACE_INFO(0x2cb7, 0x0001, 0xff, 0xff, 0xff) }, /* Fibocom L716-EU (ECM/RNDIS mode) */ { USB_DEVICE(0x2cb7, 0x0104), /* Fibocom NL678 series */ .driver_info = RSVD(4) | RSVD(5) }, { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0105, 0xff), /* Fibocom NL678 series */
Greg Kroah-Hartman
maintainerPATCH 61/69 USB: serial: option: fix FM101R-GL defines
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Puliang Lu <[email protected]>
commit a1092619dd28ac0fcf23016160a2fdccd98ef935 upstream.
Modify the definition of the two Fibocom FM101R-GL PID macros, which had their PIDs switched.
The correct PIDs are:
- VID:PID 413C:8213, FM101R-GL ESIM are laptop M.2 cards (with MBIM interfaces for Linux)
- VID:PID 413C:8215, FM101R-GL are laptop M.2 cards (with MBIM interface for Linux)
0x8213: mbim, tty0x8215: mbim, tty
--- drivers/usb/serial/option.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/usb/serial/option.c +2 -2
@@ -203,8 +203,8 @@ static void option_instat_callback(struc#define DELL_PRODUCT_5829E_ESIM 0x81e4#define DELL_PRODUCT_5829E 0x81e6 -#define DELL_PRODUCT_FM101R 0x8213 -#define DELL_PRODUCT_FM101R_ESIM 0x8215 +#define DELL_PRODUCT_FM101R_ESIM 0x8213 +#define DELL_PRODUCT_FM101R 0x8215#define KYOCERA_VENDOR_ID 0x0c88#define KYOCERA_PRODUCT_KPC650 0x17da
Greg Kroah-Hartman
maintainerPATCH 62/69 USB: serial: option: dont claim interface 4 for ZTE MF290
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lech Perczak <[email protected]>
commit 8771127e25d6c20d458ad27cf32f7fcfc1755e05 upstream.
Interface 4 is used by for QMI interface in stock firmware of MF28D, the router which uses MF290 modem. Free the interface up, to rebind it to qmi_wwan driver.
The proper configuration is:
Interface mapping is:
0: QCDM, 1: (unknown), 2: AT (PCUI), 2: AT (Modem), 4: QMI
T: Bus=01 Lev=02 Prnt=02 Port=00 Cnt=01 Dev#= 4 Spd=480 MxCh= 0 D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1 P: Vendor=19d2 ProdID=0189 Rev= 0.00 S: Manufacturer=ZTE, Incorporated S: Product=ZTE LTE Technologies MSM C:* #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=500mA I:* If#= 0 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 1 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 3 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=option E: Ad=84(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms I:* If#= 4 Alt= 0 #EPs= 3 Cls=ff(vend.) Sub=ff Prot=ff Driver=qmi_wwan E: Ad=86(I) Atr=03(Int.) MxPS= 64 Ivl=2ms E: Ad=87(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms E: Ad=05(O) Atr=02(Bulk) MxPS= 512 Ivl=4ms
--- drivers/usb/serial/option.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/usb/serial/option.c +2 -1
@@ -1548,7 +1548,8 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0165, 0xff, 0xff, 0xff) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0167, 0xff, 0xff, 0xff), .driver_info = RSVD(4) }, - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff) }, + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0189, 0xff, 0xff, 0xff), + .driver_info = RSVD(4) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0191, 0xff, 0xff, 0xff), /* ZTE EuFi890 */ .driver_info = RSVD(4) }, { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x0196, 0xff, 0xff, 0xff) },
Greg Kroah-Hartman
maintainerPATCH 63/69 usb: typec: tcpm: Skip hard reset when in error recovery
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Badhri Jagan Sridharan <[email protected]>
commit a6fe37f428c19dd164c2111157d4a1029bd853aa upstream.
Hard reset queued prior to error recovery (or) received during error recovery will make TCPM to prematurely exit error recovery sequence. Ignore hard resets received during error recovery (or) port reset sequence.
``` [46505.459688] state change SNK_READY -> ERROR_RECOVERY [rev3 NONE_AMS] [46505.459706] state change ERROR_RECOVERY -> PORT_RESET [rev3 NONE_AMS] [46505.460433] disable vbus discharge ret:0 [46505.461226] Setting usb_comm capable false [46505.467244] Setting voltage/current limit 0 mV 0 mA [46505.467262] polarity 0 [46505.470695] Requesting mux state 0, usb-role 0, orientation 0 [46505.475621] cc:=0 [46505.476012] pending state change PORT_RESET -> PORT_RESET_WAIT_OFF @ 100 ms [rev3 NONE_AMS] [46505.476020] Received hard reset [46505.476024] state change PORT_RESET -> HARD_RESET_START [rev3 HARD_RESET] ```
--- drivers/usb/typec/tcpm/tcpm.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/usb/typec/tcpm/tcpm.c +9 -0
@@ -5350,6 +5350,15 @@ static void _tcpm_pd_hard_reset(struct tif (port->bist_request ==BDO_MODE_TESTDATA && port->tcpc->set_bist_data) port->tcpc->set_bist_data (port->tcpc, false); +switch (port->state) { +case ERROR_RECOVERY : +case PORT_RESET : +case PORT_RESET_WAIT_OFF : +return ; +default : +break ; + } +if (port->ams !=NONE_AMS ) port->ams =NONE_AMS ;if (port->hard_reset_count <PD_N_HARD_RESET_COUNT )
Greg Kroah-Hartman
maintainerPATCH 64/69 USB: dwc2: write HCINT with INTMASK applied
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Oliver Neukum <[email protected]>
commit 0583bc776ca5b5a3f5752869fc31cf7322df2b35 upstream.
dwc2_hc_n_intr() writes back INTMASK as read but evaluates it with intmask applied. In stress testing this causes spurious interrupts like this:
[Mon Aug 14 10:51:07 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 7 - ChHltd set, but reason is unknown [Mon Aug 14 10:51:07 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001 [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 0 - ChHltd set, but reason is unknown [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001 [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_hc_chhltd_intr_dma: Channel 4 - ChHltd set, but reason is unknown [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: hcint 0x00000002, intsts 0x04600001 [Mon Aug 14 10:51:08 2023] dwc2 3f980000.usb: dwc2_update_urb_state_abn(): trimming xfer length
Applying INTMASK prevents this. The issue exists in all versions of the driver.
--- drivers/usb/dwc2/hcd_intr.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-)
drivers/usb/dwc2/hcd_intr.c +7 -8
@@ -2045,15 +2045,17 @@ static void dwc2_hc_n_intr(struct dwc2_h {struct dwc2_qtd *qtd;struct dwc2_host_chan *chan; -u32 hcint, hcintmsk; +u32 hcint, hcintraw, hcintmsk; chan = hsotg->hc_ptr_array[chnum]; - hcint =dwc2_readl (hsotg,HCINT (chnum)); + hcintraw =dwc2_readl (hsotg,HCINT (chnum)); hcintmsk =dwc2_readl (hsotg,HCINTMSK (chnum)); + hcint = hcintraw & hcintmsk; +dwc2_writel (hsotg, hcint,HCINT (chnum)); +if (!chan) {dev_err (hsotg->dev,"## hc_ptr_array for channel is NULL ##\n" ); -dwc2_writel (hsotg, hcint,HCINT (chnum));return ; }
@@ -2062,11 +2064,9 @@ static void dwc2_hc_n_intr(struct dwc2_h chnum);dev_vdbg (hsotg->dev," hcint 0x%08x, hcintmsk 0x%08x, hcint&hcintmsk 0x%08x\n" , - hcint, hcintmsk, hcint & hcintmsk); + hcintraw, hcintmsk, hcint); } -dwc2_writel (hsotg, hcint,HCINT (chnum)); -/* * If we got an interrupt after someone called * dwc2_hcd_endpoint_disable() we don't want to crash below
@@ -2076,8 +2076,7 @@ static void dwc2_hc_n_intr(struct dwc2_hreturn ; } - chan->hcint = hcint; - hcint &= hcintmsk; + chan->hcint = hcintraw;/* * If the channel was halted due to a dequeue, the qtd list might
Greg Kroah-Hartman
maintainerPATCH 65/69 usb: dwc3: Fix default mode initialization
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
commit 10d510abd096d620b9fda2dd3e0047c5efc4ad2b upstream.
The default mode, configurable by DT, shall be set before usb role switch driver is registered. Otherwise there is a race between default mode and mode set by usb role switch driver.
--- drivers/usb/dwc3/drd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/dwc3/drd.c +1 -1
@@ -545,6 +545,7 @@ static int dwc3_setup_role_switch(struct dwc->role_switch_default_mode =USB_DR_MODE_PERIPHERAL ; mode =DWC3_GCTL_PRTCAP_DEVICE ; } +dwc3_set_mode (dwc, mode); dwc3_role_switch.fwnode =dev_fwnode (dwc->dev); dwc3_role_switch.set = dwc3_usb_role_switch_set;
@@ -554,7 +555,6 @@ static int dwc3_setup_role_switch(structif (IS_ERR (dwc->role_sw))return PTR_ERR (dwc->role_sw); -dwc3_set_mode (dwc, mode); return 0; }#else
Greg Kroah-Hartman
maintainerPATCH 66/69 usb: dwc3: set the dma max_seg_size
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Ribalda <[email protected]>
commit 8bbae288a85abed6a1cf7d185d8b9dc2f5dcb12c upstream.
Allow devices to have dma operations beyond 4K, and avoid warnings such as:
DMA-API: dwc3 a600000.usb: mapping sg segment longer than device claims to support [len=86016] [max=65536]
--- drivers/usb/dwc3/core.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/dwc3/core.c +2 -0
@@ -1701,6 +1701,8 @@ static int dwc3_probe(struct platform_depm_runtime_put (dev); +dma_set_max_seg_size (dev,UINT_MAX ); +return 0 ; err5:
Greg Kroah-Hartman
maintainerPATCH 67/69 USB: dwc3: qcom: fix software node leak on probe errors
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 9feefbf57d92e8ee293dad67585d351c7d0b6e37 upstream.
Make sure to remove the software node also on (ACPI) probe errors to avoid leaking the underlying resources.
Note that the software node is only used for ACPI probe so the driver unbind tear down is updated to match probe.
--- drivers/usb/dwc3/dwc3-qcom.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/usb/dwc3/dwc3-qcom.c +8 -5
@@ -883,10 +883,12 @@ static int dwc3_qcom_probe(struct platfo interconnect_exit:dwc3_qcom_interconnect_exit (qcom); depopulate: -if (np) +if (np) {of_platform_depopulate (&pdev->dev); -else + }else { +device_remove_software_node (&qcom->dwc3->dev);platform_device_del (qcom->dwc3); + }platform_device_put (qcom->dwc3); free_urs:if (qcom->urs_usb)
@@ -909,11 +911,12 @@ static int dwc3_qcom_remove(struct platfstruct device *dev = &pdev->dev;int i; -device_remove_software_node (&qcom->dwc3->dev); -if (np) +if (np) {of_platform_depopulate (&pdev->dev); -else + }else { +device_remove_software_node (&qcom->dwc3->dev);platform_device_del (qcom->dwc3); + }platform_device_put (qcom->dwc3);if (qcom->urs_usb)
Greg Kroah-Hartman
maintainerPATCH 50/69 s390/dasd: protect device queue against concurrent access
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jan Höppner <[email protected]>
commit db46cd1e0426f52999d50fa72cfa97fa39952885 upstream.
In dasd_profile_start() the amount of requests on the device queue are counted. The access to the device queue is unprotected against concurrent access. With a lot of parallel I/O, especially with alias devices enabled, the device queue can change while dasd_profile_start() is accessing the queue. In the worst case this leads to a kernel panic due to incorrect pointer accesses.
Fix this by taking the device lock before accessing the queue and counting the requests. Additionally the check for a valid profile data pointer can be done earlier to avoid unnecessary locking in a hot path.
--- drivers/s390/block/dasd.c | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-)
drivers/s390/block/dasd.c +13 -11
@@ -697,18 +697,20 @@ static void dasd_profile_start(struct da* we count each request only once. */ device = cqr->startdev; -if (device->profile.data) { - counter =1 ;/* request is not yet queued on the start device */ -list_for_each (l, &device->ccw_queue) -if (++counter >=31 ) -break ; - } +if (!device->profile.data) +return ; + +spin_lock (get_ccwdev_lock (device->cdev)); + counter =1 ;/* request is not yet queued on the start device */ +list_for_each (l, &device->ccw_queue) +if (++counter >=31 ) +break ; +spin_unlock (get_ccwdev_lock (device->cdev)); +spin_lock (&device->profile.lock); -if (device->profile.data) { - device->profile.data->dasd_io_nr_req[counter]++; -if (rq_data_dir (req) ==READ ) - device->profile.data->dasd_read_nr_req[counter]++; - } + device->profile.data->dasd_io_nr_req[counter]++; +if (rq_data_dir (req) ==READ ) + device->profile.data->dasd_read_nr_req[counter]++;spin_unlock (&device->profile.lock); }
Greg Kroah-Hartman
maintainerPATCH 68/69 USB: dwc3: qcom: fix wakeup after probe deferral
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 41f5a0973259db9e4e3c9963d36505f80107d1a0 upstream.
The Qualcomm glue driver is overriding the interrupt trigger types defined by firmware when requesting the wakeup interrupts during probe.
This can lead to a failure to map the DP/DM wakeup interrupts after a probe deferral as the firmware defined trigger types do not match the type used for the initial mapping:
irq: type mismatch, failed to map hwirq-14 for interrupt-controller@b220000!
irq: type mismatch, failed to map hwirq-15 for interrupt-controller@b220000!
Fix this by not overriding the firmware provided trigger types when requesting the wakeup interrupts.
--- drivers/usb/dwc3/dwc3-qcom.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
drivers/usb/dwc3/dwc3-qcom.c +4 -4
@@ -492,7 +492,7 @@ static int dwc3_qcom_setup_irq(struct plirq_set_status_flags (irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (qcom->dev, irq,NULL , qcom_dwc3_resume_irq, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , +IRQF_ONESHOT ,"qcom_dwc3 HS" , qcom);if (ret) {dev_err (qcom->dev,"hs_phy_irq failed: %d\n" , ret);
@@ -507,7 +507,7 @@ static int dwc3_qcom_setup_irq(struct plirq_set_status_flags (irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (qcom->dev, irq,NULL , qcom_dwc3_resume_irq, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , +IRQF_ONESHOT ,"qcom_dwc3 DP_HS" , qcom);if (ret) {dev_err (qcom->dev,"dp_hs_phy_irq failed: %d\n" , ret);
@@ -522,7 +522,7 @@ static int dwc3_qcom_setup_irq(struct plirq_set_status_flags (irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (qcom->dev, irq,NULL , qcom_dwc3_resume_irq, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , +IRQF_ONESHOT ,"qcom_dwc3 DM_HS" , qcom);if (ret) {dev_err (qcom->dev,"dm_hs_phy_irq failed: %d\n" , ret);
@@ -537,7 +537,7 @@ static int dwc3_qcom_setup_irq(struct plirq_set_status_flags (irq,IRQ_NOAUTOEN ); ret =devm_request_threaded_irq (qcom->dev, irq,NULL , qcom_dwc3_resume_irq, -IRQF_TRIGGER_HIGH |IRQF_ONESHOT , +IRQF_ONESHOT ,"qcom_dwc3 SS" , qcom);if (ret) {dev_err (qcom->dev,"ss_phy_irq failed: %d\n" , ret);
Greg Kroah-Hartman
maintainerPATCH 69/69 io_uring: fix off-by one bvec index
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Keith Busch <[email protected]>
commit d6fef34ee4d102be448146f24caf96d7b4a05401 upstream.
If the offset equals the bv_len of the first registered bvec, then the request does not include any of that first bvec. Skip it so that drivers don't have to deal with a zero length bvec, which was observed to break NVMe's PRP list creation.
--- io_uring/io_uring.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
io_uring/io_uring.c +1 -1
@@ -3152,7 +3152,7 @@ static int __io_import_fixed(struct io_k*/ const struct bio_vec *bvec = imu->bvec; -if (offset <= bvec->bv_len) { +if (offset < bvec->bv_len) {iov_iter_advance (iter, offset); }else {unsigned long seg_skip;
Greg Kroah-Hartman
maintainerPATCH 51/69 USB: serial: option: add Luat Air72*U series products
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Asuna Yang <[email protected]>
commit da90e45d5afc4da2de7cd3ea7943d0f1baa47cc2 upstream.
Update the USB serial option driver support for Luat Air72*U series products.
ID 1782:4e00 Spreadtrum Communications Inc. UNISOC-8910
T: Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#= 13 Spd=480 MxCh= 0
D: Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs= 1
P: Vendor=1782 ProdID=4e00 Rev=00.00
S: Manufacturer=UNISOC
S: Product=UNISOC-8910
C: #Ifs= 5 Cfg#= 1 Atr=e0 MxPwr=400mA
I: If#= 0 Alt= 0 #EPs= 1 Cls=e0(wlcon) Sub=01 Prot=03 Driver=rndis_host
E: Ad=82(I) Atr=03(Int.) MxPS= 8 Ivl=4096ms
I: If#= 1 Alt= 0 #EPs= 2 Cls=0a(data ) Sub=00 Prot=00 Driver=rndis_host
E: Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 2 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=83(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 3 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=03(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=84(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I: If#= 4 Alt= 0 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=option
E: Ad=04(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E: Ad=85(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
If#= 2: AT
If#= 3: PPP + AT
If#= 4: Debug
--- drivers/usb/serial/option.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/serial/option.c +3 -0
@@ -609,6 +609,8 @@ static void option_instat_callback(struc#define UNISOC_VENDOR_ID 0x1782/* TOZED LT70-C based on UNISOC SL8563 uses UNISOC's vendor ID */ #define TOZED_PRODUCT_LT70C 0x4055 +/* Luat Air72*U series based on UNISOC UIS8910 uses UNISOC's vendor ID */ +#define LUAT_PRODUCT_AIR720U 0x4e00/* Device flags */
@@ -2271,6 +2273,7 @@ static const struct usb_device_id option { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x40) }, { USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) }, { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) }, + { USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, LUAT_PRODUCT_AIR720U, 0xff, 0, 0) }, { } /* Terminating entry */ };MODULE_DEVICE_TABLE (usb, option_ids);
Greg Kroah-Hartman
maintainerPATCH 52/69 hv_netvsc: Fix race of register_netdevice_notifier and VF register
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Haiyang Zhang <[email protected]>
commit 85520856466ed6bc3b1ccb013cddac70ceb437db upstream.
If VF NIC is registered earlier, NETDEV_REGISTER event is replayed, but NETDEV_POST_INIT is not.
Move register_netdevice_notifier() earlier, so the call back function is set before probing.
--- drivers/net/hyperv/netvsc_drv.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/hyperv/netvsc_drv.c +7 -2
@@ -2807,12 +2807,17 @@ static int __init netvsc_drv_init(void) } netvsc_ring_bytes = ring_size *PAGE_SIZE ; +register_netdevice_notifier (&netvsc_netdev_notifier); + ret =vmbus_driver_register (&netvsc_drv);if (ret) -return ret; + goto err_vmbus_reg; -register_netdevice_notifier (&netvsc_netdev_notifier);return 0 ; + +err_vmbus_reg: +unregister_netdevice_notifier (&netvsc_netdev_notifier); +return ret; }MODULE_LICENSE ("GPL" );
Greg Kroah-Hartman
maintainerPATCH 53/69 hv_netvsc: Mark VF as slave before exposing it to user-mode
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Long Li <[email protected]>
commit c807d6cd089d2f4951baa838081ec5ae3e2360f8 upstream.
When a VF is being exposed form the kernel, it should be marked as "slave" before exposing to the user-mode. The VF is not usable without netvsc running as master. The user-mode should never see a VF without the "slave" flag.
This commit moves the code of setting the slave flag to the time before VF is exposed to user-mode.
--- drivers/net/hyperv/netvsc_drv.c | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-)
drivers/net/hyperv/netvsc_drv.c +23 -9
@@ -2227,9 +2227,6 @@ static int netvsc_vf_join(struct net_dev goto upper_link_failed; } -/* set slave flag before open to prevent IPv6 addrconf */ - vf_netdev->flags |=IFF_SLAVE ; -schedule_delayed_work (&ndev_ctx->vf_takeover,VF_TAKEOVER_INT );call_netdevice_notifiers (NETDEV_JOIN , vf_netdev);
@@ -2336,16 +2333,18 @@ static struct net_device *get_netvsc_bys } -/* Fallback path to check synthetic vf with -* help of mac addr +/* Fallback path to check synthetic vf with help of mac addr. +* Because this function can be called before vf_netdev is +* initialized (NETDEV_POST_INIT) when its perm_addr has not been copied +* from dev_addr, also try to match to its dev_addr. +* Note: On Hyper-V and Azure, it's not possible to set a MAC address +* on a VF that matches to the MAC of a unrelated NETVSC device. */ list_for_each_entry (ndev_ctx, &netvsc_dev_list, list) { ndev =hv_get_drvdata (ndev_ctx->device_ctx); -if (ether_addr_equal (vf_netdev->perm_addr, ndev->perm_addr)) { -netdev_notice (vf_netdev, -"falling back to mac addr based matching\n" ); +if (ether_addr_equal (vf_netdev->perm_addr, ndev->perm_addr) || +ether_addr_equal (vf_netdev->dev_addr, ndev->perm_addr))return ndev; - } } netdev_notice(vf_netdev,
@@ -2353,6 +2352,19 @@ static struct net_device *get_netvsc_bysreturn NULL ; } +static int netvsc_prepare_bonding (struct net_device *vf_netdev) +{ +struct net_device *ndev; + + ndev =get_netvsc_byslot (vf_netdev); +if (!ndev) +return NOTIFY_DONE ; + +/* set slave flag before open to prevent IPv6 addrconf */ + vf_netdev->flags |=IFF_SLAVE ; +return NOTIFY_DONE ; +} +static int netvsc_register_vf (struct net_device *vf_netdev) {struct net_device_context *net_device_ctx;
@@ -2772,6 +2784,8 @@ static int netvsc_netdev_event(struct noreturn NOTIFY_DONE ;switch (event) { +case NETDEV_POST_INIT : +return netvsc_prepare_bonding (event_dev);case NETDEV_REGISTER :return netvsc_register_vf (event_dev);case NETDEV_UNREGISTER :
Greg Kroah-Hartman
maintainerPATCH 54/69 dm-delay: fix a race between delay_presuspend and delay_bio
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mikulas Patocka <[email protected]>
[ Upstream commit 6fc45b6ed921dc00dfb264dc08c7d67ee63d2656 ]
In delay_presuspend, we set the atomic variable may_delay and then stop the timer and flush pending bios. The intention here is to prevent the delay target from re-arming the timer again.
However, this test is racy. Suppose that one thread goes to delay_bio, sees that dc->may_delay is one and proceeds; now, another thread executes delay_presuspend, it sets dc->may_delay to zero, deletes the timer and flushes pending bios. Then, the first thread continues and adds the bio to delayed->list despite the fact that dc->may_delay is false.
Fix this bug by changing may_delay's type from atomic_t to bool and only access it while holding the delayed_bios_lock mutex. Note that we don't have to grab the mutex in delay_resume because there are no bios in flight at this point.
--- drivers/md/dm-delay.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-)
drivers/md/dm-delay.c +12 -5
@@ -30,7 +30,7 @@ struct delay_c {struct workqueue_struct *kdelayd_wq;struct work_struct flush_expired_bios;struct list_head delayed_bios; -atomic_t may_delay; +bool may_delay;struct delay_class read;struct delay_class write;
@@ -191,7 +191,7 @@ static int delay_ctr(struct dm_target *ti, unsigned int argc, char **argv)INIT_WORK (&dc->flush_expired_bios, flush_expired_bios);INIT_LIST_HEAD (&dc->delayed_bios);mutex_init (&dc->timer_lock); -atomic_set (&dc->may_delay,1 ); + dc->may_delay = true; dc->argc = argc; ret =delay_class_ctr (ti, &dc->read, argv);
@@ -245,7 +245,7 @@ static int delay_bio(struct delay_c *dc, struct delay_class *c, struct bio *bio)struct dm_delay_info *delayed;unsigned long expires =0 ; -if (!c->delay || !atomic_read (&dc->may_delay)) +if (!c->delay)return DM_MAPIO_REMAPPED ; delayed =dm_per_bio_data (bio,sizeof (struct dm_delay_info ));
@@ -254,6 +254,10 @@ static int delay_bio(struct delay_c *dc, struct delay_class *c, struct bio *bio) delayed->expires = expires = jiffies +msecs_to_jiffies (c->delay);mutex_lock (&delayed_bios_lock); +if (unlikely (!dc->may_delay)) { +mutex_unlock (&delayed_bios_lock); +return DM_MAPIO_REMAPPED ; + } c->ops++;list_add_tail (&delayed->list, &dc->delayed_bios);mutex_unlock (&delayed_bios_lock);
@@ -267,7 +271,10 @@ static void delay_presuspend(struct dm_target *ti) {struct delay_c *dc = ti->private; -atomic_set (&dc->may_delay,0 ); +mutex_lock (&delayed_bios_lock); + dc->may_delay = false; +mutex_unlock (&delayed_bios_lock); +del_timer_sync (&dc->delay_timer);flush_bios (flush_delayed_bios (dc,1 )); }
@@ -276,7 +283,7 @@ static void delay_resume(struct dm_target *ti) {struct delay_c *dc = ti->private; -atomic_set (&dc->may_delay,1 ); + dc->may_delay = true; }static int delay_map (struct dm_target *ti,struct bio *bio)
Signature · 1 line
2.42.0
Greg Kroah-Hartman
maintainerPATCH 55/69 bcache: check return value from btree_node_alloc_replacement()
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Coly Li <[email protected]>
commit 777967e7e9f6f5f3e153abffb562bffaf4430d26 upstream.
In btree_gc_rewrite_node(), pointer 'n' is not checked after it returns from btree_gc_rewrite_node(). There is potential possibility that 'n' is a non NULL ERR_PTR(), referencing such error code is not permitted in following code. Therefore a return value checking is necessary after 'n' is back from btree_node_alloc_replacement().
--- drivers/md/bcache/btree.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/md/bcache/btree.c +2 -0
@@ -1506,6 +1506,8 @@ static int btree_gc_rewrite_node(structreturn 0 ; n =btree_node_alloc_replacement (replace,NULL ); +if (IS_ERR (n)) +return 0 ;/* recheck reserve after allocating replacement node */ if (btree_check_reserve (b,NULL )) {
Greg Kroah-Hartman
maintainerPATCH 56/69 bcache: prevent potential division by zero error
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rand Deeb <[email protected]>
commit 2c7f497ac274a14330208b18f6f734000868ebf9 upstream.
In SHOW(), the variable 'n' is of type 'size_t.' While there is a conditional check to verify that 'n' is not equal to zero before executing the 'do_div' macro, concerns arise regarding potential division by zero error in 64-bit environments.
The concern arises when 'n' is 64 bits in size, greater than zero, and the lower 32 bits of it are zeros. In such cases, the conditional check passes because 'n' is non-zero, but the 'do_div' macro casts 'n' to 'uint32_t,' effectively truncating it to its lower 32 bits. Consequently, the 'n' value becomes zero.
To fix this potential division by zero error and ensure precise division handling, this commit replaces the 'do_div' macro with div64_u64(). div64_u64() is designed to work with 64-bit operands, guaranteeing that division is performed correctly.
This change enhances the robustness of the code, ensuring that division operations yield accurate results in all scenarios, eliminating the possibility of division by zero, and improving compatibility across different 64-bit environments.
Found by Linux Verification Center (linuxtesting.org) with SVACE.
--- drivers/md/bcache/sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/md/bcache/sysfs.c +1 -1
@@ -1099,7 +1099,7 @@ SHOW(__bch_cache) sum +=INITIAL_PRIO - cached[i];if (n) -do_div (sum, n); + sum =div64_u64 (sum, n);for (i =0 ; i <ARRAY_SIZE (q); i++) q[i] = INITIAL_PRIO - cached[n * (i + 1) /
Greg Kroah-Hartman
maintainerPATCH 57/69 bcache: fixup init dirty data errors
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingzhe Zou <[email protected]>
commit 7cc47e64d3d69786a2711a4767e26b26ba63d7ed upstream.
We found that after long run, the dirty_data of the bcache device will have errors. This error cannot be eliminated unless re-register.
We also found that reattach after detach, this error can accumulate.
In bch_sectors_dirty_init(), all inode <= d->id keys will be recounted again. This is wrong, we only need to count the keys of the current device.
--- drivers/md/bcache/writeback.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/md/bcache/writeback.c +4 -1
@@ -981,8 +981,11 @@ void bch_sectors_dirty_init(struct bcach op.count =0 ;for_each_key_filter (&c->root->keys, - k, &iter, bch_ptr_invalid) + k, &iter, bch_ptr_invalid) { +if (KEY_INODE (k) != op.inode) +continue ;sectors_dirty_init_fn (&op.op, c->root, k); + }rw_unlock (0 , c->root);return ;
Greg Kroah-Hartman
maintainerPATCH 48/69 bcache: fixup multi-threaded bch_sectors_dirty_init() wake-up race
In reply to Greg Kroah-Hartman5.15-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mingzhe Zou <[email protected]>
commit 2faac25d7958c4761bb8cec54adb79f806783ad6 upstream.
We get a kernel crash about "unable to handle kernel paging request":
```dmesg [368033.032005] BUG: unable to handle kernel paging request at ffffffffad9ae4b5 [368033.032007] PGD fc3a0d067 P4D fc3a0d067 PUD fc3a0e063 PMD 8000000fc38000e1 [368033.032012] Oops: 0003 [#1] SMP PTI [368033.032015] CPU: 23 PID: 55090 Comm: bch_dirtcnt[0] Kdump: loaded Tainted: G OE --------- - - 4.18.0-147.5.1.es8_24.x86_64 #1 [368033.032017] Hardware name: Tsinghua Tongfang THTF Chaoqiang Server/072T6D, BIOS 2.4.3 01/17/2017 [368033.032027] RIP: 0010:native_queued_spin_lock_slowpath+0x183/0x1d0 [368033.032029] Code: 8b 02 48 85 c0 74 f6 48 89 c1 eb d0 c1 e9 12 83 e0 03 83 e9 01 48 c1 e0 05 48 63 c9 48 05 c0 3d 02 00 48 03 04 cd 60 68 93 ad <48> 89 10 8b 42 08 85 c0 75 09 f3 90 8b 42 08 85 c0 74 f7 48 8b 02 [368033.032031] RSP: 0018:ffffbb48852abe00 EFLAGS: 00010082 [368033.032032] RAX: ffffffffad9ae4b5 RBX: 0000000000000246 RCX: 0000000000003bf3 [368033.032033] RDX: ffff97b0ff8e3dc0 RSI: 0000000000600000 RDI: ffffbb4884743c68 [368033.032034] RBP: 0000000000000001 R08: 0000000000000000 R09: 000007ffffffffff [368033.032035] R10: ffffbb486bb01000 R11: 0000000000000001 R12: ffffffffc068da70 [368033.032036] R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000 [368033.032038] FS: 0000000000000000(0000) GS:ffff97b0ff8c0000(0000) knlGS:0000000000000000 [368033.032039] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [368033.032040] CR2: ffffffffad9ae4b5 CR3: 0000000fc3a0a002 CR4: 00000000003626e0 [368033.032042] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [368033.032043] bcache: bch_cached_dev_attach() Caching rbd479 as bcache462 on set 8cff3c36-4a76-4242-afaa-7630206bc70b [368033.032045] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 [368033.032046] Call Trace: [368033.032054] _raw_spin_lock_irqsave+0x32/0x40 [368033.032061] __wake_up_common_lock+0x63/0xc0 [368033.032073] ? bch_ptr_invalid+0x10/0x10 [bcache] [368033.033502] bch_dirty_init_thread+0x14c/0x160 [bcache] [368033.033511] ? read_dirty_submit+0x60/0x60 [bcache] [368033.033516] kthread+0x112/0x130 [368033.033520] ? kthread_flush_work_fn+0x10/0x10 [368033.034505] ret_from_fork+0x35/0x40 ```
The crash occurred when call wake_up(&state->wait), and then we want to look at the value in the state. However, bch_sectors_dirty_init() is not found in the stack of any task. Since state is allocated on the stack, we guess that bch_sectors_dirty_init() has exited, causing bch_dirty_init_thread() to be unable to handle kernel paging request.
In order to verify this idea, we added some printing information during wake_up(&state->wait). We find that "wake up" is printed twice, however we only expect the last thread to wake up once.
```dmesg [ 994.641004] alcache: bch_dirty_init_thread() wake up [ 994.641018] alcache: bch_dirty_init_thread() wake up [ 994.641523] alcache: bch_sectors_dirty_init() init exit ```
There is a race. If bch_sectors_dirty_init() exits after the first wake up, the second wake up will trigger this bug("unable to handle kernel paging request").
Proceed as follows:
bch_sectors_dirty_init
kthread_run ==============> bch_dirty_init_thread(bch_dirtcnt[0])
... ...
atomic_inc(&state.started) ...
... ...
atomic_read(&state.enough) ...
... atomic_set(&state->enough, 1)
kthread_run ======================================================> bch_dirty_init_thread(bch_dirtcnt[1])
... atomic_dec_and_test(&state->started) ...
atomic_inc(&state.started) ... ...
... wake_up(&state->wait) ...
atomic_read(&state.enough) atomic_dec_and_test(&state->started)
... ...
wait_event(state.wait, atomic_read(&state.started) == 0) ...
return ...
wake_up(&state->wait)We believe it is very common to wake up twice if there is no dirty, but crash is an extremely low probability event. It's hard for us to reproduce this issue. We attached and detached continuously for a week, with a total of more than one million attaches and only one crash.
Putting atomic_inc(&state.started) before kthread_run() can avoid waking up twice.
--- drivers/md/bcache/writeback.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/md/bcache/writeback.c +2 -1
@@ -1004,17 +1004,18 @@ void bch_sectors_dirty_init(struct bcachif (atomic_read (&state.enough))break ; +atomic_inc (&state.started); state.infos[i].state = &state; state.infos[i].thread =kthread_run (bch_dirty_init_thread, &state.infos[i],"bch_dirtcnt[%d]" , i);if (IS_ERR (state.infos[i].thread)) {pr_err ("fails to run thread bch_dirty_init[%d]\n" , i); +atomic_dec (&state.started);for (--i; i >=0 ; i--)kthread_stop (state.infos[i].thread); goto out; } -atomic_inc (&state.started); } out:
Hello!
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-lkftconfig arm64 * clang-lkftconfig arm * clang-lkftconfig i386 * clang-lkftconfig x86_64 * gcc-12-lkftconfig arm64 * gcc-12-lkftconfig arm * gcc-12-lkftconfig i386 * gcc-12-lkftconfig x86_64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-armv8_features arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm * gcc-12-lkftconfig-debug i386 * gcc-12-lkftconfig-debug x86_64 * gcc-12-lkftconfig-debug-kmemleak arm64 * gcc-12-lkftconfig-debug-kmemleak arm * gcc-12-lkftconfig-debug-kmemleak i386 * gcc-12-lkftconfig-debug-kmemleak x86_64 * gcc-12-lkftconfig-devicetree arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan x86_64 * gcc-12-lkftconfig-kselftest arm64 * gcc-12-lkftconfig-kselftest-kernel arm64 * gcc-12-lkftconfig-kselftest-kernel arm * gcc-12-lkftconfig-kselftest-kernel i386 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm * gcc-12-lkftconfig-kunit i386 * gcc-12-lkftconfig-kunit x86_64 * gcc-12-lkftconfig-libgpiod arm64 * gcc-12-lkftconfig-libgpiod arm * gcc-12-lkftconfig-libgpiod i386 * gcc-12-lkftconfig-libgpiod x86_64 * gcc-12-lkftconfig-perf arm64 * gcc-12-lkftconfig-perf-kernel arm64 * gcc-12-lkftconfig-perf-kernel arm * gcc-12-lkftconfig-perf-kernel i386 * gcc-12-lkftconfig-perf-kernel x86_64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm * gcc-12-lkftconfig-rcutorture i386 * gcc-12-lkftconfig-rcutorture x86_64
It's essentially this:
-----8<-----
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51:
unreachable instruction
x86_64-linux-gnu-ld: kernel/trace/trace_kprobe.o: in function
`__trace_kprobe_create':
trace_kprobe.c:(.text+0x2f39): undefined reference to
`kallsyms_on_each_symbol'
x86_64-linux-gnu-ld: kernel/trace/trace_kprobe.o: in function
`create_local_trace_kprobe':
trace_kprobe.c:(.text+0x384b): undefined reference to
`kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.
----->8-----
It only affects 5.15. Bisection in progress.
Greetings!
Daniel Díaz
[email protected]
Quoted 296 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.141 release. There are 69 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 02 Dec 2023 16:21:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.141-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:Greg Kroah-Hartman <[email protected]>
Linux 5.15.141-rc1Keith Busch <[email protected]>
io_uring: fix off-by one bvec indexJohan Hovold <[email protected]>
USB: dwc3: qcom: fix wakeup after probe deferralJohan Hovold <[email protected]>
USB: dwc3: qcom: fix software node leak on probe errorsRicardo Ribalda <[email protected]>
usb: dwc3: set the dmamax_seg_sizeAlexander Stein <[email protected]>
usb: dwc3: Fix default mode initializationOliver Neukum <[email protected]>
USB: dwc2: write HCINT with INTMASK appliedBadhri Jagan Sridharan <[email protected]>
usb: typec: tcpm: Skip hard reset when in error recoveryLech Perczak <[email protected]>
USB: serial: option: don't claim interface 4 for ZTE MF290Puliang Lu <[email protected]>
USB: serial: option: fix FM101R-GL definesVictor Fragoso <[email protected]>
USB: serial: option: add Fibocom L7xx modulesPawel Laszczak <[email protected]>
usb: cdnsp: Fix deadlock issue during using NCM gadgetMingzhe Zou <[email protected]>
bcache: fixup lock c->root errorMingzhe Zou <[email protected]>
bcache: fixup init dirty data errorsRand Deeb <[email protected]>
bcache: prevent potential division by zero errorColy Li <[email protected]>
bcache: check return value frombtree_node_alloc_replacement()Mikulas Patocka <[email protected]>
dm-delay: fix a race betweendelay_presuspendanddelay_bioLong Li <[email protected]>
hv_netvsc: Mark VF as slave before exposing it to user-modeHaiyang Zhang <[email protected]>
hv_netvsc: Fix race ofregister_netdevice_notifierand VF registerAsuna Yang <[email protected]>
USB: serial: option: add Luat Air72*U series productsJan Höppner <[email protected]>
s390/dasd: protect device queue against concurrent accessCharles Mirabile <[email protected]>
io_uring/fs: consider link->flags when getting path for LINKATMingzhe Zou <[email protected]>
bcache: fixup multi-threadedbch_sectors_dirty_init()wake-up raceSong Liu <[email protected]>
md: fixbi_statusreporting inmd_end_clone_ioColy Li <[email protected]>
bcache: replace a mistakenIS_ERR()byIS_ERR_OR_NULL()inbtree_gc_coalesce()Keith Busch <[email protected]>
swiotlb-xen: provide the "max_mapping_size" methodHans de Goede <[email protected]>
ACPI: resource: Skip IRQ override on ASUS ExpertBook B1402CVAKrister Johansen <[email protected]>
proc: sysctl: prevent aliased sysctls from getting passed to initFrancis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbolsZhang Yi <[email protected]>
ext4: make sure allocate pending entry not failBaokun Li <[email protected]>
ext4: fix slab-use-after-free inext4_es_insert_extent()Baokun Li <[email protected]>
ext4: using nofail preallocation inext4_es_insert_extent()Baokun Li <[email protected]>
ext4: using nofail preallocation inext4_es_insert_delayed_block()Baokun Li <[email protected]>
ext4: using nofail preallocation inext4_es_remove_extent()Baokun Li <[email protected]>
ext4: use pre-allocated es in__es_remove_extent()Baokun Li <[email protected]>
ext4: use pre-allocated es in__es_insert_extent()Baokun Li <[email protected]>
ext4: factor out__es_alloc_extent()and__es_free_extent()Baokun Li <[email protected]>
ext4: add a new helper to check if es must be keptAndrey Konovalov <[email protected]>
media: qcom: camss: Fix csid-gen2 for test pattern generatorBryan O'Donoghue <[email protected]>
media: qcom: camss: Fix setCSI2_RX_CFG1_VC_MODEwhen VC is greater than 3Milen Mitkov <[email protected]>
media: camss: sm8250: Virtual channels for CSIDSouptick Joarder (HPE) <[email protected]>
media: camss: Replace hard coded value with parameterHuacai Chen <[email protected]>
MIPS: KVM: Fix a build warning about variable set but not usedPeter Zijlstra <[email protected]>
lockdep: Fix block chain corruptionJohan Hovold <[email protected]>
USB: dwc3: qcom: fix ACPI platform device leakJohan Hovold <[email protected]>
USB: dwc3: qcom: fix resource leaks on probe deferralChristoph Hellwig <[email protected]>
nvmet: nul-terminate the NQNs passed in the connect commandDavid Howells <[email protected]>
afs: Fix file locking on R/O volumes to operate in local modeDavid Howells <[email protected]>
afs: Return ENOENT if no cell DNS record can be foundSamuel Holland <[email protected]>
net: axienet: Fix check for partial TX checksumRaju Rangoju <[email protected]>
amd-xgbe: propagate the correct speed and duplex statusRaju Rangoju <[email protected]>
amd-xgbe: handle the corner-case during tx completionRaju Rangoju <[email protected]>
amd-xgbe: handle corner-case during sfp hotplugSuman Ghosh <[email protected]>
octeontx2-pf: Fix ntuple rule creation to direct packet to VF with higher Rx queue than its PFStefano Stabellini <[email protected]>
arm/xen: fixxen_vcpu_infoallocation alignmentD. Wythe <[email protected]>
net/smc: avoid data corruption caused by declineJose Ignacio Tornos Martinez <[email protected]>
net: usb: ax88179_178a: fix failed operations during ax88179_resetKunwu Chan <[email protected]>
ipv4: Correct/silence an endian warning in__ip_do_redirectCharles Yi <[email protected]>
HID: fix HID device resource race between HID core and debugging supportBenjamin Tissoires <[email protected]>
HID: core: store the unique system identifier inhid_deviceJonas Karlman <[email protected]>
drm/rockchip: vop: Fix color for RGB888/BGR888 format on VOP fullChen Ni <[email protected]>
ata:pata_isapnp: Add missing error check fordevm_ioport_map()Suman Ghosh <[email protected]>
octeontx2-pf: Fix memory leak during interface downEric Dumazet <[email protected]>
wireguard: useDEV_STATS_INC()Marek Vasut <[email protected]>
drm/panel: simple: Fix Innolux G101ICE-L01 timingsMarek Vasut <[email protected]>
drm/panel: simple: Fix Innolux G101ICE-L01 bus flagsXuxin Xiong <[email protected]>
drm/panel: auo,b101uan08.3: Fine tune the panel power sequenceShuijing Li <[email protected]>
drm/panel: boe-tv101wum-nl6: Fine tune the panel power sequenceDavid Howells <[email protected]>
afs: Make error on cell lookup failure consistent with OpenAFSDavid Howells <[email protected]>
afs: Fixafs_server_listto be cleaned up with RCU-------------
Diffstat:
Makefile | 4 +- arch/arm/xen/enlighten.c | 3 +- arch/mips/kvm/mmu.c | 3 +- drivers/acpi/resource.c | 7 + drivers/ata/pata_isapnp.c | 3 + drivers/gpu/drm/panel/panel-boe-tv101wum-nl6.c | 7 + drivers/gpu/drm/panel/panel-simple.c | 13 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 14 +- drivers/hid/hid-core.c | 16 +- drivers/hid/hid-debug.c | 3 + drivers/md/bcache/btree.c | 4 +- drivers/md/bcache/sysfs.c | 2 +- drivers/md/bcache/writeback.c | 22 +- drivers/md/dm-delay.c | 17 +- drivers/md/md.c | 3 +- drivers/media/platform/qcom/camss/camss-csid-170.c | 65 +++-- drivers/media/platform/qcom/camss/camss-csid.c | 44 ++- drivers/media/platform/qcom/camss/camss-csid.h | 11 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 14 + drivers/net/ethernet/amd/xgbe/xgbe-ethtool.c | 11 +- drivers/net/ethernet/amd/xgbe/xgbe-mdio.c | 14 +- .../ethernet/marvell/octeontx2/nic/otx2_flows.c | 20 +- .../net/ethernet/marvell/octeontx2/nic/otx2_pf.c | 2 + drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 2 +- drivers/net/hyperv/netvsc_drv.c | 41 ++- drivers/net/usb/ax88179_178a.c | 4 +- drivers/net/wireguard/device.c | 4 +- drivers/net/wireguard/receive.c | 12 +- drivers/net/wireguard/send.c | 3 +- drivers/nvme/target/fabrics-cmd.c | 4 + drivers/s390/block/dasd.c | 24 +- drivers/usb/cdns3/cdnsp-ring.c | 3 + drivers/usb/dwc2/hcd_intr.c | 15 +- drivers/usb/dwc3/core.c | 2 + drivers/usb/dwc3/drd.c | 2 +- drivers/usb/dwc3/dwc3-qcom.c | 65 +++-- drivers/usb/serial/option.c | 11 +- drivers/usb/typec/tcpm/tcpm.c | 9 + drivers/xen/swiotlb-xen.c | 1 + fs/afs/dynroot.c | 4 +- fs/afs/internal.h | 1 + fs/afs/server_list.c | 2 +- fs/afs/super.c | 2 + fs/afs/vl_rotate.c | 10 + fs/ext4/extents_status.c | 306 +++++++++++++++------ fs/proc/proc_sysctl.c | 7 + include/linux/hid.h | 5 + include/linux/sysctl.h | 6 + init/main.c | 4 + io_uring/io_uring.c | 4 +- kernel/locking/lockdep.c | 3 +- kernel/trace/trace_kprobe.c | 74 +++++ kernel/trace/trace_probe.h | 1 + net/ipv4/route.c | 2 +- net/smc/af_smc.c | 8 +- 55 files changed, 704 insertions(+), 239 deletions(-)
Quoted 70 lines · Daniel Díaz
Hello!
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-lkftconfig arm64 * clang-lkftconfig arm * clang-lkftconfig i386 * clang-lkftconfig x86_64 * gcc-12-lkftconfig arm64 * gcc-12-lkftconfig arm * gcc-12-lkftconfig i386 * gcc-12-lkftconfig x86_64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-armv8_features arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm * gcc-12-lkftconfig-debug i386 * gcc-12-lkftconfig-debug x86_64 * gcc-12-lkftconfig-debug-kmemleak arm64 * gcc-12-lkftconfig-debug-kmemleak arm * gcc-12-lkftconfig-debug-kmemleak i386 * gcc-12-lkftconfig-debug-kmemleak x86_64 * gcc-12-lkftconfig-devicetree arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan x86_64 * gcc-12-lkftconfig-kselftest arm64 * gcc-12-lkftconfig-kselftest-kernel arm64 * gcc-12-lkftconfig-kselftest-kernel arm * gcc-12-lkftconfig-kselftest-kernel i386 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm * gcc-12-lkftconfig-kunit i386 * gcc-12-lkftconfig-kunit x86_64 * gcc-12-lkftconfig-libgpiod arm64 * gcc-12-lkftconfig-libgpiod arm * gcc-12-lkftconfig-libgpiod i386 * gcc-12-lkftconfig-libgpiod x86_64 * gcc-12-lkftconfig-perf arm64 * gcc-12-lkftconfig-perf-kernel arm64 * gcc-12-lkftconfig-perf-kernel arm * gcc-12-lkftconfig-perf-kernel i386 * gcc-12-lkftconfig-perf-kernel x86_64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm * gcc-12-lkftconfig-rcutorture i386 * gcc-12-lkftconfig-rcutorture x86_64It's essentially this:
-----8<-----
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51:
unreachable instruction
x86_64-linux-gnu-ld:kernel/trace/trace_kprobe.o: in function
`__trace_kprobe_create':trace_kprobe.c:(.text+0x2f39): undefined reference to `kallsyms_on_each_symbol' x86_64-linux-gnu-ld: kernel/trace/trace_kprobe.o: in function `create_local_trace_kprobe': trace_kprobe.c:(.text+0x384b): undefined reference to
Quoted 9 lines
`kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.
----->8-----It only affects 5.15. Bisection in progress.
I guess it will point to
Quoted 3 lines
Quoted 3 lines
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
Guenter
Hello!
Quoted 78 lines · Guenter Roeck
Quoted 77 lines · Daniel Díaz
Hello!
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-lkftconfig arm64 * clang-lkftconfig arm * clang-lkftconfig i386 * clang-lkftconfig x86_64 * gcc-12-lkftconfig arm64 * gcc-12-lkftconfig arm * gcc-12-lkftconfig i386 * gcc-12-lkftconfig x86_64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-armv8_features arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm * gcc-12-lkftconfig-debug i386 * gcc-12-lkftconfig-debug x86_64 * gcc-12-lkftconfig-debug-kmemleak arm64 * gcc-12-lkftconfig-debug-kmemleak arm * gcc-12-lkftconfig-debug-kmemleak i386 * gcc-12-lkftconfig-debug-kmemleak x86_64 * gcc-12-lkftconfig-devicetree arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan x86_64 * gcc-12-lkftconfig-kselftest arm64 * gcc-12-lkftconfig-kselftest-kernel arm64 * gcc-12-lkftconfig-kselftest-kernel arm * gcc-12-lkftconfig-kselftest-kernel i386 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm * gcc-12-lkftconfig-kunit i386 * gcc-12-lkftconfig-kunit x86_64 * gcc-12-lkftconfig-libgpiod arm64 * gcc-12-lkftconfig-libgpiod arm * gcc-12-lkftconfig-libgpiod i386 * gcc-12-lkftconfig-libgpiod x86_64 * gcc-12-lkftconfig-perf arm64 * gcc-12-lkftconfig-perf-kernel arm64 * gcc-12-lkftconfig-perf-kernel arm * gcc-12-lkftconfig-perf-kernel i386 * gcc-12-lkftconfig-perf-kernel x86_64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm * gcc-12-lkftconfig-rcutorture i386 * gcc-12-lkftconfig-rcutorture x86_64It's essentially this:
-----8<-----
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51:
unreachable instruction
x86_64-linux-gnu-ld:kernel/trace/trace_kprobe.o: in function
`__trace_kprobe_create':trace_kprobe.c:(.text+0x2f39): undefined reference to `kallsyms_on_each_symbol' x86_64-linux-gnu-ld: kernel/trace/trace_kprobe.o: in function `create_local_trace_kprobe': trace_kprobe.c:(.text+0x384b): undefined reference to`kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.
----->8-----
Quoted 6 lines
Quoted 1 line
It only affects 5.15. Bisection in progress.
I guess it will point to
Quoted 2 lines
Quoted 2 lines
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
It sure did!:
commit 7b4375c36a4c0e1b4b97ccbcdd427db5a460e04f
Author: Francis Laniel <[email protected]>
Date: Fri Oct 20 13:42:49 2023 +0300
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
commit b022f0c7e404887a7c5229788fc99eff9f9a80d5 upstream.
Reverting that commit made the build pass again.
Greetings!
Daniel Díaz
[email protected]
Quoted 98 lines · Daniel Díaz
Hello!
Quoted 78 lines · Guenter Roeck
Quoted 77 lines · Daniel Díaz
Hello!
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-lkftconfig arm64 * clang-lkftconfig arm * clang-lkftconfig i386 * clang-lkftconfig x86_64 * gcc-12-lkftconfig arm64 * gcc-12-lkftconfig arm * gcc-12-lkftconfig i386 * gcc-12-lkftconfig x86_64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-armv8_features arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm * gcc-12-lkftconfig-debug i386 * gcc-12-lkftconfig-debug x86_64 * gcc-12-lkftconfig-debug-kmemleak arm64 * gcc-12-lkftconfig-debug-kmemleak arm * gcc-12-lkftconfig-debug-kmemleak i386 * gcc-12-lkftconfig-debug-kmemleak x86_64 * gcc-12-lkftconfig-devicetree arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan x86_64 * gcc-12-lkftconfig-kselftest arm64 * gcc-12-lkftconfig-kselftest-kernel arm64 * gcc-12-lkftconfig-kselftest-kernel arm * gcc-12-lkftconfig-kselftest-kernel i386 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm * gcc-12-lkftconfig-kunit i386 * gcc-12-lkftconfig-kunit x86_64 * gcc-12-lkftconfig-libgpiod arm64 * gcc-12-lkftconfig-libgpiod arm * gcc-12-lkftconfig-libgpiod i386 * gcc-12-lkftconfig-libgpiod x86_64 * gcc-12-lkftconfig-perf arm64 * gcc-12-lkftconfig-perf-kernel arm64 * gcc-12-lkftconfig-perf-kernel arm * gcc-12-lkftconfig-perf-kernel i386 * gcc-12-lkftconfig-perf-kernel x86_64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm * gcc-12-lkftconfig-rcutorture i386 * gcc-12-lkftconfig-rcutorture x86_64It's essentially this:
-----8<-----
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc' arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51: unreachable instruction x86_64-linux-gnu-ld: kernel/trace/trace_kprobe.o: in function `__trace_kprobe_create': trace_kprobe.c:(.text+0x2f39): undefined reference to `kallsyms_on_each_symbol' x86_64-linux-gnu-ld: kernel/trace/trace_kprobe.o: in function `create_local_trace_kprobe': trace_kprobe.c:(.text+0x384b): undefined reference to`kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.
----->8-----Quoted 6 lines
Quoted 1 line
It only affects 5.15. Bisection in progress.
I guess it will point to
Quoted 2 lines
Quoted 2 lines
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbolsIt sure did!:
commit 7b4375c36a4c0e1b4b97ccbcdd427db5a460e04f Author: Francis Laniel <[email protected]> Date: Fri Oct 20 13:42:49 2023 +0300 tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols commit b022f0c7e404887a7c5229788fc99eff9f9a80d5 upstream.
Quoted 2 lines
Reverting that commit made the build pass again.
It looks like it depends on commit d721def7392a ("kallsyms: Make kallsyms_on_each_symbol generally available"), but that doesn't apply cleanly.
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.141 release. There are 69 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 02 Dec 2023 16:21:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.141-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Hi!
Quoted 4 lines
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64
Yes, we see the same failures:
https://gitlab.com/cip-project/cip-testing/linux-stable-rc-ci/-/pipelines/1091365008
5.10 and 6.1 build ok.
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.15.141 release. There are 69 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 02 Dec 2023 16:21:18 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.15.141-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.15.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Hi Greg,
Some notes below:
Quoted 23 lines · Guenter Roeck
Quoted 22 lines · Daniel Díaz
Hello!
make --silent --keep-going --jobs=8 O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51:
unreachable instruction
x86_64-linux-gnu-ld:kernel/trace/trace_kprobe.o: in function `__trace_kprobe_create':
trace_kprobe.c:(.text+0x2f39): undefined reference to `kallsyms_on_each_symbol'
x86_64-linux-gnu-ld:kernel/trace/trace_kprobe.o: in function `create_local_trace_kprobe':
trace_kprobe.c:(.text+0x384b): undefined reference to `kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors. ----->8-----
Quoted 2 lines
Quoted 2 lines
It only affects 5.15. Bisection in progress.
I have seen this too in our testing.
Quoted 6 lines
I guess it will point to
Quoted 3 lines
Quoted 3 lines
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
Note:
1. This above commit also have a fix upstream,926fe783c8a6 ("tracing/kprobes: Fix symbol counting logic by looking at modules as well")
2. I see the patch causing build failure is also queued in 5.10, 5.4 and 4.19, 4.14 [1]
Thanks,
Harshit
Quoted 4 lines
Guenter
Greg Kroah-Hartman
maintainerQuoted 94 lines · Daniel Díaz
Hello!
Quoted 78 lines · Guenter Roeck
Quoted 77 lines · Daniel Díaz
Hello!
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-lkftconfig arm64 * clang-lkftconfig arm * clang-lkftconfig i386 * clang-lkftconfig x86_64 * gcc-12-lkftconfig arm64 * gcc-12-lkftconfig arm * gcc-12-lkftconfig i386 * gcc-12-lkftconfig x86_64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-armv8_features arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm * gcc-12-lkftconfig-debug i386 * gcc-12-lkftconfig-debug x86_64 * gcc-12-lkftconfig-debug-kmemleak arm64 * gcc-12-lkftconfig-debug-kmemleak arm * gcc-12-lkftconfig-debug-kmemleak i386 * gcc-12-lkftconfig-debug-kmemleak x86_64 * gcc-12-lkftconfig-devicetree arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan x86_64 * gcc-12-lkftconfig-kselftest arm64 * gcc-12-lkftconfig-kselftest-kernel arm64 * gcc-12-lkftconfig-kselftest-kernel arm * gcc-12-lkftconfig-kselftest-kernel i386 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm * gcc-12-lkftconfig-kunit i386 * gcc-12-lkftconfig-kunit x86_64 * gcc-12-lkftconfig-libgpiod arm64 * gcc-12-lkftconfig-libgpiod arm * gcc-12-lkftconfig-libgpiod i386 * gcc-12-lkftconfig-libgpiod x86_64 * gcc-12-lkftconfig-perf arm64 * gcc-12-lkftconfig-perf-kernel arm64 * gcc-12-lkftconfig-perf-kernel arm * gcc-12-lkftconfig-perf-kernel i386 * gcc-12-lkftconfig-perf-kernel x86_64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm * gcc-12-lkftconfig-rcutorture i386 * gcc-12-lkftconfig-rcutorture x86_64It's essentially this:
-----8<-----
make --silent --keep-going --jobs=8
O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51:
unreachable instruction
x86_64-linux-gnu-ld:kernel/trace/trace_kprobe.o: in function
`__trace_kprobe_create':trace_kprobe.c:(.text+0x2f39): undefined reference to `kallsyms_on_each_symbol' x86_64-linux-gnu-ld: kernel/trace/trace_kprobe.o: in function `create_local_trace_kprobe': trace_kprobe.c:(.text+0x384b): undefined reference to`kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.
----->8-----Quoted 6 lines
Quoted 1 line
It only affects 5.15. Bisection in progress.
I guess it will point to
Quoted 2 lines
Quoted 2 lines
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbolsIt sure did!:
commit
7b4375c36a4c0e1b4b97ccbcdd427db5a460e04f
Author: Francis Laniel <[email protected]>
Date: Fri Oct 20 13:42:49 2023 +0300
Quoted 5 lines
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
commit
b022f0c7e404887a7c5229788fc99eff9f9a80d5upstream.Reverting that commit made the build pass again.
{sigh}
Francis, I think this is the second or third time this has happened with the attempt to get this patch merged. I'm going to go drop it from all of the pending stable queues again, and please, if you wish to have it applied in the future, I am going to have to see some proof it was actually tested on the architectures that it keeps breaking.
thanks,
greg k-h
Hi!
Quoted 114 lines · Le vendredi 1 décembre 2023, 09:21:33 CET Greg Kroah-Hartman a écrit :
Quoted 106 lines · Daniel Díaz
Hello!
Quoted 87 lines · Guenter Roeck
Quoted 86 lines · Daniel Díaz
Hello!
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-lkftconfig arm64 * clang-lkftconfig arm * clang-lkftconfig i386 * clang-lkftconfig x86_64 * gcc-12-lkftconfig arm64 * gcc-12-lkftconfig arm * gcc-12-lkftconfig i386 * gcc-12-lkftconfig x86_64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-armv8_features arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm * gcc-12-lkftconfig-debug i386 * gcc-12-lkftconfig-debug x86_64 * gcc-12-lkftconfig-debug-kmemleak arm64 * gcc-12-lkftconfig-debug-kmemleak arm * gcc-12-lkftconfig-debug-kmemleak i386 * gcc-12-lkftconfig-debug-kmemleak x86_64 * gcc-12-lkftconfig-devicetree arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan x86_64 * gcc-12-lkftconfig-kselftest arm64 * gcc-12-lkftconfig-kselftest-kernel arm64 * gcc-12-lkftconfig-kselftest-kernel arm * gcc-12-lkftconfig-kselftest-kernel i386 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm * gcc-12-lkftconfig-kunit i386 * gcc-12-lkftconfig-kunit x86_64 * gcc-12-lkftconfig-libgpiod arm64 * gcc-12-lkftconfig-libgpiod arm * gcc-12-lkftconfig-libgpiod i386 * gcc-12-lkftconfig-libgpiod x86_64 * gcc-12-lkftconfig-perf arm64 * gcc-12-lkftconfig-perf-kernel arm64 * gcc-12-lkftconfig-perf-kernel arm * gcc-12-lkftconfig-perf-kernel i386 * gcc-12-lkftconfig-perf-kernel x86_64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm * gcc-12-lkftconfig-rcutorture i386 * gcc-12-lkftconfig-rcutorture x86_64It's essentially this:
-----8<-----
make --silent --keep-going --jobs=8O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51:unreachable instruction
x86_64-linux-gnu-ld:
kernel/trace/trace_kprobe.o: in function`__trace_kprobe_create':
trace_kprobe.c:(.text+0x2f39): undefined reference to`kallsyms_on_each_symbol'
x86_64-linux-gnu-ld:
kernel/trace/trace_kprobe.o: in function`create_local_trace_kprobe':
trace_kprobe.c:(.text+0x384b): undefined reference to`kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '
__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.Quoted 10 lines
Quoted 3 lines
----->8-----
It only affects 5.15. Bisection in progress.
I guess it will point to
Quoted 4 lines
Quoted 4 lines
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
It sure did!:
commit7b4375c36a4c0e1b4b97ccbcdd427db5a460e04f
Author: Francis Laniel <[email protected]>
Date: Fri Oct 20 13:42:49 2023 +0300Quoted 6 lines
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
commit
b022f0c7e404887a7c5229788fc99eff9f9a80d5upstream.Reverting that commit made the build pass again.
Quoted 7 lines
{sigh}
Francis, I think this is the second or third time this has happened with the attempt to get this patch merged. I'm going to go drop it from all of the pending stable queues again, and please, if you wish to have it applied in the future, I am going to have to see some proof it was actually tested on the architectures that it keeps breaking.
Sorry for the disagreement, for this one, I had to add the CONFIG_LIVEPATCH to then be able to call kallsyms_on_each_symbol(), as on 5.15, this function is within a ifdef guard [1].
I suppose you do not want to add CONFIG_LIVEPATCH to default config, so I will try to find a way for this specific kernel!
Did you get problems only for 5.15 kernel? Or others too?
In the second case, can you please link me the problems and I will polish everything.
Quoted 3 lines
thanks,
greg k-h
Best regards.
---
[1]: https://elixir.bootlin.com/linux/v5.15.140/source/kernel/kallsyms.c#L207
Greg Kroah-Hartman
maintainerQuoted 125 lines · Francis Laniel
Hi!
Quoted 114 lines · Le vendredi 1 décembre 2023, 09:21:33 CET Greg Kroah-Hartman a écrit :
Quoted 106 lines · Daniel Díaz
Hello!
Quoted 87 lines · Guenter Roeck
Quoted 86 lines · Daniel Díaz
Hello!
Lots of failures everywhere:
* clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-17-lkftconfig arm64 * clang-lkftconfig arm64 * clang-lkftconfig arm * clang-lkftconfig i386 * clang-lkftconfig x86_64 * gcc-12-lkftconfig arm64 * gcc-12-lkftconfig arm * gcc-12-lkftconfig i386 * gcc-12-lkftconfig x86_64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-64k_page_size arm64 * gcc-12-lkftconfig-armv8_features arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm64 * gcc-12-lkftconfig-debug arm * gcc-12-lkftconfig-debug i386 * gcc-12-lkftconfig-debug x86_64 * gcc-12-lkftconfig-debug-kmemleak arm64 * gcc-12-lkftconfig-debug-kmemleak arm * gcc-12-lkftconfig-debug-kmemleak i386 * gcc-12-lkftconfig-debug-kmemleak x86_64 * gcc-12-lkftconfig-devicetree arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan arm64 * gcc-12-lkftconfig-kasan x86_64 * gcc-12-lkftconfig-kselftest arm64 * gcc-12-lkftconfig-kselftest-kernel arm64 * gcc-12-lkftconfig-kselftest-kernel arm * gcc-12-lkftconfig-kselftest-kernel i386 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm64 * gcc-12-lkftconfig-kunit arm * gcc-12-lkftconfig-kunit i386 * gcc-12-lkftconfig-kunit x86_64 * gcc-12-lkftconfig-libgpiod arm64 * gcc-12-lkftconfig-libgpiod arm * gcc-12-lkftconfig-libgpiod i386 * gcc-12-lkftconfig-libgpiod x86_64 * gcc-12-lkftconfig-perf arm64 * gcc-12-lkftconfig-perf-kernel arm64 * gcc-12-lkftconfig-perf-kernel arm * gcc-12-lkftconfig-perf-kernel i386 * gcc-12-lkftconfig-perf-kernel x86_64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm64 * gcc-12-lkftconfig-rcutorture arm * gcc-12-lkftconfig-rcutorture i386 * gcc-12-lkftconfig-rcutorture x86_64It's essentially this:
-----8<-----
make --silent --keep-going --jobs=8O=/home/tuxbuild/.cache/tuxmake/builds/1/build ARCH=x86_64 SRCARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- 'CC=sccache x86_64-linux-gnu-gcc' 'HOSTCC=sccache gcc'
arch/x86/kernel/smp.o: warning: objtool: sysvec_reboot()+0x51:unreachable instruction
x86_64-linux-gnu-ld:
kernel/trace/trace_kprobe.o: in function`__trace_kprobe_create':
trace_kprobe.c:(.text+0x2f39): undefined reference to`kallsyms_on_each_symbol'
x86_64-linux-gnu-ld:
kernel/trace/trace_kprobe.o: in function`create_local_trace_kprobe':
trace_kprobe.c:(.text+0x384b): undefined reference to`kallsyms_on_each_symbol'
make[1]: *** [/builds/linux/Makefile:1227: vmlinux] Error 1 make[1]: Target '
__all' not remade because of errors.
make: *** [Makefile:226: __sub-make] Error 2
make: Target '__all' not remade because of errors.Quoted 10 lines
Quoted 3 lines
----->8-----
It only affects 5.15. Bisection in progress.
I guess it will point to
Quoted 4 lines
Quoted 4 lines
Francis Laniel <[email protected]>
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
It sure did!:
commit7b4375c36a4c0e1b4b97ccbcdd427db5a460e04f
Author: Francis Laniel <[email protected]>
Date: Fri Oct 20 13:42:49 2023 +0300Quoted 6 lines
tracing/kprobes: Return EADDRNOTAVAIL when func matches several symbols
commit
b022f0c7e404887a7c5229788fc99eff9f9a80d5upstream.Reverting that commit made the build pass again.
Quoted 7 lines
{sigh}
Francis, I think this is the second or third time this has happened with the attempt to get this patch merged. I'm going to go drop it from all of the pending stable queues again, and please, if you wish to have it applied in the future, I am going to have to see some proof it was actually tested on the architectures that it keeps breaking.
Quoted 6 lines
Sorry for the disagreement, for this one, I had to add the
CONFIG_LIVEPATCHto then be able to callkallsyms_on_each_symbol(), as on 5.15, this function is within a ifdef guard [1].I suppose you do not want to add
CONFIG_LIVEPATCHto default config, so I will try to find a way for this specific kernel!
It doesn't matter about any "default config", you can not break the build of any config.
Quoted 1 line
Did you get problems only for 5.15 kernel? Or others too?
I don't know, but for obvious reasons if it is not working in 5.15.y, we can't take it in older kernels as that would be a regression when people move to a newer one.
Quoted 2 lines
In the second case, can you please link me the problems and I will polish everything.
Please take some time with a cross-compiler on the above listed architectures and configurations to verify your changes do not break anything again.
thanks,
greg k-h
Hello!
Quoted 3 lines · Greg Kroah-Hartman
Please take some time with a cross-compiler on the above listed architectures and configurations to verify your changes do not break anything again.
It failed in more architectures than we initially reported. FWIW, this error can be easily reproduced this way:
tuxmake --runtime podman --target-arch arm --toolchain gcc-8 --kconfig imx_v4_v5_defconfig tuxmake --runtime podman --target-arch arm64 --toolchain gcc-12 --kconfig allmodconfig tuxmake --runtime podman --target-arch i386 --toolchain gcc-12 --kconfig defconfig tuxmake --runtime podman --target-arch x86_64 --toolchain gcc-12 --kconfig defconfig tuxmake --runtime podman --target-arch mips --toolchain gcc-12 --kconfig allmodconfig tuxmake --runtime podman --target-arch parisc --toolchain gcc-11 --kconfig allmodconfig tuxmake --runtime podman --target-arch powerpc --toolchain gcc-12 --kconfig defconfig tuxmake --runtime podman --target-arch riscv --toolchain gcc-12 --kconfig allmodconfig tuxmake --runtime podman --target-arch sh --toolchain gcc-11 --kconfig defconfig tuxmake --runtime podman --target-arch sparc --toolchain gcc-11 --kconfig sparc64_defconfig
Greetings!
Daniel Díaz
[email protected]
Greg Kroah-Hartman
maintainerQuoted 10 lines · Daniel Díaz
Hello!
Quoted 3 lines · Greg Kroah-Hartman
Please take some time with a cross-compiler on the above listed architectures and configurations to verify your changes do not break anything again.
It failed in more architectures than we initially reported. FWIW, this error can be easily reproduced this way:
tuxmake --runtime podman --target-arch arm --toolchain gcc-8 --kconfig imx_v4_v5_defconfig
Fails for me:
$ ~/.local/bin/tuxmake --runtime podman --target-arch arm --toolchain gcc-8 --kconfig imx_v4_v5_defconfig
Traceback (most recent call last):
File "/home/gregkh/.local/bin/tuxmake", line 8, in <module>
sys.exit(main())
^^^^^^
File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/cli.py", line 170, in main
build.run()
File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/build.py", line 652, in run
self.prepare()
File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/build.py", line 318, in prepare
self.runtime.prepare()
File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/runtime.py", line 423, in prepare
self.prepare_image()
File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/runtime.py", line 443, in prepare_image
do_pull()
File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/utils.py", line 36, in retry_wrapper
ret = func(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^
File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/runtime.py", line 441, in do_pull
subprocess.check_call(pull)
File "/usr/lib/python3.11/subprocess.py", line 408, in check_call
retcode = call(*popenargs, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 389, in call
with Popen(*popenargs, **kwargs) as p:
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'podman'Are you sure that's the right command line to use? :)
thanks,
greg k-h
Hello!
Quoted 1 line · Greg Kroah-Hartman
On Fri, Dec 01, 2023 at 08:34:26AM -0600, Daniel Díaz wrote:
[...]
Quoted 38 lines
Quoted 3 lines
It failed in more architectures than we initially reported. FWIW, this error can be easily reproduced this way:
tuxmake --runtime podman --target-arch arm --toolchain gcc-8 --kconfig imx_v4_v5_defconfigFails for me:
$ ~/.local/bin/tuxmake --runtime podman --target-arch arm --toolchain gcc-8 --kconfig imx_v4_v5_defconfig Traceback (most recent call last): File "/home/gregkh/.local/bin/tuxmake", line 8, in <module> sys.exit(main()) ^^^^^^ File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/cli.py", line 170, in main build.run() File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/build.py", line 652, in run self.prepare() File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/build.py", line 318, in prepare self.runtime.prepare() File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/runtime.py", line 423, in prepare self.prepare_image() File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/runtime.py", line 443, in prepare_image do_pull() File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/utils.py", line 36, in retry_wrapper ret = func(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^ File "/home/gregkh/.local/pipx/venvs/tuxmake/lib/python3.11/site-packages/tuxmake/runtime.py", line 441, in do_pull subprocess.check_call(pull) File "/usr/lib/python3.11/subprocess.py", line 408, in check_call retcode = call(*popenargs, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 389, in call with Popen(*popenargs, **kwargs) as p: ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.11/subprocess.py", line 1026, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, File "/usr/lib/python3.11/subprocess.py", line 1950, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) FileNotFoundError: [Errno 2] No such file or directory: 'podman'
Quoted 1 line
Are you sure that's the right command line to use? :)
Yes, it just needs `podman' to be installed. The Tuxmake team will change that cryptic message into something easier to parse.
FWIW, --runtime docker also works (if Docker is installed), and --runtime null simply makes Tuxmake rely on the cross-compilers you have installed.
Greetings!
Daniel Díaz
[email protected]