mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

Kernel

Threads by month
  • ----- 2025 -----
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2021 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2020 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2019 -----
  • December
kernel@openeuler.org

  • 43 participants
  • 18655 discussions
[PATCH] SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
by wguanghao 28 Apr '24

28 Apr '24
From: Chuck Lever <chuck.lever(a)oracle.com> Jan Schunk reports that his small NFS servers suffer from memory exhaustion after just a few days. A bisect shows that commit e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") is the first bad commit. That commit assumed that sock_sendmsg() releases all the pages in the underlying bio_vec array, but the reality is that it doesn't. svc_xprt_release() releases the rqst's response pages, but the record marker page fragment isn't one of those, so it is never released. This is a narrow fix that can be applied to stable kernels. A more extensive fix is in the works. Reported-by: Jan Schunk <scpcom(a)gmx.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671 Fixes: e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") Cc: Alexander Duyck <alexander.duyck(a)gmail.com> Cc: Jakub Kacinski <kuba(a)kernel.org> Cc: David Howells <dhowells(a)redhat.com> Reviewed-by: David Howells <dhowells(a)redhat.com> Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com> --- net/sunrpc/svcsock.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 545017a3daa4..6b3f01beb294 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1206,15 +1206,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) * MSG_SPLICE_PAGES is used exclusively to reduce the number of * copy operations in this path. Therefore the caller must ensure * that the pages backing @xdr are unchanging. - * - * Note that the send is non-blocking. The caller has incremented - * the reference count on each page backing the RPC message, and - * the network layer will "put" these pages when transmission is - * complete. - * - * This is safe for our RPC services because the memory backing - * the head and tail components is never kmalloc'd. These always - * come from pages in the svc_rqst::rq_pages array. */ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, rpc_fraghdr marker, unsigned int *sentp) @@ -1244,6 +1235,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, 1 + count, sizeof(marker) + rqstp->rq_res.len); ret = sock_sendmsg(svsk->sk_sock, &msg); + page_frag_free(buf); if (ret < 0) return ret; *sentp += ret; -- 2.39.2
1 0
0 0
[PATCH OLK-6.6] quota: Fix potential NULL pointer dereference
by Baokun Li 28 Apr '24

28 Apr '24
From: Wang Jianjian <wangjianjian3(a)huawei.com> stable inclusion from stable-v6.6.23 commit 40a673b4b07efd6f74ff3ab60f38b26aa91ee5d5 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9HJX7 CVE: CVE-2024-26878 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit d0aa72604fbd80c8aabb46eda00535ed35570f1f ] Below race may cause NULL pointer dereference P1 P2 dquot_free_inode quota_off drop_dquot_ref remove_dquot_ref dquots = i_dquot(inode) dquots = i_dquot(inode) srcu_read_lock dquots[cnt]) != NULL (1) dquots[type] = NULL (2) spin_lock(&dquots[cnt]->dq_dqb_lock) (3) .... If dquot_free_inode(or other routines) checks inode's quota pointers (1) before quota_off sets it to NULL(2) and use it (3) after that, NULL pointer dereference will be triggered. So let's fix it by using a temporary pointer to avoid this issue. Signed-off-by: Wang Jianjian <wangjianjian3(a)huawei.com> Signed-off-by: Jan Kara <jack(a)suse.cz> Message-Id: <20240202081852.2514092-1-wangjianjian3(a)huawei.com> Stable-dep-of: 179b8c97ebf6 ("quota: Fix rcu annotations of inode dquot pointers") Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baokun Li <libaokun1(a)huawei.com> --- fs/quota/dquot.c | 98 ++++++++++++++++++++++++++++-------------------- 1 file changed, 57 insertions(+), 41 deletions(-) diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c index 023b91b4e1f0..9707aa34f52e 100644 --- a/fs/quota/dquot.c +++ b/fs/quota/dquot.c @@ -399,15 +399,17 @@ int dquot_mark_dquot_dirty(struct dquot *dquot) EXPORT_SYMBOL(dquot_mark_dquot_dirty); /* Dirtify all the dquots - this can block when journalling */ -static inline int mark_all_dquot_dirty(struct dquot * const *dquot) +static inline int mark_all_dquot_dirty(struct dquot * const *dquots) { int ret, err, cnt; + struct dquot *dquot; ret = err = 0; for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (dquot[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (dquot) /* Even in case of error we have to continue */ - ret = mark_dquot_dirty(dquot[cnt]); + ret = mark_dquot_dirty(dquot); if (!err) err = ret; } @@ -1684,6 +1686,7 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags) struct dquot_warn warn[MAXQUOTAS]; int reserve = flags & DQUOT_SPACE_RESERVE; struct dquot **dquots; + struct dquot *dquot; if (!inode_quota_active(inode)) { if (reserve) { @@ -1703,27 +1706,26 @@ int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags) index = srcu_read_lock(&dquot_srcu); spin_lock(&inode->i_lock); for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; if (reserve) { - ret = dquot_add_space(dquots[cnt], 0, number, flags, - &warn[cnt]); + ret = dquot_add_space(dquot, 0, number, flags, &warn[cnt]); } else { - ret = dquot_add_space(dquots[cnt], number, 0, flags, - &warn[cnt]); + ret = dquot_add_space(dquot, number, 0, flags, &warn[cnt]); } if (ret) { /* Back out changes we already did */ for (cnt--; cnt >= 0; cnt--) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - spin_lock(&dquots[cnt]->dq_dqb_lock); + spin_lock(&dquot->dq_dqb_lock); if (reserve) - dquot_free_reserved_space(dquots[cnt], - number); + dquot_free_reserved_space(dquot, number); else - dquot_decr_space(dquots[cnt], number); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + dquot_decr_space(dquot, number); + spin_unlock(&dquot->dq_dqb_lock); } spin_unlock(&inode->i_lock); goto out_flush_warn; @@ -1754,6 +1756,7 @@ int dquot_alloc_inode(struct inode *inode) int cnt, ret = 0, index; struct dquot_warn warn[MAXQUOTAS]; struct dquot * const *dquots; + struct dquot *dquot; if (!inode_quota_active(inode)) return 0; @@ -1764,17 +1767,19 @@ int dquot_alloc_inode(struct inode *inode) index = srcu_read_lock(&dquot_srcu); spin_lock(&inode->i_lock); for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - ret = dquot_add_inodes(dquots[cnt], 1, &warn[cnt]); + ret = dquot_add_inodes(dquot, 1, &warn[cnt]); if (ret) { for (cnt--; cnt >= 0; cnt--) { - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; /* Back out changes we already did */ - spin_lock(&dquots[cnt]->dq_dqb_lock); - dquot_decr_inodes(dquots[cnt], 1); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + spin_lock(&dquot->dq_dqb_lock); + dquot_decr_inodes(dquot, 1); + spin_unlock(&dquot->dq_dqb_lock); } goto warn_put_all; } @@ -1796,6 +1801,7 @@ EXPORT_SYMBOL(dquot_alloc_inode); int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) { struct dquot **dquots; + struct dquot *dquot; int cnt, index; if (!inode_quota_active(inode)) { @@ -1811,9 +1817,8 @@ int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) spin_lock(&inode->i_lock); /* Claim reserved quotas to allocated quotas */ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (dquots[cnt]) { - struct dquot *dquot = dquots[cnt]; - + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (dquot) { spin_lock(&dquot->dq_dqb_lock); if (WARN_ON_ONCE(dquot->dq_dqb.dqb_rsvspace < number)) number = dquot->dq_dqb.dqb_rsvspace; @@ -1838,6 +1843,7 @@ EXPORT_SYMBOL(dquot_claim_space_nodirty); void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number) { struct dquot **dquots; + struct dquot *dquot; int cnt, index; if (!inode_quota_active(inode)) { @@ -1853,9 +1859,8 @@ void dquot_reclaim_space_nodirty(struct inode *inode, qsize_t number) spin_lock(&inode->i_lock); /* Claim reserved quotas to allocated quotas */ for (cnt = 0; cnt < MAXQUOTAS; cnt++) { - if (dquots[cnt]) { - struct dquot *dquot = dquots[cnt]; - + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (dquot) { spin_lock(&dquot->dq_dqb_lock); if (WARN_ON_ONCE(dquot->dq_dqb.dqb_curspace < number)) number = dquot->dq_dqb.dqb_curspace; @@ -1882,6 +1887,7 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags) unsigned int cnt; struct dquot_warn warn[MAXQUOTAS]; struct dquot **dquots; + struct dquot *dquot; int reserve = flags & DQUOT_SPACE_RESERVE, index; if (!inode_quota_active(inode)) { @@ -1902,17 +1908,18 @@ void __dquot_free_space(struct inode *inode, qsize_t number, int flags) int wtype; warn[cnt].w_type = QUOTA_NL_NOWARN; - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - spin_lock(&dquots[cnt]->dq_dqb_lock); - wtype = info_bdq_free(dquots[cnt], number); + spin_lock(&dquot->dq_dqb_lock); + wtype = info_bdq_free(dquot, number); if (wtype != QUOTA_NL_NOWARN) - prepare_warning(&warn[cnt], dquots[cnt], wtype); + prepare_warning(&warn[cnt], dquot, wtype); if (reserve) - dquot_free_reserved_space(dquots[cnt], number); + dquot_free_reserved_space(dquot, number); else - dquot_decr_space(dquots[cnt], number); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + dquot_decr_space(dquot, number); + spin_unlock(&dquot->dq_dqb_lock); } if (reserve) *inode_reserved_space(inode) -= number; @@ -1937,6 +1944,7 @@ void dquot_free_inode(struct inode *inode) unsigned int cnt; struct dquot_warn warn[MAXQUOTAS]; struct dquot * const *dquots; + struct dquot *dquot; int index; if (!inode_quota_active(inode)) @@ -1947,16 +1955,16 @@ void dquot_free_inode(struct inode *inode) spin_lock(&inode->i_lock); for (cnt = 0; cnt < MAXQUOTAS; cnt++) { int wtype; - warn[cnt].w_type = QUOTA_NL_NOWARN; - if (!dquots[cnt]) + dquot = srcu_dereference(dquots[cnt], &dquot_srcu); + if (!dquot) continue; - spin_lock(&dquots[cnt]->dq_dqb_lock); - wtype = info_idq_free(dquots[cnt], 1); + spin_lock(&dquot->dq_dqb_lock); + wtype = info_idq_free(dquot, 1); if (wtype != QUOTA_NL_NOWARN) - prepare_warning(&warn[cnt], dquots[cnt], wtype); - dquot_decr_inodes(dquots[cnt], 1); - spin_unlock(&dquots[cnt]->dq_dqb_lock); + prepare_warning(&warn[cnt], dquot, wtype); + dquot_decr_inodes(dquot, 1); + spin_unlock(&dquot->dq_dqb_lock); } spin_unlock(&inode->i_lock); mark_all_dquot_dirty(dquots); @@ -1983,7 +1991,7 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) qsize_t rsv_space = 0; qsize_t inode_usage = 1; struct dquot *transfer_from[MAXQUOTAS] = {}; - int cnt, ret = 0; + int cnt, index, ret = 0; char is_valid[MAXQUOTAS] = {}; struct dquot_warn warn_to[MAXQUOTAS]; struct dquot_warn warn_from_inodes[MAXQUOTAS]; @@ -2072,8 +2080,16 @@ int __dquot_transfer(struct inode *inode, struct dquot **transfer_to) spin_unlock(&inode->i_lock); spin_unlock(&dq_data_lock); + /* + * These arrays are local and we hold dquot references so we don't need + * the srcu protection but still take dquot_srcu to avoid warning in + * mark_all_dquot_dirty(). + */ + index = srcu_read_lock(&dquot_srcu); mark_all_dquot_dirty(transfer_from); mark_all_dquot_dirty(transfer_to); + srcu_read_unlock(&dquot_srcu, index); + flush_warnings(warn_to); flush_warnings(warn_from_inodes); flush_warnings(warn_from_space); -- 2.31.1
2 1
0 0
[PATCH OLK-5.10] PCI/IOV: Improve performance of creating VFs concurrently
by Jialin Zhang 28 Apr '24

28 Apr '24
hulk inclusion category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J08D -------------------------------- Previous commit 083577ae9d72 ("PCI/IOV: Add pci_sriov_numvfs_lock to support enable pci sriov concurrently") reduce performance of creating VFs belongs to different PFs. Fix it by checking whether a new bus will be created. Fixes: 083577ae9d72 ("PCI/IOV: Add pci_sriov_numvfs_lock to support enable pci sriov concurrently") Signed-off-by: Jialin Zhang <zhangjialin11(a)huawei.com> --- drivers/pci/iov.c | 40 +++++++++++++++++++++++++++++++++------- include/linux/pci.h | 8 ++++++++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c index 7006413aa0a3..2190a6977c4e 100644 --- a/drivers/pci/iov.c +++ b/drivers/pci/iov.c @@ -240,6 +240,16 @@ int pci_iov_add_virtfn(struct pci_dev *dev, int id) return rc; } +int pci_iov_add_virtfn_locked(struct pci_dev *dev, int id) +{ + int rc; + + mutex_lock(&pci_sriov_numvfs_lock); + rc = pci_iov_add_virtfn(dev, id); + mutex_unlock(&pci_sriov_numvfs_lock); + return rc; +} + void pci_iov_remove_virtfn(struct pci_dev *dev, int id) { char buf[VIRTFN_ID_LEN]; @@ -269,6 +279,13 @@ void pci_iov_remove_virtfn(struct pci_dev *dev, int id) pci_dev_put(dev); } +void pci_iov_remove_virtfn_locked(struct pci_dev *dev, int id) +{ + mutex_lock(&pci_sriov_numvfs_lock); + pci_iov_remove_virtfn(dev, id); + mutex_unlock(&pci_sriov_numvfs_lock); +} + static ssize_t sriov_totalvfs_show(struct device *dev, struct device_attribute *attr, char *buf) @@ -315,7 +332,6 @@ static ssize_t sriov_numvfs_store(struct device *dev, if (num_vfs > pci_sriov_get_totalvfs(pdev)) return -ERANGE; - mutex_lock(&pci_sriov_numvfs_lock); device_lock(&pdev->dev); if (num_vfs == pdev->sriov->num_VFs) @@ -352,7 +368,6 @@ static ssize_t sriov_numvfs_store(struct device *dev, exit: device_unlock(&pdev->dev); - mutex_unlock(&pci_sriov_numvfs_lock); if (ret < 0) return ret; @@ -463,14 +478,21 @@ static int sriov_add_vfs(struct pci_dev *dev, u16 num_vfs) return 0; for (i = 0; i < num_vfs; i++) { - rc = pci_iov_add_virtfn(dev, i); + if (dev->bus->number != pci_iov_virtfn_bus(dev, i)) + rc = pci_iov_add_virtfn_locked(dev, i); + else + rc = pci_iov_add_virtfn(dev, i); if (rc) goto failed; } return 0; failed: - while (i--) - pci_iov_remove_virtfn(dev, i); + while (i--) { + if (dev->bus->number != pci_iov_virtfn_bus(dev, i)) + pci_iov_remove_virtfn_locked(dev, i); + else + pci_iov_remove_virtfn(dev, i); + } return rc; } @@ -590,8 +612,12 @@ static void sriov_del_vfs(struct pci_dev *dev) struct pci_sriov *iov = dev->sriov; int i; - for (i = 0; i < iov->num_VFs; i++) - pci_iov_remove_virtfn(dev, i); + for (i = 0; i < iov->num_VFs; i++) { + if (dev->bus->number != pci_iov_virtfn_bus(dev, i)) + pci_iov_remove_virtfn_locked(dev, i); + else + pci_iov_remove_virtfn(dev, i); + } } static void sriov_disable(struct pci_dev *dev) diff --git a/include/linux/pci.h b/include/linux/pci.h index 0c116b6383ef..1638ac9a557c 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h @@ -2125,7 +2125,9 @@ void pci_disable_sriov(struct pci_dev *dev); int pci_iov_sysfs_link(struct pci_dev *dev, struct pci_dev *virtfn, int id); int pci_iov_add_virtfn(struct pci_dev *dev, int id); +int pci_iov_add_virtfn_locked(struct pci_dev *dev, int id); void pci_iov_remove_virtfn(struct pci_dev *dev, int id); +void pci_iov_remove_virtfn_locked(struct pci_dev *dev, int id); int pci_num_vf(struct pci_dev *dev); int pci_vfs_assigned(struct pci_dev *dev); int pci_sriov_set_totalvfs(struct pci_dev *dev, u16 numvfs); @@ -2165,8 +2167,14 @@ static inline int pci_iov_add_virtfn(struct pci_dev *dev, int id) { return -ENOSYS; } +static inline int pci_iov_add_virtfn_locked(struct pci_dev *dev, int id) +{ + return -ENOSYS; +} static inline void pci_iov_remove_virtfn(struct pci_dev *dev, int id) { } +static inline void pci_iov_remove_virtfn_locked(struct pci_dev *dev, + int id) { } static inline void pci_disable_sriov(struct pci_dev *dev) { } static inline int pci_num_vf(struct pci_dev *dev) { return 0; } static inline int pci_vfs_assigned(struct pci_dev *dev) -- 2.25.1
2 1
0 0
[PATCH] SUNRPC: Fix a slow server-side memory leak with RPC-over-TCP
by wguanghao 28 Apr '24

28 Apr '24
From: Chuck Lever <chuck.lever(a)oracle.com> Jan Schunk reports that his small NFS servers suffer from memory exhaustion after just a few days. A bisect shows that commit e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") is the first bad commit. That commit assumed that sock_sendmsg() releases all the pages in the underlying bio_vec array, but the reality is that it doesn't. svc_xprt_release() releases the rqst's response pages, but the record marker page fragment isn't one of those, so it is never released. This is a narrow fix that can be applied to stable kernels. A more extensive fix is in the works. Reported-by: Jan Schunk <scpcom(a)gmx.de> Closes: https://bugzilla.kernel.org/show_bug.cgi?id=218671 Fixes: e18e157bb5c8 ("SUNRPC: Send RPC message on TCP with a single sock_sendmsg() call") Cc: Alexander Duyck <alexander.duyck(a)gmail.com> Cc: Jakub Kacinski <kuba(a)kernel.org> Cc: David Howells <dhowells(a)redhat.com> Reviewed-by: David Howells <dhowells(a)redhat.com> Signed-off-by: Chuck Lever <chuck.lever(a)oracle.com> --- net/sunrpc/svcsock.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 545017a3daa4..6b3f01beb294 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c @@ -1206,15 +1206,6 @@ static int svc_tcp_recvfrom(struct svc_rqst *rqstp) * MSG_SPLICE_PAGES is used exclusively to reduce the number of * copy operations in this path. Therefore the caller must ensure * that the pages backing @xdr are unchanging. - * - * Note that the send is non-blocking. The caller has incremented - * the reference count on each page backing the RPC message, and - * the network layer will "put" these pages when transmission is - * complete. - * - * This is safe for our RPC services because the memory backing - * the head and tail components is never kmalloc'd. These always - * come from pages in the svc_rqst::rq_pages array. */ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, rpc_fraghdr marker, unsigned int *sentp) @@ -1244,6 +1235,7 @@ static int svc_tcp_sendmsg(struct svc_sock *svsk, struct svc_rqst *rqstp, iov_iter_bvec(&msg.msg_iter, ITER_SOURCE, rqstp->rq_bvec, 1 + count, sizeof(marker) + rqstp->rq_res.len); ret = sock_sendmsg(svsk->sk_sock, &msg); + page_frag_free(buf); if (ret < 0) return ret; *sentp += ret; -- 2.39.2
1 0
0 0
[openeuler:OLK-6.6 7547/7556] drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:860: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
by kernel test robot 28 Apr '24

28 Apr '24
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 6773f12aed5e797a2c93fd0f7632568554503971 commit: 4213ff7957de370c1cfe528c2bad1eb2e499038a [7547/7556] net/ethernet/huawei/hinic3: Add the CQM on which the RDMA depends config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20240428/202404281612.QppNPnCk-lkp@…) compiler: clang version 18.1.4 (https://github.com/llvm/llvm-project e6c3289804a67ea0bb6a86fadbe454dd93b8d855) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240428/202404281612.QppNPnCk-lkp@…) If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags | Reported-by: kernel test robot <lkp(a)intel.com> | Closes: https://lore.kernel.org/oe-kbuild-all/202404281612.QppNPnCk-lkp@intel.com/ All warnings (new ones prefixed by >>): >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hw_cfg.c:1097: warning: expecting prototype for hinic_set_vf_dev_cap(). Prototype was for hinic3_init_vf_dev_cap() instead -- >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:863:5: warning: no previous prototype for function 'hinic3_global_func_id_hw' [-Wmissing-prototypes] 863 | u16 hinic3_global_func_id_hw(void *hwdev) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:863:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 863 | u16 hinic3_global_func_id_hw(void *hwdev) | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:880:5: warning: no previous prototype for function 'hinic3_global_func_id_get' [-Wmissing-prototypes] 880 | int hinic3_global_func_id_get(void *hwdev, u16 *func_id) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:880:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 880 | int hinic3_global_func_id_get(void *hwdev, u16 *func_id) | ^ | static 2 warnings generated. -- drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:312: warning: Function parameter or member 'attr6' not described in 'set_hwif_attr' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'hwdev' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'cfg_reg_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'intr_reg_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'mgmt_regs_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'db_base_phy' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'db_base' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Function parameter or member 'db_dwqe_len' not described in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Excess function parameter 'hwif' description in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:773: warning: Excess function parameter 'pdev' description in 'hinic3_init_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:839: warning: Function parameter or member 'hwdev' not described in 'hinic3_free_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:839: warning: Excess function parameter 'hwif' description in 'hinic3_free_hwif' drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:839: warning: Excess function parameter 'pdev' description in 'hinic3_free_hwif' >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:860: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * get function id from register,used by sriov hot migration process drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c:876: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst * get function id, used by sriov hot migratition process. -- >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:46:6: warning: no previous prototype for function 'hinic3_get_master_host_mbox_enable' [-Wmissing-prototypes] 46 | bool hinic3_get_master_host_mbox_enable(void *hwdev) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:46:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 46 | bool hinic3_get_master_host_mbox_enable(void *hwdev) | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:148:5: warning: no previous prototype for function '__mbox_to_host' [-Wmissing-prototypes] 148 | int __mbox_to_host(struct hinic3_hwdev *hwdev, enum hinic3_mod_type mod, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:148:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 148 | int __mbox_to_host(struct hinic3_hwdev *hwdev, enum hinic3_mod_type mod, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:547:5: warning: no previous prototype for function 'sw_func_ppf_mbox_handler' [-Wmissing-prototypes] 547 | int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:547:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 547 | int sw_func_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:570:5: warning: no previous prototype for function '__ppf_process_mbox_msg' [-Wmissing-prototypes] 570 | int __ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:570:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 570 | int __ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:599:5: warning: no previous prototype for function 'hinic3_ppf_process_mbox_msg' [-Wmissing-prototypes] 599 | int hinic3_ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:599:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 599 | int hinic3_ppf_process_mbox_msg(struct hinic3_hwdev *hwdev, u16 pf_idx, u16 vf_id, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:643:5: warning: no previous prototype for function 'comm_ppf_mbox_handler' [-Wmissing-prototypes] 643 | int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:643:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 643 | int comm_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:652:5: warning: no previous prototype for function 'hilink_ppf_mbox_handler' [-Wmissing-prototypes] 652 | int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:652:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 652 | int hilink_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:661:5: warning: no previous prototype for function 'hinic3_nic_ppf_mbox_handler' [-Wmissing-prototypes] 661 | int hinic3_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:661:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 661 | int hinic3_nic_ppf_mbox_handler(void *handle, u16 pf_idx, u16 vf_id, u16 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:670:5: warning: no previous prototype for function 'hinic3_register_slave_ppf' [-Wmissing-prototypes] 670 | int hinic3_register_slave_ppf(struct hinic3_hwdev *hwdev, bool registered) | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:670:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 670 | int hinic3_register_slave_ppf(struct hinic3_hwdev *hwdev, bool registered) | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:743:5: warning: no previous prototype for function 'set_slave_func_nic_state' [-Wmissing-prototypes] 743 | int set_slave_func_nic_state(struct hinic3_hwdev *hwdev, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:743:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 743 | int set_slave_func_nic_state(struct hinic3_hwdev *hwdev, | ^ | static >> drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:776:5: warning: no previous prototype for function 'get_slave_func_netdev_state' [-Wmissing-prototypes] 776 | int get_slave_func_netdev_state(struct hinic3_hwdev *hwdev, u16 func_idx, | ^ drivers/net/ethernet/huawei/hinic3/hw/hinic3_multi_host_mgmt.c:776:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 776 | int get_slave_func_netdev_state(struct hinic3_hwdev *hwdev, u16 func_idx, | ^ | static 11 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:30:25: warning: no previous prototype for function 'cqm3_cmd_alloc' [-Wmissing-prototypes] 30 | struct tag_cqm_cmd_buf *cqm_cmd_alloc(void *ex_handle) | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:13:44: note: expanded from macro 'cqm_cmd_alloc' 13 | #define cqm_cmd_alloc cqm3_cmd_alloc | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:30:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 30 | struct tag_cqm_cmd_buf *cqm_cmd_alloc(void *ex_handle) | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:55:6: warning: no previous prototype for function 'cqm3_cmd_free' [-Wmissing-prototypes] 55 | void cqm_cmd_free(void *ex_handle, struct tag_cqm_cmd_buf *cmd_buf) | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:15:44: note: expanded from macro 'cqm_cmd_free' 15 | #define cqm_cmd_free cqm3_cmd_free | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:55:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 55 | void cqm_cmd_free(void *ex_handle, struct tag_cqm_cmd_buf *cmd_buf) | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:95:5: warning: no previous prototype for function 'cqm3_send_cmd_box' [-Wmissing-prototypes] 95 | s32 cqm_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:16:44: note: expanded from macro 'cqm_send_cmd_box' 16 | #define cqm_send_cmd_box cqm3_send_cmd_box | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:95:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 95 | s32 cqm_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:141:5: warning: no previous prototype for function 'cqm3_lb_send_cmd_box' [-Wmissing-prototypes] 141 | s32 cqm_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:17:44: note: expanded from macro 'cqm_lb_send_cmd_box' 17 | #define cqm_lb_send_cmd_box cqm3_lb_send_cmd_box | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:141:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 141 | s32 cqm_lb_send_cmd_box(void *ex_handle, u8 mod, u8 cmd, u8 cos_id, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:184:5: warning: no previous prototype for function 'cqm3_lb_send_cmd_box_async' [-Wmissing-prototypes] 184 | s32 cqm_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:18:44: note: expanded from macro 'cqm_lb_send_cmd_box_async' 18 | #define cqm_lb_send_cmd_box_async cqm3_lb_send_cmd_box_async | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:184:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 184 | s32 cqm_lb_send_cmd_box_async(void *ex_handle, u8 mod, u8 cmd, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:226:5: warning: no previous prototype for function 'cqm3_send_cmd_imm' [-Wmissing-prototypes] 226 | s32 cqm_send_cmd_imm(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:19:44: note: expanded from macro 'cqm_send_cmd_imm' 19 | #define cqm_send_cmd_imm cqm3_send_cmd_imm | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:226:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 226 | s32 cqm_send_cmd_imm(void *ex_handle, u8 mod, u8 cmd, struct tag_cqm_cmd_buf *buf_in, | ^ | static 6 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:75:6: warning: no previous prototype for function 'cqm3_db_addr_free' [-Wmissing-prototypes] 75 | void cqm_db_addr_free(void *ex_handle, const void __iomem *db_addr, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:21:44: note: expanded from macro 'cqm_db_addr_free' 21 | #define cqm_db_addr_free cqm3_db_addr_free | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:75:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 75 | void cqm_db_addr_free(void *ex_handle, const void __iomem *db_addr, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:233:5: warning: no previous prototype for function 'cqm3_get_hardware_db_addr' [-Wmissing-prototypes] 233 | s32 cqm_get_hardware_db_addr(void *ex_handle, u64 *addr, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:14:44: note: expanded from macro 'cqm_get_hardware_db_addr' 14 | #define cqm_get_hardware_db_addr cqm3_get_hardware_db_addr | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_db.c:233:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 233 | s32 cqm_get_hardware_db_addr(void *ex_handle, u64 *addr, | ^ | static 2 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1604:5: warning: no previous prototype for function 'cqm3_dtoe_share_recv_queue_create' [-Wmissing-prototypes] 1604 | s32 cqm_dtoe_share_recv_queue_create(void *ex_handle, u32 contex_size, | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:47:44: note: expanded from macro 'cqm_dtoe_share_recv_queue_create' 47 | #define cqm_dtoe_share_recv_queue_create cqm3_dtoe_share_recv_queue_create | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1604:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1604 | s32 cqm_dtoe_share_recv_queue_create(void *ex_handle, u32 contex_size, | ^ | static >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1649:6: warning: no previous prototype for function 'cqm3_dtoe_free_srq_bitmap_index' [-Wmissing-prototypes] 1649 | void cqm_dtoe_free_srq_bitmap_index(void *ex_handle, u32 index_count, u32 index) | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_define.h:46:44: note: expanded from macro 'cqm_dtoe_free_srq_bitmap_index' 46 | #define cqm_dtoe_free_srq_bitmap_index cqm3_dtoe_free_srq_bitmap_index | ^ drivers/net/ethernet/huawei/hinic3/cqm/cqm_object.c:1649:1: note: declare 'static' if the function is not intended to be used outside of this translation unit 1649 | void cqm_dtoe_free_srq_bitmap_index(void *ex_handle, u32 index_count, u32 index) | ^ | static 2 warnings generated. -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:35: warning: Function parameter or member 'cqm_handle' not described in 'bloomfilter_init_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:35: warning: expecting prototype for Prototype(). Prototype was for bloomfilter_init_cmd() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:207: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_init' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:207: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_init() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:242: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_uninit' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:242: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_uninit() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'func_id' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'op' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'k_flag' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: Function parameter or member 'id' not described in 'cqm_bloomfilter_cmd' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:265: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_cmd() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_inc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: Function parameter or member 'func_id' not described in 'cqm_bloomfilter_inc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: Function parameter or member 'id' not described in 'cqm_bloomfilter_inc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:363: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_inc() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: Function parameter or member 'ex_handle' not described in 'cqm_bloomfilter_dec' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: Function parameter or member 'func_id' not described in 'cqm_bloomfilter_dec' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: Function parameter or member 'id' not described in 'cqm_bloomfilter_dec' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_bloomfilter.c:460: warning: expecting prototype for Prototype(). Prototype was for cqm_bloomfilter_dec() instead -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:31: warning: Function parameter or member 'ex_handle' not described in 'cqm_cmd_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:31: warning: expecting prototype for Prototype(). Prototype was for cqm_cmd_alloc() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:56: warning: Function parameter or member 'ex_handle' not described in 'cqm_cmd_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:56: warning: Function parameter or member 'cmd_buf' not described in 'cqm_cmd_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:56: warning: expecting prototype for Prototype(). Prototype was for cqm_cmd_free() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'ex_handle' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'mod' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'cmd' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'buf_in' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'buf_out' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'out_param' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'timeout' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: Function parameter or member 'channel' not described in 'cqm_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:98: warning: expecting prototype for Prototype(). Prototype was for cqm_send_cmd_box() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'ex_handle' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'mod' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'cmd' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'cos_id' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'buf_in' not described in 'cqm_lb_send_cmd_box' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'buf_out' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'out_param' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'timeout' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: Function parameter or member 'channel' not described in 'cqm_lb_send_cmd_box' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:144: warning: expecting prototype for Prototype(). Prototype was for cqm_lb_send_cmd_box() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'ex_handle' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'mod' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'cmd' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'cos_id' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'buf_in' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: Function parameter or member 'channel' not described in 'cqm_lb_send_cmd_box_async' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:187: warning: expecting prototype for Prototype(). Prototype was for cqm_lb_send_cmd_box_async() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'ex_handle' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'mod' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'cmd' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'buf_in' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'out_param' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'timeout' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: Function parameter or member 'channel' not described in 'cqm_send_cmd_imm' drivers/net/ethernet/huawei/hinic3/cqm/cqm_cmd.c:228: warning: expecting prototype for Prototype(). Prototype was for cqm_send_cmd_imm() instead -- >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: Function parameter or member 'srq_head_container' not described in 'cqm_container_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: Function parameter or member 'srq_tail_container' not described in 'cqm_container_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: Function parameter or member 'common' not described in 'cqm_container_free' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:44: warning: expecting prototype for Prototype(). Prototype was for cqm_container_free() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: Function parameter or member 'object' not described in 'cqm_container_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: Function parameter or member 'container_addr' not described in 'cqm_container_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: Function parameter or member 'link' not described in 'cqm_container_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:126: warning: expecting prototype for Prototype(). Prototype was for cqm_container_create() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:228: warning: Function parameter or member 'object' not described in 'cqm_srq_container_init' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:228: warning: expecting prototype for Prototype(). Prototype was for cqm_srq_container_init() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:280: warning: Function parameter or member 'object' not described in 'cqm_share_recv_queue_create' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:280: warning: expecting prototype for Prototype(). Prototype was for cqm_share_recv_queue_create() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:348: warning: Function parameter or member 'object' not described in 'cqm_srq_used_rq_delete' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:348: warning: expecting prototype for Prototype(). Prototype was for cqm_srq_used_rq_delete() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:408: warning: Function parameter or member 'object' not described in 'cqm_share_recv_queue_delete' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:408: warning: expecting prototype for Prototype(). Prototype was for cqm_share_recv_queue_delete() instead >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: Function parameter or member 'object' not described in 'cqm_qpc_mpt_bitmap_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: Function parameter or member 'cla_table' not described in 'cqm_qpc_mpt_bitmap_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: Function parameter or member 'low2bit_align_en' not described in 'cqm_qpc_mpt_bitmap_alloc' >> drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:458: warning: expecting prototype for Prototype(). Prototype was for cqm_qpc_mpt_bitmap_alloc() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:523: warning: Function parameter or member 'object' not described in 'cqm_qpc_mpt_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:523: warning: Function parameter or member 'low2bit_align_en' not described in 'cqm_qpc_mpt_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:523: warning: expecting prototype for Prototype(). Prototype was for cqm_qpc_mpt_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:622: warning: Function parameter or member 'object' not described in 'cqm_qpc_mpt_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:622: warning: expecting prototype for Prototype(). Prototype was for cqm_qpc_mpt_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'buf' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'wqe_per_buf' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'wqe_size' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'wqe_number' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'tail' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: Function parameter or member 'link_mode' not described in 'cqm_linkwqe_fill' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:704: warning: expecting prototype for Prototype(). Prototype was for cqm_linkwqe_fill() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:889: warning: Function parameter or member 'object' not described in 'cqm_nonrdma_queue_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:889: warning: expecting prototype for Prototype(). Prototype was for cqm_nonrdma_queue_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:996: warning: Function parameter or member 'object' not described in 'cqm_nonrdma_queue_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:996: warning: expecting prototype for Prototype(). Prototype was for cqm_nonrdma_queue_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1174: warning: Function parameter or member 'object' not described in 'cqm_rdma_queue_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1174: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_queue_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1258: warning: Function parameter or member 'object' not described in 'cqm_rdma_queue_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1258: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_queue_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1342: warning: Function parameter or member 'object' not described in 'cqm_rdma_table_create' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1342: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_table_create() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1391: warning: Function parameter or member 'object' not described in 'cqm_rdma_table_delete' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1391: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_table_delete() instead drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: Function parameter or member 'object' not described in 'cqm_rdma_table_offset_addr' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: Function parameter or member 'offset' not described in 'cqm_rdma_table_offset_addr' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: Function parameter or member 'paddr' not described in 'cqm_rdma_table_offset_addr' drivers/net/ethernet/huawei/hinic3/cqm/cqm_object_intern.c:1426: warning: expecting prototype for Prototype(). Prototype was for cqm_rdma_table_offset_addr() instead .. vim +860 drivers/net/ethernet/huawei/hinic3/hw/hinic3_hwif.c 763 764 /** 765 * hinic3_init_hwif - initialize the hw interface 766 * @hwif: the hardware interface of a pci function device 767 * @pdev: the pci device that will be part of the hwif struct 768 * Return: 0 - success, negative - failure 769 **/ 770 int hinic3_init_hwif(struct hinic3_hwdev *hwdev, void *cfg_reg_base, 771 void *intr_reg_base, void *mgmt_regs_base, u64 db_base_phy, 772 void *db_base, u64 db_dwqe_len) > 773 { 774 struct hinic3_hwif *hwif = NULL; 775 u32 attr1, attr4, attr5; 776 int err; 777 778 err = init_hwif(hwdev, cfg_reg_base, intr_reg_base, mgmt_regs_base); 779 if (err) 780 return err; 781 782 hwif = hwdev->hwif; 783 784 err = init_db_area_idx(hwif, db_base_phy, db_base, db_dwqe_len); 785 if (err) { 786 sdk_err(hwdev->dev_hdl, "Failed to init db area.\n"); 787 goto init_db_area_err; 788 } 789 790 err = wait_hwif_ready(hwdev); 791 if (err) { 792 attr1 = hinic3_hwif_read_reg(hwif, HINIC3_CSR_FUNC_ATTR1_ADDR); 793 sdk_err(hwdev->dev_hdl, "Chip status is not ready, attr1:0x%x\n", attr1); 794 goto hwif_ready_err; 795 } 796 797 err = get_hwif_attr(hwif); 798 if (err) { 799 sdk_err(hwdev->dev_hdl, "Get hwif attr failed\n"); 800 goto hwif_ready_err; 801 } 802 803 err = wait_until_doorbell_and_outbound_enabled(hwif); 804 if (err) { 805 attr4 = hinic3_hwif_read_reg(hwif, HINIC3_CSR_FUNC_ATTR4_ADDR); 806 attr5 = hinic3_hwif_read_reg(hwif, HINIC3_CSR_FUNC_ATTR5_ADDR); 807 sdk_err(hwdev->dev_hdl, "Hw doorbell/outbound is disabled, attr4 0x%x attr5 0x%x\n", 808 attr4, attr5); 809 goto hwif_ready_err; 810 } 811 812 select_ppf_mpf(hwdev); 813 814 disable_all_msix(hwdev); 815 /* disable mgmt cpu report any event */ 816 hinic3_set_pf_status(hwdev->hwif, HINIC3_PF_STATUS_INIT); 817 818 sdk_info(hwdev->dev_hdl, "global_func_idx: %u, func_type: %d, host_id: %u, ppf: %u, mpf: %u\n", 819 hwif->attr.func_global_idx, hwif->attr.func_type, hwif->attr.pci_intf_idx, 820 hwif->attr.ppf_idx, hwif->attr.mpf_idx); 821 822 return 0; 823 824 hwif_ready_err: 825 hinic3_show_chip_err_info(hwdev); 826 free_db_area(&hwif->free_db_area); 827 init_db_area_err: 828 kfree(hwif); 829 830 return err; 831 } 832 833 /** 834 * hinic3_free_hwif - free the hw interface 835 * @hwif: the hardware interface of a pci function device 836 * @pdev: the pci device that will be part of the hwif struct 837 **/ 838 void hinic3_free_hwif(struct hinic3_hwdev *hwdev) 839 { 840 spin_lock_deinit(&hwdev->hwif->free_db_area.idx_lock); 841 free_db_area(&hwdev->hwif->free_db_area); 842 enable_all_msix(hwdev); 843 kfree(hwdev->hwif); 844 } 845 846 u16 hinic3_global_func_id(void *hwdev) 847 { 848 struct hinic3_hwif *hwif = NULL; 849 850 if (!hwdev) 851 return 0; 852 853 hwif = ((struct hinic3_hwdev *)hwdev)->hwif; 854 855 return hwif->attr.func_global_idx; 856 } 857 EXPORT_SYMBOL(hinic3_global_func_id); 858 859 /** > 860 * get function id from register,used by sriov hot migration process 861 * @hwdev: the pointer to hw device 862 */ > 863 u16 hinic3_global_func_id_hw(void *hwdev) 864 { 865 u32 addr, attr0; 866 struct hinic3_hwdev *dev; 867 868 dev = (struct hinic3_hwdev *)hwdev; 869 addr = HINIC3_CSR_FUNC_ATTR0_ADDR; 870 attr0 = hinic3_hwif_read_reg(dev->hwif, addr); 871 872 return HINIC3_AF0_GET(attr0, FUNC_GLOBAL_IDX); 873 } 874 875 /** 876 * get function id, used by sriov hot migratition process. 877 * @hwdev: the pointer to hw device 878 * @func_id: function id 879 */ > 880 int hinic3_global_func_id_get(void *hwdev, u16 *func_id) 881 { 882 struct hinic3_hwdev *dev = (struct hinic3_hwdev *)hwdev; 883 884 if (!hwdev || !func_id) 885 return -EINVAL; 886 887 /* only vf get func_id from chip reg for sriov migrate */ 888 if (!HINIC3_IS_VF(dev)) { 889 *func_id = hinic3_global_func_id(hwdev); 890 return 0; 891 } 892 893 *func_id = hinic3_global_func_id_hw(dev); 894 return 0; 895 } 896 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-5.10] scsi: mpt3sas: Prevent sending diag_reset when the controller is ready
by Baogen Shang 28 Apr '24

28 Apr '24
From: Ranjan Kumar <ranjan.kumar(a)broadcom.com> stable inclusion from stable-v5.10.215 commit ba3a55d118bf211f4a7f53f83dafbc3405ea198d category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J6AL CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=… ------------------------- [ Upstream commit ee0017c3ed8a8abfa4d40e42f908fb38c31e7515 ] If the driver detects that the controller is not ready before sending the first IOC facts command, it will wait for a maximum of 10 seconds for it to become ready. However, even if the controller becomes ready within 10 seconds, the driver will still issue a diagnostic reset. Modify the driver to avoid sending a diag reset if the controller becomes ready within the 10-second wait time. Signed-off-by: Ranjan Kumar <ranjan.kumar(a)broadcom.com> Link: https://lore.kernel.org/r/20240221071724.14986-1-ranjan.kumar@broadcom.com Signed-off-by: Martin K. Petersen <martin.petersen(a)oracle.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baogen Shang <baogen.shang(a)windriver.com> --- drivers/scsi/mpt3sas/mpt3sas_base.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/mpt3sas/mpt3sas_base.c b/drivers/scsi/mpt3sas/mpt3sas_base.c index 4bf1ea39d21a..55200f5db150 100644 --- a/drivers/scsi/mpt3sas/mpt3sas_base.c +++ b/drivers/scsi/mpt3sas/mpt3sas_base.c @@ -6357,7 +6357,9 @@ _base_wait_for_iocstate(struct MPT3SAS_ADAPTER *ioc, int timeout) return -EFAULT; } - issue_diag_reset: + return 0; + +issue_diag_reset: rc = _base_diag_reset(ioc); return rc; } -- 2.33.0
1 0
0 0
[PATCH OLK-5.10] nvme-fc: do not wait in vain when unloading module
by Baogen Shang 28 Apr '24

28 Apr '24
From: Daniel Wagner <dwagner(a)suse.de> stable inclusion from stable-v5.10.215 commit 4f2c95015ec2a1899161be6c0bdaecedd5a7bfb2 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J6AL CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=… ------------------------- [ Upstream commit 70fbfc47a392b98e5f8dba70c6efc6839205c982 ] The module exit path has race between deleting all controllers and freeing 'left over IDs'. To prevent double free a synchronization between nvme_delete_ctrl and ida_destroy has been added by the initial commit. There is some logic around trying to prevent from hanging forever in wait_for_completion, though it does not handling all cases. E.g. blktests is able to reproduce the situation where the module unload hangs forever. If we completely rely on the cleanup code executed from the nvme_delete_ctrl path, all IDs will be freed eventually. This makes calling ida_destroy unnecessary. We only have to ensure that all nvme_delete_ctrl code has been executed before we leave nvme_fc_exit_module. This is done by flushing the nvme_delete_wq workqueue. While at it, remove the unused nvme_fc_wq workqueue too. Reviewed-by: Christoph Hellwig <hch(a)lst.de> Reviewed-by: Hannes Reinecke <hare(a)suse.de> Signed-off-by: Daniel Wagner <dwagner(a)suse.de> Signed-off-by: Keith Busch <kbusch(a)kernel.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baogen Shang <baogen.shang(a)windriver.com> --- drivers/nvme/host/fc.c | 47 ++++++------------------------------------ 1 file changed, 6 insertions(+), 41 deletions(-) diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index b534a85e2bf1..92db88ceb96f 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c @@ -220,11 +220,6 @@ static LIST_HEAD(nvme_fc_lport_list); static DEFINE_IDA(nvme_fc_local_port_cnt); static DEFINE_IDA(nvme_fc_ctrl_cnt); -static struct workqueue_struct *nvme_fc_wq; - -static bool nvme_fc_waiting_to_unload; -static DECLARE_COMPLETION(nvme_fc_unload_proceed); - /* * These items are short-term. They will eventually be moved into * a generic FC class. See comments in module init. @@ -254,8 +249,6 @@ nvme_fc_free_lport(struct kref *ref) /* remove from transport list */ spin_lock_irqsave(&nvme_fc_lock, flags); list_del(&lport->port_list); - if (nvme_fc_waiting_to_unload && list_empty(&nvme_fc_lport_list)) - complete(&nvme_fc_unload_proceed); spin_unlock_irqrestore(&nvme_fc_lock, flags); ida_simple_remove(&nvme_fc_local_port_cnt, lport->localport.port_num); @@ -3823,10 +3816,6 @@ static int __init nvme_fc_init_module(void) { int ret; - nvme_fc_wq = alloc_workqueue("nvme_fc_wq", WQ_MEM_RECLAIM, 0); - if (!nvme_fc_wq) - return -ENOMEM; - /* * NOTE: * It is expected that in the future the kernel will combine @@ -3844,7 +3833,7 @@ static int __init nvme_fc_init_module(void) ret = class_register(&fc_class); if (ret) { pr_err("couldn't register class fc\n"); - goto out_destroy_wq; + return ret; } /* @@ -3868,8 +3857,6 @@ static int __init nvme_fc_init_module(void) device_destroy(&fc_class, MKDEV(0, 0)); out_destroy_class: class_unregister(&fc_class); -out_destroy_wq: - destroy_workqueue(nvme_fc_wq); return ret; } @@ -3889,45 +3876,23 @@ nvme_fc_delete_controllers(struct nvme_fc_rport *rport) spin_unlock(&rport->lock); } -static void -nvme_fc_cleanup_for_unload(void) +static void __exit nvme_fc_exit_module(void) { struct nvme_fc_lport *lport; struct nvme_fc_rport *rport; - - list_for_each_entry(lport, &nvme_fc_lport_list, port_list) { - list_for_each_entry(rport, &lport->endp_list, endp_list) { - nvme_fc_delete_controllers(rport); - } - } -} - -static void __exit nvme_fc_exit_module(void) -{ unsigned long flags; - bool need_cleanup = false; spin_lock_irqsave(&nvme_fc_lock, flags); - nvme_fc_waiting_to_unload = true; - if (!list_empty(&nvme_fc_lport_list)) { - need_cleanup = true; - nvme_fc_cleanup_for_unload(); - } + list_for_each_entry(lport, &nvme_fc_lport_list, port_list) + list_for_each_entry(rport, &lport->endp_list, endp_list) + nvme_fc_delete_controllers(rport); spin_unlock_irqrestore(&nvme_fc_lock, flags); - if (need_cleanup) { - pr_info("%s: waiting for ctlr deletes\n", __func__); - wait_for_completion(&nvme_fc_unload_proceed); - pr_info("%s: ctrl deletes complete\n", __func__); - } + flush_workqueue(nvme_delete_wq); nvmf_unregister_transport(&nvme_fc_transport); - ida_destroy(&nvme_fc_local_port_cnt); - ida_destroy(&nvme_fc_ctrl_cnt); - device_destroy(&fc_class, MKDEV(0, 0)); class_unregister(&fc_class); - destroy_workqueue(nvme_fc_wq); } module_init(nvme_fc_init_module); -- 2.33.0
1 0
0 0
[PATCH OLK-5.10] nvme-core: check for too small lba shift
by Baogen Shang 28 Apr '24

28 Apr '24
From: Keith Busch <kbusch(a)kernel.org> stable inclusion from stable-v5.10.215 commit 06a33eec1dc28dfbcd62c1ff94a3229f3ee265bc category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J6AL CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=… ------------------------- [ Upstream commit 74fbc88e161424b3b96a22b23a8e3e1edab9d05c ] The block layer doesn't support logical block sizes smaller than 512 bytes. The nvme spec doesn't support that small either, but the driver isn't checking to make sure the device responded with usable data. Failing to catch this will result in a kernel bug, either from a division by zero when stacking, or a zero length bio. Reviewed-by: Jens Axboe <axboe(a)kernel.dk> Signed-off-by: Keith Busch <kbusch(a)kernel.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baogen Shang <baogen.shang(a)windriver.com> --- drivers/nvme/host/core.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 142f3a03509c..9fcc05c4f88c 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -2038,9 +2038,10 @@ static void nvme_update_disk_info(struct gendisk *disk, /* * The block layer can't support LBA sizes larger than the page size - * yet, so catch this early and don't allow block I/O. + * or smaller than a sector size yet, so catch this early and don't + * allow block I/O. */ - if (ns->lba_shift > PAGE_SHIFT) { + if (ns->lba_shift > PAGE_SHIFT || ns->lba_shift < SECTOR_SHIFT) { capacity = 0; bs = (1 << 9); } -- 2.33.0
1 0
0 0
[PATCH OLK-5.10] net/tg3: fix race condition in tg3_reset_task()
by Baogen Shang 28 Apr '24

28 Apr '24
From: Thinh Tran <thinhtr(a)linux.vnet.ibm.com> stable inclusion from stable-v5.10.215 commit 1059aa41c5a84abfab4cc7371d6b5ff2b30b6c2d category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J6AL CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=… ------------------------- [ Upstream commit 16b55b1f2269962fb6b5154b8bf43f37c9a96637 ] When an EEH error is encountered by a PCI adapter, the EEH driver modifies the PCI channel's state as shown below: enum { /* I/O channel is in normal state */ pci_channel_io_normal = (__force pci_channel_state_t) 1, /* I/O to channel is blocked */ pci_channel_io_frozen = (__force pci_channel_state_t) 2, /* PCI card is dead */ pci_channel_io_perm_failure = (__force pci_channel_state_t) 3, }; If the same EEH error then causes the tg3 driver's transmit timeout logic to execute, the tg3_tx_timeout() function schedules a reset task via tg3_reset_task_schedule(), which may cause a race condition between the tg3 and EEH driver as both attempt to recover the HW via a reset action. EEH driver gets error event --> eeh_set_channel_state() and set device to one of error state above scheduler: tg3_reset_task() get returned error from tg3_init_hw() --> dev_close() shuts down the interface tg3_io_slot_reset() and tg3_io_resume() fail to reset/resume the device To resolve this issue, we avoid the race condition by checking the PCI channel state in the tg3_reset_task() function and skip the tg3 driver initiated reset when the PCI channel is not in the normal state. (The driver has no access to tg3 device registers at this point and cannot even complete the reset task successfully without external assistance.) We'll leave the reset procedure to be managed by the EEH driver which calls the tg3_io_error_detected(), tg3_io_slot_reset() and tg3_io_resume() functions as appropriate. Adding the same checking in tg3_dump_state() to avoid dumping all device registers when the PCI channel is not in the normal state. Signed-off-by: Thinh Tran <thinhtr(a)linux.vnet.ibm.com> Tested-by: Venkata Sai Duggi <venkata.sai.duggi(a)ibm.com> Reviewed-by: David Christensen <drc(a)linux.vnet.ibm.com> Reviewed-by: Michael Chan <michael.chan(a)broadcom.com> Link: https://lore.kernel.org/r/20231201001911.656-1-thinhtr@linux.vnet.ibm.com Signed-off-by: Jakub Kicinski <kuba(a)kernel.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baogen Shang <baogen.shang(a)windriver.com> --- drivers/net/ethernet/broadcom/tg3.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/broadcom/tg3.c b/drivers/net/ethernet/broadcom/tg3.c index 4e74a3d44d1e..56ca913f0c2d 100644 --- a/drivers/net/ethernet/broadcom/tg3.c +++ b/drivers/net/ethernet/broadcom/tg3.c @@ -6454,6 +6454,14 @@ static void tg3_dump_state(struct tg3 *tp) int i; u32 *regs; + /* If it is a PCI error, all registers will be 0xffff, + * we don't dump them out, just report the error and return + */ + if (tp->pdev->error_state != pci_channel_io_normal) { + netdev_err(tp->dev, "PCI channel ERROR!\n"); + return; + } + regs = kzalloc(TG3_REG_BLK_SIZE, GFP_ATOMIC); if (!regs) return; @@ -11195,7 +11203,8 @@ static void tg3_reset_task(struct work_struct *work) rtnl_lock(); tg3_full_lock(tp, 0); - if (tp->pcierr_recovery || !netif_running(tp->dev)) { + if (tp->pcierr_recovery || !netif_running(tp->dev) || + tp->pdev->error_state != pci_channel_io_normal) { tg3_flag_clear(tp, RESET_TASK_PENDING); tg3_full_unlock(tp); rtnl_unlock(); -- 2.33.0
1 0
0 0
[PATCH OLK-5.10] drm/amd/pm: fix a double-free in si_dpm_init
by Baogen Shang 28 Apr '24

28 Apr '24
From: Zhipeng Lu <alexious(a)zju.edu.cn> stable inclusion from stable-v5.10.215 commit aeed2b4e4a70c7568d4a5eecd6a109713c0dfbf4 category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I9J6AL CVE: NA Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=… ------------------------- [ Upstream commit ac16667237a82e2597e329eb9bc520d1cf9dff30 ] When the allocation of adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries fails, amdgpu_free_extended_power_table is called to free some fields of adev. However, when the control flow returns to si_dpm_sw_init, it goes to label dpm_failed and calls si_dpm_fini, which calls amdgpu_free_extended_power_table again and free those fields again. Thus a double-free is triggered. Fixes: 841686df9f7d ("drm/amdgpu: add SI DPM support (v4)") Signed-off-by: Zhipeng Lu <alexious(a)zju.edu.cn> Signed-off-by: Alex Deucher <alexander.deucher(a)amd.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Baogen Shang <baogen.shang(a)windriver.com> --- drivers/gpu/drm/amd/pm/powerplay/si_dpm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c b/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c index d6544a6dabc7..6f0653c81f8f 100644 --- a/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c +++ b/drivers/gpu/drm/amd/pm/powerplay/si_dpm.c @@ -7349,10 +7349,9 @@ static int si_dpm_init(struct amdgpu_device *adev) kcalloc(4, sizeof(struct amdgpu_clock_voltage_dependency_entry), GFP_KERNEL); - if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) { - amdgpu_free_extended_power_table(adev); + if (!adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries) return -ENOMEM; - } + adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.count = 4; adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries[0].clk = 0; adev->pm.dpm.dyn_state.vddc_dependency_on_dispclk.entries[0].v = 0; -- 2.33.0
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 1085
  • 1086
  • 1087
  • 1088
  • 1089
  • 1090
  • 1091
  • ...
  • 1866
  • Older →

HyperKitty Powered by HyperKitty