Kernel
Threads by month
- ----- 2025 -----
- July
- 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
- 46 participants
- 19077 discussions

[openeuler:openEuler-1.0-LTS 1424/1424] mm/page_alloc.c:1645:3: warning: cast from 'int (*)(unsigned long, unsigned long, struct deferred_args *)' to 'ktask_thread_func' (aka 'int (*)(void *, void *, void *)') converts to incompatible function type
by kernel test robot 31 Mar '25
by kernel test robot 31 Mar '25
31 Mar '25
Hi Daniel,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 5b56c883c34a890a3f9ca7baa8aea426538c88a8
commit: eb761d6521c32c006a4987260394a61c6684fb35 [1424/1424] mm: parallelize deferred struct page initialization within each node
config: x86_64-buildonly-randconfig-003-20250217 (https://download.01.org/0day-ci/archive/20250331/202503311145.7abslQzz-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250331/202503311145.7abslQzz-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/202503311145.7abslQzz-lkp@intel.com/
All warnings (new ones prefixed by >>):
mm/page_alloc.c:1412:6: warning: no previous prototype for function 'set_zone_contiguous' [-Wmissing-prototypes]
1412 | void set_zone_contiguous(struct zone *zone)
| ^
mm/page_alloc.c:1412:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1412 | void set_zone_contiguous(struct zone *zone)
| ^
| static
mm/page_alloc.c:1433:6: warning: no previous prototype for function 'clear_zone_contiguous' [-Wmissing-prototypes]
1433 | void clear_zone_contiguous(struct zone *zone)
| ^
mm/page_alloc.c:1433:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
1433 | void clear_zone_contiguous(struct zone *zone)
| ^
| static
>> mm/page_alloc.c:1645:3: warning: cast from 'int (*)(unsigned long, unsigned long, struct deferred_args *)' to 'ktask_thread_func' (aka 'int (*)(void *, void *, void *)') converts to incompatible function type [-Wcast-function-type-mismatch]
1645 | DEFINE_KTASK_CTL(ctl, deferred_init_chunk, &args,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1646 | KTASK_PTE_MINCHUNK);
| ~~~~~~~~~~~~~~~~~~~
include/linux/ktask.h:139:3: note: expanded from macro 'DEFINE_KTASK_CTL'
139 | KTASK_CTL_INITIALIZER(thread_func, func_arg, min_chunk_size) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/ktask.h:123:21: note: expanded from macro 'KTASK_CTL_INITIALIZER'
123 | .kc_thread_func = (ktask_thread_func)(thread_func), \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/page_alloc.c:1661:3: warning: cast from 'int (*)(unsigned long, unsigned long, struct deferred_args *)' to 'ktask_thread_func' (aka 'int (*)(void *, void *, void *)') converts to incompatible function type [-Wcast-function-type-mismatch]
1661 | DEFINE_KTASK_CTL(ctl, deferred_free_chunk, &args,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1662 | KTASK_PTE_MINCHUNK);
| ~~~~~~~~~~~~~~~~~~~
include/linux/ktask.h:139:3: note: expanded from macro 'DEFINE_KTASK_CTL'
139 | KTASK_CTL_INITIALIZER(thread_func, func_arg, min_chunk_size) \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
include/linux/ktask.h:123:21: note: expanded from macro 'KTASK_CTL_INITIALIZER'
123 | .kc_thread_func = (ktask_thread_func)(thread_func), \
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 warnings generated.
vim +1645 mm/page_alloc.c
1587
1588 /* Initialise remaining memory on a node */
1589 static int __init deferred_init_memmap(void *data)
1590 {
1591 pg_data_t *pgdat = data;
1592 int nid = pgdat->node_id;
1593 unsigned long start = jiffies;
1594 unsigned long nr_init = 0, nr_free = 0;
1595 unsigned long spfn, epfn, first_init_pfn, flags;
1596 phys_addr_t spa, epa;
1597 int zid;
1598 struct zone *zone;
1599 const struct cpumask *cpumask = cpumask_of_node(pgdat->node_id);
1600 u64 i;
1601 unsigned long nr_node_cpus;
1602 struct ktask_node kn;
1603
1604 /* Bind memory initialisation thread to a local node if possible */
1605 if (!cpumask_empty(cpumask))
1606 set_cpus_allowed_ptr(current, cpumask);
1607
1608 pgdat_resize_lock(pgdat, &flags);
1609 first_init_pfn = pgdat->first_deferred_pfn;
1610 if (first_init_pfn == ULONG_MAX) {
1611 pgdat_resize_unlock(pgdat, &flags);
1612 pgdat_init_report_one_done();
1613 return 0;
1614 }
1615
1616 /*
1617 * We'd like to know the memory bandwidth of the chip to calculate the
1618 * most efficient number of threads to start, but we can't. In
1619 * testing, a good value for a variety of systems was a quarter of the
1620 * CPUs on the node.
1621 */
1622 nr_node_cpus = DIV_ROUND_UP(cpumask_weight(cpumask), 4);
1623
1624 /* Sanity check boundaries */
1625 BUG_ON(pgdat->first_deferred_pfn < pgdat->node_start_pfn);
1626 BUG_ON(pgdat->first_deferred_pfn > pgdat_end_pfn(pgdat));
1627 pgdat->first_deferred_pfn = ULONG_MAX;
1628
1629 /* Only the highest zone is deferred so find it */
1630 for (zid = 0; zid < MAX_NR_ZONES; zid++) {
1631 zone = pgdat->node_zones + zid;
1632 if (first_init_pfn < zone_end_pfn(zone))
1633 break;
1634 }
1635 first_init_pfn = max(zone->zone_start_pfn, first_init_pfn);
1636
1637 /*
1638 * Initialize and free pages. We do it in two loops: first we initialize
1639 * struct page, than free to buddy allocator, because while we are
1640 * freeing pages we can access pages that are ahead (computing buddy
1641 * page in __free_one_page()).
1642 */
1643 for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
1644 struct deferred_args args = { nid, zid, ATOMIC64_INIT(0) };
> 1645 DEFINE_KTASK_CTL(ctl, deferred_init_chunk, &args,
1646 KTASK_PTE_MINCHUNK);
1647 ktask_ctl_set_max_threads(&ctl, nr_node_cpus);
1648
1649 spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
1650 epfn = min_t(unsigned long, zone_end_pfn(zone), PFN_DOWN(epa));
1651
1652 kn.kn_start = (void *)spfn;
1653 kn.kn_task_size = (spfn < epfn) ? epfn - spfn : 0;
1654 kn.kn_nid = nid;
1655 (void) ktask_run_numa(&kn, 1, &ctl);
1656
1657 nr_init += atomic64_read(&args.nr_pages);
1658 }
1659 for_each_free_mem_range(i, nid, MEMBLOCK_NONE, &spa, &epa, NULL) {
1660 struct deferred_args args = { nid, zid, ATOMIC64_INIT(0) };
1661 DEFINE_KTASK_CTL(ctl, deferred_free_chunk, &args,
1662 KTASK_PTE_MINCHUNK);
1663 ktask_ctl_set_max_threads(&ctl, nr_node_cpus);
1664
1665 spfn = max_t(unsigned long, first_init_pfn, PFN_UP(spa));
1666 epfn = min_t(unsigned long, zone_end_pfn(zone), PFN_DOWN(epa));
1667
1668 kn.kn_start = (void *)spfn;
1669 kn.kn_task_size = (spfn < epfn) ? epfn - spfn : 0;
1670 kn.kn_nid = nid;
1671 (void) ktask_run_numa(&kn, 1, &ctl);
1672
1673 nr_free += atomic64_read(&args.nr_pages);
1674 }
1675 pgdat_resize_unlock(pgdat, &flags);
1676
1677 /* Sanity check that the next zone really is unpopulated */
1678 WARN_ON(++zid < MAX_NR_ZONES && populated_zone(++zone));
1679 VM_BUG_ON(nr_init != nr_free);
1680
1681 zone->managed_pages += nr_free;
1682
1683 pr_info("node %d initialised, %lu pages in %ums\n", nid, nr_free,
1684 jiffies_to_msecs(jiffies - start));
1685
1686 pgdat_init_report_one_done();
1687 return 0;
1688 }
1689
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[PATCH openEuler-1.0-LTS] drbd: Fix five use after free bugs in get_initial_state
by Xiaomeng Zhang 31 Mar '25
by Xiaomeng Zhang 31 Mar '25
31 Mar '25
From: Lv Yunlong <lyl2019(a)mail.ustc.edu.cn>
stable inclusion
from stable-v5.10.111
commit 594205b4936771a250f9d141e7e0fff21c3dd2d9
category: bugfix
bugzilla: https://gitee.com/src-openeuler/kernel/issues/IBP6VU
CVE: CVE-2022-49085
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit aadb22ba2f656581b2f733deb3a467c48cc618f6 ]
In get_initial_state, it calls notify_initial_state_done(skb,..) if
cb->args[5]==1. If genlmsg_put() failed in notify_initial_state_done(),
the skb will be freed by nlmsg_free(skb).
Then get_initial_state will goto out and the freed skb will be used by
return value skb->len, which is a uaf bug.
What's worse, the same problem goes even further: skb can also be
freed in the notify_*_state_change -> notify_*_state calls below.
Thus 4 additional uaf bugs happened.
My patch lets the problem callee functions: notify_initial_state_done
and notify_*_state_change return an error code if errors happen.
So that the error codes could be propagated and the uaf bugs can be avoid.
v2 reports a compilation warning. This v3 fixed this warning and built
successfully in my local environment with no additional warnings.
v2: https://lore.kernel.org/patchwork/patch/1435218/
Fixes: a29728463b254 ("drbd: Backport the "events2" command")
Signed-off-by: Lv Yunlong <lyl2019(a)mail.ustc.edu.cn>
Reviewed-by: Christoph Böhmwalder <christoph.boehmwalder(a)linbit.com>
Signed-off-by: Jens Axboe <axboe(a)kernel.dk>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Wang Hai <wanghai38(a)huawei.com>
Signed-off-by: Xiaomeng Zhang <zhangxiaomeng13(a)huawei.com>
---
drivers/block/drbd/drbd_int.h | 8 ++---
drivers/block/drbd/drbd_nl.c | 41 ++++++++++++++++----------
drivers/block/drbd/drbd_state.c | 18 +++++------
drivers/block/drbd/drbd_state_change.h | 8 ++---
4 files changed, 42 insertions(+), 33 deletions(-)
diff --git a/drivers/block/drbd/drbd_int.h b/drivers/block/drbd/drbd_int.h
index e35a234b0a8f..4f66cf6879fd 100644
--- a/drivers/block/drbd/drbd_int.h
+++ b/drivers/block/drbd/drbd_int.h
@@ -1688,22 +1688,22 @@ struct sib_info {
};
void drbd_bcast_event(struct drbd_device *device, const struct sib_info *sib);
-extern void notify_resource_state(struct sk_buff *,
+extern int notify_resource_state(struct sk_buff *,
unsigned int,
struct drbd_resource *,
struct resource_info *,
enum drbd_notification_type);
-extern void notify_device_state(struct sk_buff *,
+extern int notify_device_state(struct sk_buff *,
unsigned int,
struct drbd_device *,
struct device_info *,
enum drbd_notification_type);
-extern void notify_connection_state(struct sk_buff *,
+extern int notify_connection_state(struct sk_buff *,
unsigned int,
struct drbd_connection *,
struct connection_info *,
enum drbd_notification_type);
-extern void notify_peer_device_state(struct sk_buff *,
+extern int notify_peer_device_state(struct sk_buff *,
unsigned int,
struct drbd_peer_device *,
struct peer_device_info *,
diff --git a/drivers/block/drbd/drbd_nl.c b/drivers/block/drbd/drbd_nl.c
index 5b15ffd0c7f5..5a80453be553 100644
--- a/drivers/block/drbd/drbd_nl.c
+++ b/drivers/block/drbd/drbd_nl.c
@@ -4598,7 +4598,7 @@ static int nla_put_notification_header(struct sk_buff *msg,
return drbd_notification_header_to_skb(msg, &nh, true);
}
-void notify_resource_state(struct sk_buff *skb,
+int notify_resource_state(struct sk_buff *skb,
unsigned int seq,
struct drbd_resource *resource,
struct resource_info *resource_info,
@@ -4640,16 +4640,17 @@ void notify_resource_state(struct sk_buff *skb,
if (err && err != -ESRCH)
goto failed;
}
- return;
+ return 0;
nla_put_failure:
nlmsg_free(skb);
failed:
drbd_err(resource, "Error %d while broadcasting event. Event seq:%u\n",
err, seq);
+ return err;
}
-void notify_device_state(struct sk_buff *skb,
+int notify_device_state(struct sk_buff *skb,
unsigned int seq,
struct drbd_device *device,
struct device_info *device_info,
@@ -4689,16 +4690,17 @@ void notify_device_state(struct sk_buff *skb,
if (err && err != -ESRCH)
goto failed;
}
- return;
+ return 0;
nla_put_failure:
nlmsg_free(skb);
failed:
drbd_err(device, "Error %d while broadcasting event. Event seq:%u\n",
err, seq);
+ return err;
}
-void notify_connection_state(struct sk_buff *skb,
+int notify_connection_state(struct sk_buff *skb,
unsigned int seq,
struct drbd_connection *connection,
struct connection_info *connection_info,
@@ -4738,16 +4740,17 @@ void notify_connection_state(struct sk_buff *skb,
if (err && err != -ESRCH)
goto failed;
}
- return;
+ return 0;
nla_put_failure:
nlmsg_free(skb);
failed:
drbd_err(connection, "Error %d while broadcasting event. Event seq:%u\n",
err, seq);
+ return err;
}
-void notify_peer_device_state(struct sk_buff *skb,
+int notify_peer_device_state(struct sk_buff *skb,
unsigned int seq,
struct drbd_peer_device *peer_device,
struct peer_device_info *peer_device_info,
@@ -4788,13 +4791,14 @@ void notify_peer_device_state(struct sk_buff *skb,
if (err && err != -ESRCH)
goto failed;
}
- return;
+ return 0;
nla_put_failure:
nlmsg_free(skb);
failed:
drbd_err(peer_device, "Error %d while broadcasting event. Event seq:%u\n",
err, seq);
+ return err;
}
void notify_helper(enum drbd_notification_type type,
@@ -4845,7 +4849,7 @@ void notify_helper(enum drbd_notification_type type,
err, seq);
}
-static void notify_initial_state_done(struct sk_buff *skb, unsigned int seq)
+static int notify_initial_state_done(struct sk_buff *skb, unsigned int seq)
{
struct drbd_genlmsghdr *dh;
int err;
@@ -4859,11 +4863,12 @@ static void notify_initial_state_done(struct sk_buff *skb, unsigned int seq)
if (nla_put_notification_header(skb, NOTIFY_EXISTS))
goto nla_put_failure;
genlmsg_end(skb, dh);
- return;
+ return 0;
nla_put_failure:
nlmsg_free(skb);
pr_err("Error %d sending event. Event seq:%u\n", err, seq);
+ return err;
}
static void free_state_changes(struct list_head *list)
@@ -4890,6 +4895,7 @@ static int get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)
unsigned int seq = cb->args[2];
unsigned int n;
enum drbd_notification_type flags = 0;
+ int err = 0;
/* There is no need for taking notification_mutex here: it doesn't
matter if the initial state events mix with later state chage
@@ -4898,32 +4904,32 @@ static int get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)
cb->args[5]--;
if (cb->args[5] == 1) {
- notify_initial_state_done(skb, seq);
+ err = notify_initial_state_done(skb, seq);
goto out;
}
n = cb->args[4]++;
if (cb->args[4] < cb->args[3])
flags |= NOTIFY_CONTINUES;
if (n < 1) {
- notify_resource_state_change(skb, seq, state_change->resource,
+ err = notify_resource_state_change(skb, seq, state_change->resource,
NOTIFY_EXISTS | flags);
goto next;
}
n--;
if (n < state_change->n_connections) {
- notify_connection_state_change(skb, seq, &state_change->connections[n],
+ err = notify_connection_state_change(skb, seq, &state_change->connections[n],
NOTIFY_EXISTS | flags);
goto next;
}
n -= state_change->n_connections;
if (n < state_change->n_devices) {
- notify_device_state_change(skb, seq, &state_change->devices[n],
+ err = notify_device_state_change(skb, seq, &state_change->devices[n],
NOTIFY_EXISTS | flags);
goto next;
}
n -= state_change->n_devices;
if (n < state_change->n_devices * state_change->n_connections) {
- notify_peer_device_state_change(skb, seq, &state_change->peer_devices[n],
+ err = notify_peer_device_state_change(skb, seq, &state_change->peer_devices[n],
NOTIFY_EXISTS | flags);
goto next;
}
@@ -4938,7 +4944,10 @@ static int get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)
cb->args[4] = 0;
}
out:
- return skb->len;
+ if (err)
+ return err;
+ else
+ return skb->len;
}
int drbd_adm_get_initial_state(struct sk_buff *skb, struct netlink_callback *cb)
diff --git a/drivers/block/drbd/drbd_state.c b/drivers/block/drbd/drbd_state.c
index b452359b6aae..1474250f9440 100644
--- a/drivers/block/drbd/drbd_state.c
+++ b/drivers/block/drbd/drbd_state.c
@@ -1549,7 +1549,7 @@ int drbd_bitmap_io_from_worker(struct drbd_device *device,
return rv;
}
-void notify_resource_state_change(struct sk_buff *skb,
+int notify_resource_state_change(struct sk_buff *skb,
unsigned int seq,
struct drbd_resource_state_change *resource_state_change,
enum drbd_notification_type type)
@@ -1562,10 +1562,10 @@ void notify_resource_state_change(struct sk_buff *skb,
.res_susp_fen = resource_state_change->susp_fen[NEW],
};
- notify_resource_state(skb, seq, resource, &resource_info, type);
+ return notify_resource_state(skb, seq, resource, &resource_info, type);
}
-void notify_connection_state_change(struct sk_buff *skb,
+int notify_connection_state_change(struct sk_buff *skb,
unsigned int seq,
struct drbd_connection_state_change *connection_state_change,
enum drbd_notification_type type)
@@ -1576,10 +1576,10 @@ void notify_connection_state_change(struct sk_buff *skb,
.conn_role = connection_state_change->peer_role[NEW],
};
- notify_connection_state(skb, seq, connection, &connection_info, type);
+ return notify_connection_state(skb, seq, connection, &connection_info, type);
}
-void notify_device_state_change(struct sk_buff *skb,
+int notify_device_state_change(struct sk_buff *skb,
unsigned int seq,
struct drbd_device_state_change *device_state_change,
enum drbd_notification_type type)
@@ -1589,10 +1589,10 @@ void notify_device_state_change(struct sk_buff *skb,
.dev_disk_state = device_state_change->disk_state[NEW],
};
- notify_device_state(skb, seq, device, &device_info, type);
+ return notify_device_state(skb, seq, device, &device_info, type);
}
-void notify_peer_device_state_change(struct sk_buff *skb,
+int notify_peer_device_state_change(struct sk_buff *skb,
unsigned int seq,
struct drbd_peer_device_state_change *p,
enum drbd_notification_type type)
@@ -1606,7 +1606,7 @@ void notify_peer_device_state_change(struct sk_buff *skb,
.peer_resync_susp_dependency = p->resync_susp_dependency[NEW],
};
- notify_peer_device_state(skb, seq, peer_device, &peer_device_info, type);
+ return notify_peer_device_state(skb, seq, peer_device, &peer_device_info, type);
}
static void broadcast_state_change(struct drbd_state_change *state_change)
@@ -1614,7 +1614,7 @@ static void broadcast_state_change(struct drbd_state_change *state_change)
struct drbd_resource_state_change *resource_state_change = &state_change->resource[0];
bool resource_state_has_changed;
unsigned int n_device, n_connection, n_peer_device, n_peer_devices;
- void (*last_func)(struct sk_buff *, unsigned int, void *,
+ int (*last_func)(struct sk_buff *, unsigned int, void *,
enum drbd_notification_type) = NULL;
void *uninitialized_var(last_arg);
diff --git a/drivers/block/drbd/drbd_state_change.h b/drivers/block/drbd/drbd_state_change.h
index ba80f612d6ab..d5b0479bc9a6 100644
--- a/drivers/block/drbd/drbd_state_change.h
+++ b/drivers/block/drbd/drbd_state_change.h
@@ -44,19 +44,19 @@ extern struct drbd_state_change *remember_old_state(struct drbd_resource *, gfp_
extern void copy_old_to_new_state_change(struct drbd_state_change *);
extern void forget_state_change(struct drbd_state_change *);
-extern void notify_resource_state_change(struct sk_buff *,
+extern int notify_resource_state_change(struct sk_buff *,
unsigned int,
struct drbd_resource_state_change *,
enum drbd_notification_type type);
-extern void notify_connection_state_change(struct sk_buff *,
+extern int notify_connection_state_change(struct sk_buff *,
unsigned int,
struct drbd_connection_state_change *,
enum drbd_notification_type type);
-extern void notify_device_state_change(struct sk_buff *,
+extern int notify_device_state_change(struct sk_buff *,
unsigned int,
struct drbd_device_state_change *,
enum drbd_notification_type type);
-extern void notify_peer_device_state_change(struct sk_buff *,
+extern int notify_peer_device_state_change(struct sk_buff *,
unsigned int,
struct drbd_peer_device_state_change *,
enum drbd_notification_type type);
--
2.34.1
2
1

31 Mar '25
From: Xinghai Cen <cenxinghai(a)h-partners.com>
Some bug fix patches for RDMA/hns to olk-6.6
Chengchang Tang (1):
RDMA/hns: Fix a meaningless loop in free_buffer_pages_proc()
Junxian Huang (7):
RDMA/hns: Change mtr member to pointer in hns QP/CQ/MR/SRQ/EQ struct
RDMA/hns: Move mtr_node into the mtr struct
RDMA/hns: Fix delayed destruction of db not taking effect
RDMA/hns: Fix delay-destruction mechanism not processing kernel db
RDMA/hns: Fix mismatched kzalloc vs kvfree
RDMA/hns: Fix DCA error path in alloc_wqe_buf()
RDMA/hns: Reorder uctx deallocation
Yuyu Li (1):
RDMA/hns: Fix remove debugfs after device has been unregistered
drivers/infiniband/hw/hns/hns_roce_bond.c | 2 +-
drivers/infiniband/hw/hns/hns_roce_cq.c | 35 ++---
drivers/infiniband/hw/hns/hns_roce_db.c | 81 ++++++----
drivers/infiniband/hw/hns/hns_roce_dca.c | 8 +-
drivers/infiniband/hw/hns/hns_roce_debugfs.c | 10 +-
drivers/infiniband/hw/hns/hns_roce_debugfs.h | 3 +-
drivers/infiniband/hw/hns/hns_roce_device.h | 69 ++++-----
drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 81 +++++-----
drivers/infiniband/hw/hns/hns_roce_main.c | 23 ++-
drivers/infiniband/hw/hns/hns_roce_mr.c | 145 ++++++++----------
drivers/infiniband/hw/hns/hns_roce_qp.c | 40 ++---
drivers/infiniband/hw/hns/hns_roce_restrack.c | 4 +-
drivers/infiniband/hw/hns/hns_roce_srq.c | 63 +++-----
13 files changed, 269 insertions(+), 295 deletions(-)
--
2.33.0
2
10

[openeuler:openEuler-1.0-LTS 1365/1365] drivers/acpi/cppc_acpi.c:614:3-8: WARNING: NULL check before some freeing functions is not needed.
by kernel test robot 31 Mar '25
by kernel test robot 31 Mar '25
31 Mar '25
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 5b56c883c34a890a3f9ca7baa8aea426538c88a8
commit: b8815fbbe89b0d15fa3296c3e57d2197a92f5bc0 [1365/1365] ACPI: CPPC: Fix cppc_cpufreq_init failed in CPU Hotplug situation
config: x86_64-randconfig-102-20250103 (https://download.01.org/0day-ci/archive/20250331/202503311140.R7DpzkNH-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
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/202503311140.R7DpzkNH-lkp@intel.com/
cocci warnings: (new ones prefixed by >>)
>> drivers/acpi/cppc_acpi.c:614:3-8: WARNING: NULL check before some freeing functions is not needed.
vim +614 drivers/acpi/cppc_acpi.c
576
577 int acpi_get_psd_map(struct cppc_cpudata **all_cpu_data)
578 {
579 struct cpc_desc **cpc_pptr, *cpc_ptr;
580 int parsed_core_num = 0;
581 int i, ret;
582
583 cpc_pptr = kcalloc(num_possible_cpus(), sizeof(void *), GFP_KERNEL);
584 if (!cpc_pptr)
585 return -ENOMEM;
586 for_each_possible_cpu(i) {
587 cpc_pptr[i] = kzalloc(sizeof(struct cpc_desc), GFP_KERNEL);
588 if (!cpc_pptr[i]) {
589 ret = -ENOMEM;
590 goto out;
591 }
592 }
593
594 /*
595 * We can not use acpi_get_devices() to walk the processor devices
596 * because some processor device is not present.
597 */
598 ret = acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
599 ACPI_UINT32_MAX, acpi_parse_cpc, NULL,
600 cpc_pptr, (void **)&parsed_core_num);
601 if (ret)
602 goto out;
603 if (parsed_core_num != num_possible_cpus()) {
604 ret = -EINVAL;
605 goto out;
606 }
607
608 ret = __acpi_get_psd_map(all_cpu_data, cpc_pptr);
609
610 out:
611 for_each_possible_cpu(i) {
612 cpc_ptr = cpc_pptr[i];
613 if (cpc_ptr)
> 614 kfree(cpc_ptr);
615 }
616 kfree(cpc_pptr);
617
618 return ret;
619 }
620 EXPORT_SYMBOL_GPL(acpi_get_psd_map);
621
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

31 Mar '25
Patch#1 Allow userspace to get the writable masks for feature ID registers
Patch#2 Document KVM_ARM_GET_REG_WRITABLE_MASKS
Patch#3 Use guest ID register values for the sake of emulation
Patch#4 Advertise selected DebugVer in DBGDIDR.Version
Patch#5 Reject attempts to set invalid debug arch version
Patch#6 Bump up the default KVM sanitised debug version to v8p8
Patch#7 Allow userspace to change ID_AA64ISAR{0-2}_EL1
Patch#8 Allow userspace to change ID_AA64MMFR{0-2}_EL1
Patch#9 Allow userspace to change ID_AA64PFR0_EL1
Patch#10 Allow userspace to change ID_AA64ZFR0_EL1
Patch#11 Document vCPU feature selection UAPIs
Patch#12 Make the exposed feature bits in AA64DFR0_EL1 writable from userspace
Patch#13 Disable MPAM visibility by default and ignore VMM writes
Patch#14 Rename is_id_reg() to imply VM scope
Patch#15 Reset VM feature ID regs from kvm_reset_sys_regs()
Patch#16 Only reset vCPU-scoped feature ID regs once
Patch#17 Use read-only helper for reading VM ID registers
Patch#18 Add helper for writing ID regs
Patch#19 Treat CTR_EL0 as a VM feature ID register
Patch#20 Rename functions for invariant sys regs
Patch#21 Make the L1Ip feature bits in CTR_EL0 writable from userspace
Patch#22 Show writable masks for feature registers
Patch#23 Make HCX writable from userspace
Patch#24 Remove duplicated AA64MMFR1_EL1 XNX
Patch#25 Add support for HIP09 Spectre-BHB mitigation
Patch#26 add cnp verification on Hisilicon erratum 162100125
Patch#27 use KABI_EXTEND to revert struct kvm kabi change
Patch#28 Do not allow ID_AA64MMFR0_EL1.ASIDbits to be overridden
James Morse (1):
KVM: arm64: Disable MPAM visibility by default and ignore VMM writes
Jing Zhang (5):
KVM: arm64: Allow userspace to get the writable masks for feature ID
registers
KVM: arm64: Document KVM_ARM_GET_REG_WRITABLE_MASKS
KVM: arm64: Use guest ID register values for the sake of emulation
KVM: arm64: Allow userspace to change ID_AA64MMFR{0-2}_EL1
KVM: arm64: Allow userspace to change ID_AA64PFR0_EL1
Marc Zyngier (1):
KVM: arm64: Do not allow ID_AA64MMFR0_EL1.ASIDbits to be overridden
Oliver Upton (11):
KVM: arm64: Advertise selected DebugVer in DBGDIDR.Version
KVM: arm64: Reject attempts to set invalid debug arch version
KVM: arm64: Bump up the default KVM sanitised debug version to v8p8
KVM: arm64: Allow userspace to change ID_AA64ISAR{0-2}_EL1
KVM: arm64: Allow userspace to change ID_AA64ZFR0_EL1
KVM: arm64: Document vCPU feature selection UAPIs
KVM: arm64: Rename is_id_reg() to imply VM scope
KVM: arm64: Reset VM feature ID regs from kvm_reset_sys_regs()
KVM: arm64: Only reset vCPU-scoped feature ID regs once
KVM: arm64: Use read-only helper for reading VM ID registers
KVM: arm64: Add helper for writing ID regs
Russell King (1):
KVM: arm64: Remove duplicated AA64MMFR1_EL1 XNX
Sebastian Ott (3):
KVM: arm64: Treat CTR_EL0 as a VM feature ID register
KVM: arm64: rename functions for invariant sys regs
KVM: arm64: show writable masks for feature registers
Shameer Kolothum (2):
KVM: arm64: Make the exposed feature bits in AA64DFR0_EL1 writable
from userspace
KVM: arm64: Make the L1Ip feature bits in CTR_EL0 writable from
userspace
yangjinqian (4):
KVM: arm64: Make HCX writable from userspace
arm64: Add support for HIP09 Spectre-BHB mitigation
arm64: add cnp verification on Hisilicon erratum 162100125
KVM: arm64: use KABI_EXTEND to revert struct kvm kabi change
Documentation/virt/kvm/api.rst | 52 +++
Documentation/virt/kvm/arm/index.rst | 1 +
Documentation/virt/kvm/arm/vcpu-features.rst | 48 +++
arch/arm64/include/asm/cpufeature.h | 14 +
arch/arm64/include/asm/kvm_emulate.h | 3 +-
arch/arm64/include/asm/kvm_host.h | 24 ++
arch/arm64/include/uapi/asm/kvm.h | 32 ++
arch/arm64/kernel/cpu_errata.c | 13 +-
arch/arm64/kernel/proton-pack.c | 1 +
arch/arm64/kvm/arm.c | 15 +-
arch/arm64/kvm/pmu-emul.c | 2 +-
arch/arm64/kvm/sys_regs.c | 351 +++++++++++++++----
include/uapi/linux/kvm.h | 2 +
13 files changed, 475 insertions(+), 83 deletions(-)
create mode 100644 Documentation/virt/kvm/arm/vcpu-features.rst
--
2.33.0
2
29

[openeuler:openEuler-1.0-LTS 1425/1425] kernel/sched/debug.c:990:17: error: no member named 'nr_wakeups_preferred_cpus' in 'struct dyn_affinity_stats'
by kernel test robot 31 Mar '25
by kernel test robot 31 Mar '25
31 Mar '25
Hi Hui,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 5b56c883c34a890a3f9ca7baa8aea426538c88a8
commit: ebca52abe099caa97d7669d0acc71209ea80cfec [1425/1425] sched: Add statistics for scheduler dynamic affinity
config: x86_64-randconfig-103-20250219 (https://download.01.org/0day-ci/archive/20250331/202503310934.WNROVBec-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250331/202503310934.WNROVBec-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/202503310934.WNROVBec-lkp@intel.com/
All errors (new ones prefixed by >>):
kernel/sched/debug.c:815:6: warning: no previous prototype for function 'sysrq_sched_debug_tidy' [-Wmissing-prototypes]
815 | void sysrq_sched_debug_tidy(void)
| ^
kernel/sched/debug.c:815:1: note: declare 'static' if the function is not intended to be used outside of this translation unit
815 | void sysrq_sched_debug_tidy(void)
| ^
| static
>> kernel/sched/debug.c:990:17: error: no member named 'nr_wakeups_preferred_cpus' in 'struct dyn_affinity_stats'
990 | __P(dyn_affi->nr_wakeups_preferred_cpus);
| ~~~~~~~~ ^
kernel/sched/debug.c:939:48: note: expanded from macro '__P'
939 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F)
| ^
kernel/sched/debug.c:21:17: note: expanded from macro 'SEQ_printf'
21 | seq_printf(m, x); \
| ^
>> kernel/sched/debug.c:990:17: error: no member named 'nr_wakeups_preferred_cpus' in 'struct dyn_affinity_stats'
990 | __P(dyn_affi->nr_wakeups_preferred_cpus);
| ~~~~~~~~ ^
kernel/sched/debug.c:939:48: note: expanded from macro '__P'
939 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F)
| ^
kernel/sched/debug.c:23:11: note: expanded from macro 'SEQ_printf'
23 | pr_cont(x); \
| ^
include/linux/printk.h:362:26: note: expanded from macro 'pr_cont'
362 | printk(KERN_CONT fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~
>> kernel/sched/debug.c:991:17: error: no member named 'nr_wakeups_force_preferred_cpus' in 'struct dyn_affinity_stats'
991 | __P(dyn_affi->nr_wakeups_force_preferred_cpus);
| ~~~~~~~~ ^
kernel/sched/debug.c:939:48: note: expanded from macro '__P'
939 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F)
| ^
kernel/sched/debug.c:21:17: note: expanded from macro 'SEQ_printf'
21 | seq_printf(m, x); \
| ^
>> kernel/sched/debug.c:991:17: error: no member named 'nr_wakeups_force_preferred_cpus' in 'struct dyn_affinity_stats'
991 | __P(dyn_affi->nr_wakeups_force_preferred_cpus);
| ~~~~~~~~ ^
kernel/sched/debug.c:939:48: note: expanded from macro '__P'
939 | SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F)
| ^
kernel/sched/debug.c:23:11: note: expanded from macro 'SEQ_printf'
23 | pr_cont(x); \
| ^
include/linux/printk.h:362:26: note: expanded from macro 'pr_cont'
362 | printk(KERN_CONT fmt, ##__VA_ARGS__)
| ^~~~~~~~~~~
1 warning and 4 errors generated.
vim +990 kernel/sched/debug.c
814
> 815 void sysrq_sched_debug_tidy(void)
816 {
817 int cpu;
818
819 SEQ_printf(NULL, "Sched Debug Version: v0.11, %s %.*s\n",
820 init_utsname()->release,
821 (int)strcspn(init_utsname()->version, " "),
822 init_utsname()->version);
823
824 for_each_online_cpu(cpu)
825 print_cpu_tidy(NULL, cpu);
826 }
827
828 /*
829 * This itererator needs some explanation.
830 * It returns 1 for the header position.
831 * This means 2 is CPU 0.
832 * In a hotplugged system some CPUs, including CPU 0, may be missing so we have
833 * to use cpumask_* to iterate over the CPUs.
834 */
835 static void *sched_debug_start(struct seq_file *file, loff_t *offset)
836 {
837 unsigned long n = *offset;
838
839 if (n == 0)
840 return (void *) 1;
841
842 n--;
843
844 if (n > 0)
845 n = cpumask_next(n - 1, cpu_online_mask);
846 else
847 n = cpumask_first(cpu_online_mask);
848
849 *offset = n + 1;
850
851 if (n < nr_cpu_ids)
852 return (void *)(unsigned long)(n + 2);
853
854 return NULL;
855 }
856
857 static void *sched_debug_next(struct seq_file *file, void *data, loff_t *offset)
858 {
859 (*offset)++;
860 return sched_debug_start(file, offset);
861 }
862
863 static void sched_debug_stop(struct seq_file *file, void *data)
864 {
865 }
866
867 static const struct seq_operations sched_debug_sops = {
868 .start = sched_debug_start,
869 .next = sched_debug_next,
870 .stop = sched_debug_stop,
871 .show = sched_debug_show,
872 };
873
874 static int __init init_sched_debug_procfs(void)
875 {
876 if (!proc_create_seq("sched_debug", 0444, NULL, &sched_debug_sops))
877 return -ENOMEM;
878 return 0;
879 }
880
881 __initcall(init_sched_debug_procfs);
882
883 #define __P(F) SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F)
884 #define P(F) SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)p->F)
885 #define __PN(F) SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)F))
886 #define PN(F) SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)p->F))
887
888
889 #ifdef CONFIG_NUMA_BALANCING
890 void print_numa_stats(struct seq_file *m, int node, unsigned long tsf,
891 unsigned long tpf, unsigned long gsf, unsigned long gpf)
892 {
893 SEQ_printf(m, "numa_faults node=%d ", node);
894 SEQ_printf(m, "task_private=%lu task_shared=%lu ", tpf, tsf);
895 SEQ_printf(m, "group_private=%lu group_shared=%lu\n", gpf, gsf);
896 }
897 #endif
898
899
900 static void sched_show_numa(struct task_struct *p, struct seq_file *m)
901 {
902 #ifdef CONFIG_NUMA_BALANCING
903 struct mempolicy *pol;
904
905 if (p->mm)
906 P(mm->numa_scan_seq);
907
908 task_lock(p);
909 pol = p->mempolicy;
910 if (pol && !(pol->flags & MPOL_F_MORON))
911 pol = NULL;
912 mpol_get(pol);
913 task_unlock(p);
914
915 P(numa_pages_migrated);
916 P(numa_preferred_nid);
917 P(total_numa_faults);
918 SEQ_printf(m, "current_node=%d, numa_group_id=%d\n",
919 task_node(p), task_numa_group_id(p));
920 show_numa_stats(p, m);
921 mpol_put(pol);
922 #endif
923 }
924
925 void proc_sched_show_task(struct task_struct *p, struct pid_namespace *ns,
926 struct seq_file *m)
927 {
928 #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY
929 struct dyn_affinity_stats *dyn_affi = p->se.dyn_affi_stats;
930 #endif
931 unsigned long nr_switches;
932
933 SEQ_printf(m, "%s (%d, #threads: %d)\n", p->comm, task_pid_nr_ns(p, ns),
934 get_nr_threads(p));
935 SEQ_printf(m,
936 "---------------------------------------------------------"
937 "----------\n");
938 #define __P(F) \
> 939 SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)F)
940 #define P(F) \
941 SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)p->F)
942 #define P_SCHEDSTAT(F) \
943 SEQ_printf(m, "%-45s:%21Ld\n", #F, (long long)schedstat_val(p->F))
944 #define __PN(F) \
945 SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)F))
946 #define PN(F) \
947 SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)p->F))
948 #define PN_SCHEDSTAT(F) \
949 SEQ_printf(m, "%-45s:%14Ld.%06ld\n", #F, SPLIT_NS((long long)schedstat_val(p->F)))
950
951 PN(se.exec_start);
952 PN(se.vruntime);
953 PN(se.sum_exec_runtime);
954
955 nr_switches = p->nvcsw + p->nivcsw;
956
957 P(se.nr_migrations);
958
959 if (schedstat_enabled()) {
960 u64 avg_atom, avg_per_cpu;
961
962 PN_SCHEDSTAT(se.statistics.sum_sleep_runtime);
963 PN_SCHEDSTAT(se.statistics.wait_start);
964 PN_SCHEDSTAT(se.statistics.sleep_start);
965 PN_SCHEDSTAT(se.statistics.block_start);
966 PN_SCHEDSTAT(se.statistics.sleep_max);
967 PN_SCHEDSTAT(se.statistics.block_max);
968 PN_SCHEDSTAT(se.statistics.exec_max);
969 PN_SCHEDSTAT(se.statistics.slice_max);
970 PN_SCHEDSTAT(se.statistics.wait_max);
971 PN_SCHEDSTAT(se.statistics.wait_sum);
972 P_SCHEDSTAT(se.statistics.wait_count);
973 PN_SCHEDSTAT(se.statistics.iowait_sum);
974 P_SCHEDSTAT(se.statistics.iowait_count);
975 P_SCHEDSTAT(se.statistics.nr_migrations_cold);
976 P_SCHEDSTAT(se.statistics.nr_failed_migrations_affine);
977 P_SCHEDSTAT(se.statistics.nr_failed_migrations_running);
978 P_SCHEDSTAT(se.statistics.nr_failed_migrations_hot);
979 P_SCHEDSTAT(se.statistics.nr_forced_migrations);
980 P_SCHEDSTAT(se.statistics.nr_wakeups);
981 P_SCHEDSTAT(se.statistics.nr_wakeups_sync);
982 P_SCHEDSTAT(se.statistics.nr_wakeups_migrate);
983 P_SCHEDSTAT(se.statistics.nr_wakeups_local);
984 P_SCHEDSTAT(se.statistics.nr_wakeups_remote);
985 P_SCHEDSTAT(se.statistics.nr_wakeups_affine);
986 P_SCHEDSTAT(se.statistics.nr_wakeups_affine_attempts);
987 P_SCHEDSTAT(se.statistics.nr_wakeups_passive);
988 P_SCHEDSTAT(se.statistics.nr_wakeups_idle);
989 #ifdef CONFIG_QOS_SCHED_DYNAMIC_AFFINITY
> 990 __P(dyn_affi->nr_wakeups_preferred_cpus);
> 991 __P(dyn_affi->nr_wakeups_force_preferred_cpus);
992 #endif
993
994 avg_atom = p->se.sum_exec_runtime;
995 if (nr_switches)
996 avg_atom = div64_ul(avg_atom, nr_switches);
997 else
998 avg_atom = -1LL;
999
1000 avg_per_cpu = p->se.sum_exec_runtime;
1001 if (p->se.nr_migrations) {
1002 avg_per_cpu = div64_u64(avg_per_cpu,
1003 p->se.nr_migrations);
1004 } else {
1005 avg_per_cpu = -1LL;
1006 }
1007
1008 __PN(avg_atom);
1009 __PN(avg_per_cpu);
1010 }
1011
1012 __P(nr_switches);
1013 SEQ_printf(m, "%-45s:%21Ld\n",
1014 "nr_voluntary_switches", (long long)p->nvcsw);
1015 SEQ_printf(m, "%-45s:%21Ld\n",
1016 "nr_involuntary_switches", (long long)p->nivcsw);
1017
1018 P(se.load.weight);
1019 P(se.runnable_weight);
1020 #ifdef CONFIG_SMP
1021 P(se.avg.load_sum);
1022 P(se.avg.runnable_load_sum);
1023 P(se.avg.util_sum);
1024 P(se.avg.load_avg);
1025 P(se.avg.runnable_load_avg);
1026 P(se.avg.util_avg);
1027 P(se.avg.last_update_time);
1028 P(se.avg.util_est.ewma);
1029 P(se.avg.util_est.enqueued);
1030 #endif
1031 P(policy);
1032 P(prio);
1033 if (task_has_dl_policy(p)) {
1034 P(dl.runtime);
1035 P(dl.deadline);
1036 }
1037 #undef PN_SCHEDSTAT
1038 #undef PN
1039 #undef __PN
1040 #undef P_SCHEDSTAT
1041 #undef P
1042 #undef __P
1043
1044 {
1045 unsigned int this_cpu = raw_smp_processor_id();
1046 u64 t0, t1;
1047
1048 t0 = cpu_clock(this_cpu);
1049 t1 = cpu_clock(this_cpu);
1050 SEQ_printf(m, "%-45s:%21Ld\n",
1051 "clock-delta", (long long)(t1-t0));
1052 }
1053
1054 sched_show_numa(p, m);
1055 }
1056
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[PATCH openEuler-1.0-LTS] f2fs: fix dereference of stale list iterator after loop body
by Wupeng Ma 31 Mar '25
by Wupeng Ma 31 Mar '25
31 Mar '25
From: Jakob Koschel <jakobkoschel(a)gmail.com>
stable inclusion
from stable-v4.19.247
commit 385edd3ce5b4b1e9d31f474a5e35a39779ec1110
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IBP3SH
CVE: CVE-2022-49425
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id…
--------------------------------
[ Upstream commit 2aaf51dd39afb6d01d13f1e6fe20b684733b37d5 ]
The list iterator variable will be a bogus pointer if no break was hit.
Dereferencing it (cur->page in this case) could load an out-of-bounds/undefined
value making it unsafe to use that in the comparision to determine if the
specific element was found.
Since 'cur->page' *can* be out-ouf-bounds it cannot be guaranteed that
by chance (or intention of an attacker) it matches the value of 'page'
even though the correct element was not found.
This is fixed by using a separate list iterator variable for the loop
and only setting the original variable if a suitable element was found.
Then determing if the element was found is simply checking if the
variable is set.
Fixes: 8c242db9b8c0 ("f2fs: fix stale ATOMIC_WRITTEN_PAGE private pointer")
Signed-off-by: Jakob Koschel <jakobkoschel(a)gmail.com>
Reviewed-by: Chao Yu <chao(a)kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk(a)kernel.org>
Signed-off-by: Sasha Levin <sashal(a)kernel.org>
Signed-off-by: Wupeng Ma <mawupeng1(a)huawei.com>
---
fs/f2fs/segment.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 0e3e590a250f..6fbf0471323e 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -354,16 +354,19 @@ void f2fs_drop_inmem_page(struct inode *inode, struct page *page)
struct f2fs_sb_info *sbi = F2FS_I_SB(inode);
struct list_head *head = &fi->inmem_pages;
struct inmem_pages *cur = NULL;
+ struct inmem_pages *tmp;
f2fs_bug_on(sbi, !IS_ATOMIC_WRITTEN_PAGE(page));
mutex_lock(&fi->inmem_lock);
- list_for_each_entry(cur, head, list) {
- if (cur->page == page)
+ list_for_each_entry(tmp, head, list) {
+ if (tmp->page == page) {
+ cur = tmp;
break;
+ }
}
- f2fs_bug_on(sbi, list_empty(head) || cur->page != page);
+ f2fs_bug_on(sbi, !cur);
list_del(&cur->list);
mutex_unlock(&fi->inmem_lock);
--
2.43.0
2
1

[openeuler:OLK-5.10 2829/2829] drivers/net/ethernet/netswift/ngbe/ngbe_hw.c:2340: multiple definition of `fmgr_cmd_op'; drivers/net/ethernet/netswift/txgbe/txgbe_hw.o:drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2854: first defined here
by kernel test robot 31 Mar '25
by kernel test robot 31 Mar '25
31 Mar '25
Hi DuanqiangWen,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 0e7e8faca7062a439fd0a56574c2c3860ceb2088
commit: 3ddd74dceeba1f4ea8b20db59276ea3c6eded3d5 [2829/2829] openeuler: net: txgbe: Fix some known bugs, merge net-swift txgbe-1.2.3 out-of-tree
config: x86_64-randconfig-122-20250330 (https://download.01.org/0day-ci/archive/20250331/202503310959.wgczfMA5-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250331/202503310959.wgczfMA5-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/202503310959.wgczfMA5-lkp@intel.com/
All errors (new ones prefixed by >>):
ld: drivers/net/ethernet/netswift/ngbe/ngbe_hw.o: in function `fmgr_cmd_op':
>> drivers/net/ethernet/netswift/ngbe/ngbe_hw.c:2340: multiple definition of `fmgr_cmd_op'; drivers/net/ethernet/netswift/txgbe/txgbe_hw.o:drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2854: first defined here
ld: drivers/net/ethernet/netswift/ngbe/ngbe_hw.o: in function `fmgr_usr_cmd_op':
>> drivers/net/ethernet/netswift/ngbe/ngbe_hw.c:2361: multiple definition of `fmgr_usr_cmd_op'; drivers/net/ethernet/netswift/txgbe/txgbe_hw.o:drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2875: first defined here
ld: drivers/net/ethernet/netswift/ngbe/ngbe_hw.o: in function `flash_erase_chip':
>> drivers/net/ethernet/netswift/ngbe/ngbe_hw.c:2371: multiple definition of `flash_erase_chip'; drivers/net/ethernet/netswift/txgbe/txgbe_hw.o:drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2885: first defined here
ld: drivers/net/ethernet/netswift/ngbe/ngbe_hw.o: in function `flash_erase_sector':
>> drivers/net/ethernet/netswift/ngbe/ngbe_hw.c:2377: multiple definition of `flash_erase_sector'; drivers/net/ethernet/netswift/txgbe/txgbe_hw.o:drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2891: first defined here
ld: drivers/net/ethernet/netswift/ngbe/ngbe_hw.o: in function `flash_write_dword':
>> drivers/net/ethernet/netswift/ngbe/ngbe_hw.c:2393: multiple definition of `flash_write_dword'; drivers/net/ethernet/netswift/txgbe/txgbe_hw.o:drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2908: first defined here
sparse warnings: (new ones prefixed by >>)
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:625:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:625:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:625:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:1004:6: sparse: sparse: symbol 'txgbe_add_uc_addr' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:1138:6: sparse: sparse: symbol 'txgbe_set_mta' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2604:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2604:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2604:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2707:5: sparse: sparse: symbol 'txgbe_setup_mac_link_hostif' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2744:5: sparse: sparse: symbol 'txgbe_crc16_ccitt' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2897:5: sparse: sparse: symbol 'flash_read_dword' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2922:5: sparse: sparse: symbol 'txgbe_flash_write_cab' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2944:5: sparse: sparse: symbol 'txgbe_flash_read_cab' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2975:5: sparse: sparse: symbol 'txgbe_flash_write_unlock' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2998:5: sparse: sparse: symbol 'txgbe_flash_write_lock' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3451:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3451:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3451:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3496:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3496:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3496:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4396:5: sparse: sparse: symbol 'txgbe_enable_rx_adapter' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4417:5: sparse: sparse: symbol 'txgbe_set_sgmii_an37_ability' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4972:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4972:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4972:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:5345:5: sparse: sparse: symbol 'txgbe_reset_misc' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6426:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6426:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6426:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6428:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6428:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6428:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6593:5: sparse: sparse: symbol 'txgbe_read_ee_hostif_data' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6642:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6642:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6642:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6724:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6724:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6724:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6737:5: sparse: sparse: symbol 'txgbe_write_ee_hostif_data' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6847:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6847:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6847:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6890:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6890:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6890:9: sparse: int
--
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:132:5: sparse: sparse: symbol 'txgbe_poll_for_msg' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:162:5: sparse: sparse: symbol 'txgbe_poll_for_ack' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:263:5: sparse: sparse: symbol 'txgbe_read_v2p_mailbox' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:284:5: sparse: sparse: symbol 'txgbe_check_for_bit_vf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:300:5: sparse: sparse: symbol 'txgbe_check_for_msg_vf' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:320:5: sparse: sparse: symbol 'txgbe_check_for_ack_vf' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:340:5: sparse: sparse: symbol 'txgbe_check_for_rst_vf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:359:5: sparse: sparse: symbol 'txgbe_obtain_mbx_lock_vf' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:387:5: sparse: sparse: symbol 'txgbe_write_mbx_vf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:425:5: sparse: sparse: symbol 'txgbe_read_mbx_vf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:483:5: sparse: sparse: symbol 'txgbe_check_for_bit_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:503:5: sparse: sparse: symbol 'txgbe_check_for_msg_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:525:5: sparse: sparse: symbol 'txgbe_check_for_ack_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:547:5: sparse: sparse: symbol 'txgbe_check_for_rst_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:572:5: sparse: sparse: symbol 'txgbe_obtain_mbx_lock_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:601:5: sparse: sparse: symbol 'txgbe_write_mbx_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:644:5: sparse: sparse: symbol 'txgbe_read_mbx_pf' was not declared. Should it be static?
vim +2340 drivers/net/ethernet/netswift/ngbe/ngbe_hw.c
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2333
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2334 /**
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2335 * cmd_addr is used for some special command:
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2336 * 1. to be sector address, when implemented erase sector command
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2337 * 2. to be flash address when implemented read, write flash address
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2338 **/
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2339 u8 fmgr_cmd_op(struct ngbe_hw *hw, u32 cmd, u32 cmd_addr)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 @2340 {
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2341 u32 cmd_val = 0;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2342 u32 time_out = 0;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2343
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2344 cmd_val = (cmd << SPI_CLK_CMD_OFFSET) | (SPI_CLK_DIV << SPI_CLK_DIV_OFFSET) | cmd_addr;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2345 wr32(hw, SPI_H_CMD_REG_ADDR, cmd_val);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2346 while (1) {
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2347 if (rd32(hw, SPI_H_STA_REG_ADDR) & 0x1)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2348 break;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2349
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2350 if (time_out == SPI_TIME_OUT_VALUE)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2351 return 1;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2352
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2353 time_out = time_out + 1;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2354 udelay(10);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2355 }
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2356
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2357 return 0;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2358 }
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2359
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2360 u8 fmgr_usr_cmd_op(struct ngbe_hw *hw, u32 usr_cmd)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 @2361 {
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2362 u8 status = 0;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2363
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2364 wr32(hw, SPI_H_USR_CMD_REG_ADDR, usr_cmd);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2365 status = fmgr_cmd_op(hw, SPI_CMD_USER_CMD, 0);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2366
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2367 return status;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2368 }
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2369
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2370 u8 flash_erase_chip(struct ngbe_hw *hw)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 @2371 {
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2372 u8 status = fmgr_cmd_op(hw, SPI_CMD_ERASE_CHIP, 0);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2373 return status;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2374 }
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2375
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2376 u8 flash_erase_sector(struct ngbe_hw *hw, u32 sec_addr)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 @2377 {
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2378 u8 status = fmgr_cmd_op(hw, SPI_CMD_ERASE_SECTOR, sec_addr);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2379 return status;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2380 }
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2381
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2382 u32 ngbe_flash_read_dword(struct ngbe_hw *hw, u32 addr)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2383 {
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2384 u8 status = fmgr_cmd_op(hw, SPI_CMD_READ_DWORD, addr);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2385
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2386 if (status)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2387 return (u32)status;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2388
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2389 return rd32(hw, SPI_H_DAT_REG_ADDR);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2390 }
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2391
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2392 u8 flash_write_dword(struct ngbe_hw *hw, u32 addr, u32 dword)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 @2393 {
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2394 u8 status = 0;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2395
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2396 wr32(hw, SPI_H_DAT_REG_ADDR, dword);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2397 status = fmgr_cmd_op(hw, SPI_CMD_WRITE_DWORD, addr);
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2398 if (status)
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2399 return status;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2400
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2401 if (dword != ngbe_flash_read_dword(hw, addr))
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2402 return 1;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2403
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2404 return 0;
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2405 }
a5961b4bc6ce09 Duanqiang Wen 2022-12-01 2406
:::::: The code at line 2340 was first introduced by commit
:::::: a5961b4bc6ce09a70902686ecc848a47493a9251 openeuler: net: ngbe: add ngbe module support
:::::: TO: Duanqiang Wen <duanqiangwen(a)net-swift.com>
:::::: CC: Duanqiang Wen <duanqiangwen(a)net-swift.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:openEuler-1.0-LTS 1327/1327] mm/vmscan.c:3257:21: error: implicit declaration of function 'kernel_swap_enabled'
by kernel test robot 31 Mar '25
by kernel test robot 31 Mar '25
31 Mar '25
Hi liubo,
FYI, the error/warning still remains.
tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS
head: 5b56c883c34a890a3f9ca7baa8aea426538c88a8
commit: 44983705e56ab22fda801d66e2a6bd0d1be7ca0b [1327/1327] etmem: add original kernel swap enabled options
config: x86_64-buildonly-randconfig-005-20241216 (https://download.01.org/0day-ci/archive/20250331/202503310818.VmXexZb9-lkp@…)
compiler: clang version 19.1.3 (https://github.com/llvm/llvm-project ab51eccf88f5321e7c60591c5546b254b6afab99)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250331/202503310818.VmXexZb9-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/202503310818.VmXexZb9-lkp@intel.com/
All errors (new ones prefixed by >>):
mm/vmscan.c:2734:17: warning: variable 'node_lru_pages' set but not used [-Wunused-but-set-variable]
2734 | unsigned long node_lru_pages = 0;
| ^
>> mm/vmscan.c:3257:21: error: implicit declaration of function 'kernel_swap_enabled' [-Werror,-Wimplicit-function-declaration]
3257 | if (sc != NULL && !kernel_swap_enabled())
| ^
mm/vmscan.c:3257:21: note: did you mean 'kernfs_ns_enabled'?
include/linux/kernfs.h:309:20: note: 'kernfs_ns_enabled' declared here
309 | static inline bool kernfs_ns_enabled(struct kernfs_node *kn)
| ^
1 warning and 1 error generated.
vim +/kernel_swap_enabled +3257 mm/vmscan.c
3250
3251 /*
3252 * Check if original kernel swap is enabled
3253 * turn off kernel swap,but leave page cache reclaim on
3254 */
3255 static inline void kernel_swap_check(struct scan_control *sc)
3256 {
> 3257 if (sc != NULL && !kernel_swap_enabled())
3258 sc->may_swap = 0;
3259 }
3260
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0

[openeuler:OLK-5.10 2829/2829] drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:177:5: sparse: sparse: symbol 'txgbe_get_link_ksettings' was not declared. Should it be static?
by kernel test robot 30 Mar '25
by kernel test robot 30 Mar '25
30 Mar '25
tree: https://gitee.com/openeuler/kernel.git OLK-5.10
head: 0e7e8faca7062a439fd0a56574c2c3860ceb2088
commit: 96c897d3a6cb76928d7981f60f832afba1bcc01b [2829/2829] openeuler: configs: delete txgbe/Kconfig, add txgbe_config to netswift/Kconfig
config: x86_64-randconfig-122-20250330 (https://download.01.org/0day-ci/archive/20250330/202503302242.szHIIxdv-lkp@…)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250330/202503302242.szHIIxdv-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/202503302242.szHIIxdv-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
>> drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:177:5: sparse: sparse: symbol 'txgbe_get_link_ksettings' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:447:33: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:447:33: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:447:33: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1674:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1674:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1674:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1696:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1696:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1696:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1732:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1732:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1732:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1736:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1736:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:1736:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2089:25: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2089:25: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2089:25: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2424:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] psrc @@ got unsigned short [usertype] src_port @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2424:36: sparse: expected restricted __be16 [usertype] psrc
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2424:36: sparse: got unsigned short [usertype] src_port
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2425:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] psrc @@ got unsigned short [usertype] src_port @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2425:36: sparse: expected restricted __be16 [usertype] psrc
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2425:36: sparse: got unsigned short [usertype] src_port
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2426:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] pdst @@ got unsigned short [usertype] dst_port @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2426:36: sparse: expected restricted __be16 [usertype] pdst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2426:36: sparse: got unsigned short [usertype] dst_port
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2427:36: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] pdst @@ got unsigned short [usertype] dst_port @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2427:36: sparse: expected restricted __be16 [usertype] pdst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2427:36: sparse: got unsigned short [usertype] dst_port
>> drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2428:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] ip4src @@ got unsigned int @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2428:38: sparse: expected restricted __be32 [usertype] ip4src
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2428:38: sparse: got unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2429:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] ip4src @@ got unsigned int @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2429:38: sparse: expected restricted __be32 [usertype] ip4src
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2429:38: sparse: got unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2430:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] ip4dst @@ got unsigned int @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2430:38: sparse: expected restricted __be32 [usertype] ip4dst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2430:38: sparse: got unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2431:38: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 [usertype] ip4dst @@ got unsigned int @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2431:38: sparse: expected restricted __be32 [usertype] ip4dst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2431:38: sparse: got unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2432:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] vlan_etype @@ got unsigned short [usertype] flex_bytes @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2432:31: sparse: expected restricted __be16 [usertype] vlan_etype
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2432:31: sparse: got unsigned short [usertype] flex_bytes
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2433:31: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] vlan_etype @@ got unsigned short [usertype] flex_bytes @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2433:31: sparse: expected restricted __be16 [usertype] vlan_etype
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2433:31: sparse: got unsigned short [usertype] flex_bytes
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2434:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got unsigned int [usertype] @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2434:28: sparse: expected restricted __be32
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2434:28: sparse: got unsigned int [usertype]
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2435:28: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be32 @@ got unsigned int [usertype] @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2435:28: sparse: expected restricted __be32
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2435:28: sparse: got unsigned int [usertype]
>> drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2703:43: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 [usertype] ip4src @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2703:43: sparse: expected unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2703:43: sparse: got restricted __be32 [usertype] ip4src
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2704:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 [usertype] ip4src @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2704:34: sparse: expected unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2704:34: sparse: got restricted __be32 [usertype] ip4src
>> drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2705:43: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 [usertype] ip4dst @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2705:43: sparse: expected unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2705:43: sparse: got restricted __be32 [usertype] ip4dst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2706:34: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned int @@ got restricted __be32 [usertype] ip4dst @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2706:34: sparse: expected unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2706:34: sparse: got restricted __be32 [usertype] ip4dst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2707:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] src_port @@ got restricted __be16 [usertype] psrc @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2707:42: sparse: expected unsigned short [usertype] src_port
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2707:42: sparse: got restricted __be16 [usertype] psrc
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2708:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] src_port @@ got restricted __be16 [usertype] psrc @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2708:33: sparse: expected unsigned short [addressable] [assigned] [usertype] src_port
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2708:33: sparse: got restricted __be16 [usertype] psrc
>> drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2709:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] dst_port @@ got restricted __be16 [usertype] pdst @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2709:42: sparse: expected unsigned short [usertype] dst_port
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2709:42: sparse: got restricted __be16 [usertype] pdst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2710:33: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] dst_port @@ got restricted __be16 [usertype] pdst @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2710:33: sparse: expected unsigned short [addressable] [assigned] [usertype] dst_port
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2710:33: sparse: got restricted __be16 [usertype] pdst
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2714:48: sparse: sparse: cast from restricted __be32
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2716:48: sparse: sparse: cast from restricted __be32
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2717:52: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] flex_bytes @@ got restricted __be16 [usertype] vlan_etype @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2717:52: sparse: expected unsigned short [usertype] flex_bytes
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2717:52: sparse: got restricted __be16 [usertype] vlan_etype
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2719:43: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [addressable] [assigned] [usertype] flex_bytes @@ got restricted __be16 [usertype] vlan_etype @@
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2719:43: sparse: expected unsigned short [addressable] [assigned] [usertype] flex_bytes
drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c:2719:43: sparse: got restricted __be16 [usertype] vlan_etype
--
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:132:5: sparse: sparse: symbol 'txgbe_poll_for_msg' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:162:5: sparse: sparse: symbol 'txgbe_poll_for_ack' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:185:5: sparse: sparse: symbol 'txgbe_check_for_bit_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:205:5: sparse: sparse: symbol 'txgbe_check_for_msg_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:227:5: sparse: sparse: symbol 'txgbe_check_for_ack_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:249:5: sparse: sparse: symbol 'txgbe_check_for_rst_pf' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:274:5: sparse: sparse: symbol 'txgbe_obtain_mbx_lock_pf' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:303:5: sparse: sparse: symbol 'txgbe_write_mbx_pf' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_mbx.c:346:5: sparse: sparse: symbol 'txgbe_read_mbx_pf' was not declared. Should it be static?
--
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:170:6: sparse: sparse: symbol 'txgbe_service_event_schedule' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:930:40: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected restricted __be16 [usertype] vlan_proto @@ got unsigned short [usertype] @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:930:40: sparse: expected restricted __be16 [usertype] vlan_proto
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:930:40: sparse: got unsigned short [usertype]
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2632:6: sparse: sparse: symbol 'txgbe_disable_tx_queue' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2777:25: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2777:25: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2777:25: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2781:25: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2781:25: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2781:25: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2792:25: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2792:25: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2792:25: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2796:25: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2796:25: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2796:25: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2858:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2858:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2858:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2913:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2913:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:2913:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3297:5: sparse: sparse: symbol 'txgbe_add_cloud_switcher' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3312:5: sparse: sparse: symbol 'txgbe_del_cloud_switcher' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3632:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3632:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3632:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3662:6: sparse: sparse: symbol 'txgbe_configure_isb' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3672:6: sparse: sparse: symbol 'txgbe_configure_port' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3921:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3921:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:3921:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4227:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4227:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4227:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4292:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4292:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4292:17: sparse: int
>> drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4310:5: sparse: sparse: symbol 'txgbe_init_shared_code' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4392:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4392:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4392:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4821:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4821:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4821:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4953:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4953:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:4953:17: sparse: int
>> drivers/net/ethernet/netswift/txgbe/txgbe_main.c:5952:40: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:5974:36: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:5978:67: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:5988:32: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:5989:36: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:5993:67: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6007:37: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6031:40: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6643:33: sparse: sparse: invalid assignment: ^=
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6643:33: sparse: left side has type unsigned short
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6643:33: sparse: right side has type restricted __be16
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6645:33: sparse: sparse: invalid assignment: ^=
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6645:33: sparse: left side has type unsigned short
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6645:33: sparse: right side has type restricted __be16
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6647:38: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6648:25: sparse: sparse: invalid assignment: ^=
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6648:25: sparse: left side has type unsigned short
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6648:25: sparse: right side has type restricted __be16
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6652:27: sparse: sparse: invalid assignment: ^=
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6652:27: sparse: left side has type unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6652:27: sparse: right side has type restricted __be32
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6662:27: sparse: sparse: invalid assignment: ^=
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6662:27: sparse: left side has type unsigned int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6662:27: sparse: right side has type restricted __be32
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6682:5: sparse: sparse: symbol 'txgbe_skb_pad_nonzero' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6724:30: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned short [usertype] protocol @@ got restricted __be16 [usertype] protocol @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6724:30: sparse: expected unsigned short [usertype] protocol
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6724:30: sparse: got restricted __be16 [usertype] protocol
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6770:26: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] protocol @@ got restricted __be16 [usertype] h_vlan_encapsulated_proto @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6770:26: sparse: expected unsigned short [usertype] protocol
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6770:26: sparse: got restricted __be16 [usertype] h_vlan_encapsulated_proto
>> drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6771:29: sparse: sparse: cast from restricted __be16
>> drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6804:42: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __be16 [usertype] h_vlan_TCI @@ got unsigned short [usertype] @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6804:42: sparse: expected restricted __be16 [usertype] h_vlan_TCI
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:6804:42: sparse: got unsigned short [usertype]
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7209:25: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned short [usertype] port @@ got restricted __be16 [usertype] port @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7209:25: sparse: expected unsigned short [usertype] port
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7209:25: sparse: got restricted __be16 [usertype] port
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7275:46: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7277:37: sparse: sparse: cast from restricted __be16
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7285:47: sparse: sparse: restricted __be16 degrades to integer
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7287:37: sparse: sparse: cast from restricted __be16
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7379:26: sparse: sparse: incorrect type in initializer (different base types) @@ expected unsigned short [usertype] type @@ got restricted __be16 [usertype] protocol @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7379:26: sparse: expected unsigned short [usertype] type
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7379:26: sparse: got restricted __be16 [usertype] protocol
>> drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7395:22: sparse: sparse: incorrect type in assignment (different base types) @@ expected unsigned short [usertype] type @@ got restricted __be16 [usertype] h_vlan_encapsulated_proto @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7395:22: sparse: expected unsigned short [usertype] type
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7395:22: sparse: got restricted __be16 [usertype] h_vlan_encapsulated_proto
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7422:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different base types)) @@ expected int ( *ndo_vlan_rx_add_vid )( ... ) @@ got int ( * )( ... ) @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7422:35: sparse: expected int ( *ndo_vlan_rx_add_vid )( ... )
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7422:35: sparse: got int ( * )( ... )
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7423:35: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different base types)) @@ expected int ( *ndo_vlan_rx_kill_vid )( ... ) @@ got int ( * )( ... ) @@
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7423:35: sparse: expected int ( *ndo_vlan_rx_kill_vid )( ... )
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7423:35: sparse: got int ( * )( ... )
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7583:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7583:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7583:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7786:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7786:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_main.c:7786:17: sparse: int
--
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:645:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:645:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:645:9: sparse: int
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:1042:6: sparse: sparse: symbol 'txgbe_add_uc_addr' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:1186:6: sparse: sparse: symbol 'txgbe_set_mta' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2699:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2699:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2699:9: sparse: int
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2806:5: sparse: sparse: symbol 'txgbe_setup_mac_link_hostif' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:2845:5: sparse: sparse: symbol 'txgbe_crc16_ccitt' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3297:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3297:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3297:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3342:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3342:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:3342:17: sparse: int
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4238:5: sparse: sparse: symbol 'txgbe_enable_rx_adapter' was not declared. Should it be static?
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4259:5: sparse: sparse: symbol 'txgbe_set_sgmii_an37_ability' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4833:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4833:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:4833:9: sparse: int
>> drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:5239:5: sparse: sparse: symbol 'txgbe_reset_misc' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6345:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6345:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6345:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6347:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6347:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6347:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6520:5: sparse: sparse: symbol 'txgbe_read_ee_hostif_data' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6572:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6572:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6572:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6656:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6656:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6656:9: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6669:5: sparse: sparse: symbol 'txgbe_write_ee_hostif_data' was not declared. Should it be static?
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6712:17: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6712:17: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6712:17: sparse: int
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6757:9: sparse: sparse: incompatible types in conditional expression (different base types):
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6757:9: sparse: void
drivers/net/ethernet/netswift/txgbe/txgbe_hw.c:6757:9: sparse: int
vim +/txgbe_get_link_ksettings +177 drivers/net/ethernet/netswift/txgbe/txgbe_ethtool.c
a493f74ade8fe6 zhenpengzheng 2021-07-13 176
a493f74ade8fe6 zhenpengzheng 2021-07-13 @177 int txgbe_get_link_ksettings(struct net_device *netdev,
a493f74ade8fe6 zhenpengzheng 2021-07-13 178 struct ethtool_link_ksettings *cmd)
a493f74ade8fe6 zhenpengzheng 2021-07-13 179 {
a493f74ade8fe6 zhenpengzheng 2021-07-13 180 struct txgbe_adapter *adapter = netdev_priv(netdev);
a493f74ade8fe6 zhenpengzheng 2021-07-13 181 struct txgbe_hw *hw = &adapter->hw;
a493f74ade8fe6 zhenpengzheng 2021-07-13 182 u32 supported_link;
a493f74ade8fe6 zhenpengzheng 2021-07-13 183 u32 link_speed = 0;
a493f74ade8fe6 zhenpengzheng 2021-07-13 184 bool autoneg = false;
a493f74ade8fe6 zhenpengzheng 2021-07-13 185 u32 supported, advertising;
a493f74ade8fe6 zhenpengzheng 2021-07-13 186 bool link_up;
a493f74ade8fe6 zhenpengzheng 2021-07-13 187
a493f74ade8fe6 zhenpengzheng 2021-07-13 188 ethtool_convert_link_mode_to_legacy_u32(&supported,
a493f74ade8fe6 zhenpengzheng 2021-07-13 189 cmd->link_modes.supported);
a493f74ade8fe6 zhenpengzheng 2021-07-13 190
a493f74ade8fe6 zhenpengzheng 2021-07-13 191 TCALL(hw, mac.ops.get_link_capabilities, &supported_link, &autoneg);
a493f74ade8fe6 zhenpengzheng 2021-07-13 192
a493f74ade8fe6 zhenpengzheng 2021-07-13 193 if ((hw->subsystem_device_id & 0xF0) == TXGBE_ID_KR_KX_KX4)
a493f74ade8fe6 zhenpengzheng 2021-07-13 194 autoneg = adapter->backplane_an ? 1:0;
a493f74ade8fe6 zhenpengzheng 2021-07-13 195 else if ((hw->subsystem_device_id & 0xF0) == TXGBE_ID_MAC_SGMII)
a493f74ade8fe6 zhenpengzheng 2021-07-13 196 autoneg = adapter->an37?1:0;
a493f74ade8fe6 zhenpengzheng 2021-07-13 197
a493f74ade8fe6 zhenpengzheng 2021-07-13 198 /* set the supported link speeds */
a493f74ade8fe6 zhenpengzheng 2021-07-13 199 if (supported_link & TXGBE_LINK_SPEED_10GB_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 200 supported |= (txgbe_isbackplane(hw->phy.media_type)) ?
a493f74ade8fe6 zhenpengzheng 2021-07-13 201 txgbe_backplane_type(hw) : SUPPORTED_10000baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 202 if (supported_link & TXGBE_LINK_SPEED_1GB_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 203 supported |= (txgbe_isbackplane(hw->phy.media_type)) ?
a493f74ade8fe6 zhenpengzheng 2021-07-13 204 SUPPORTED_1000baseKX_Full : SUPPORTED_1000baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 205 if (supported_link & TXGBE_LINK_SPEED_100_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 206 supported |= SUPPORTED_100baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 207 if (supported_link & TXGBE_LINK_SPEED_10_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 208 supported |= SUPPORTED_10baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 209
a493f74ade8fe6 zhenpengzheng 2021-07-13 210 /* default advertised speed if phy.autoneg_advertised isn't set */
a493f74ade8fe6 zhenpengzheng 2021-07-13 211 advertising = supported;
a493f74ade8fe6 zhenpengzheng 2021-07-13 212
a493f74ade8fe6 zhenpengzheng 2021-07-13 213 /* set the advertised speeds */
a493f74ade8fe6 zhenpengzheng 2021-07-13 214 if (hw->phy.autoneg_advertised) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 215 if (hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_100_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 216 advertising |= ADVERTISED_100baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 217 if (hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_10GB_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 218 advertising |= (supported & ADVERTISED_MASK_10G);
a493f74ade8fe6 zhenpengzheng 2021-07-13 219 if (hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_1GB_FULL) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 220 if (supported & SUPPORTED_1000baseKX_Full)
a493f74ade8fe6 zhenpengzheng 2021-07-13 221 advertising |= ADVERTISED_1000baseKX_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 222 else
a493f74ade8fe6 zhenpengzheng 2021-07-13 223 advertising |= ADVERTISED_1000baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 224 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 225 if (hw->phy.autoneg_advertised & TXGBE_LINK_SPEED_10_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 226 advertising |= ADVERTISED_10baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 227 } else {
a493f74ade8fe6 zhenpengzheng 2021-07-13 228 /* default modes in case phy.autoneg_advertised isn't set */
a493f74ade8fe6 zhenpengzheng 2021-07-13 229 if (supported_link & TXGBE_LINK_SPEED_10GB_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 230 advertising |= ADVERTISED_10000baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 231 if (supported_link & TXGBE_LINK_SPEED_1GB_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 232 advertising |= ADVERTISED_1000baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 233 if (supported_link & TXGBE_LINK_SPEED_100_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 234 advertising |= ADVERTISED_100baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 235 if (hw->phy.multispeed_fiber && !autoneg) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 236 if (supported_link & TXGBE_LINK_SPEED_10GB_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 237 advertising = ADVERTISED_10000baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 238 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 239 if (supported_link & TXGBE_LINK_SPEED_10_FULL)
a493f74ade8fe6 zhenpengzheng 2021-07-13 240 advertising |= ADVERTISED_10baseT_Full;
a493f74ade8fe6 zhenpengzheng 2021-07-13 241 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 242
a493f74ade8fe6 zhenpengzheng 2021-07-13 243 if (autoneg) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 244 supported |= SUPPORTED_Autoneg;
a493f74ade8fe6 zhenpengzheng 2021-07-13 245 advertising |= ADVERTISED_Autoneg;
a493f74ade8fe6 zhenpengzheng 2021-07-13 246 cmd->base.autoneg = AUTONEG_ENABLE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 247 } else
a493f74ade8fe6 zhenpengzheng 2021-07-13 248 cmd->base.autoneg = AUTONEG_DISABLE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 249
a493f74ade8fe6 zhenpengzheng 2021-07-13 250 /* Determine the remaining settings based on the PHY type. */
a493f74ade8fe6 zhenpengzheng 2021-07-13 251 switch (adapter->hw.phy.type) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 252 case txgbe_phy_tn:
a493f74ade8fe6 zhenpengzheng 2021-07-13 253 case txgbe_phy_aq:
a493f74ade8fe6 zhenpengzheng 2021-07-13 254 case txgbe_phy_cu_unknown:
a493f74ade8fe6 zhenpengzheng 2021-07-13 255 supported |= SUPPORTED_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 256 advertising |= ADVERTISED_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 257 cmd->base.port = PORT_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 258 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 259 case txgbe_phy_qt:
a493f74ade8fe6 zhenpengzheng 2021-07-13 260 supported |= SUPPORTED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 261 advertising |= ADVERTISED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 262 cmd->base.port = PORT_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 263 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 264 case txgbe_phy_nl:
a493f74ade8fe6 zhenpengzheng 2021-07-13 265 case txgbe_phy_sfp_passive_tyco:
a493f74ade8fe6 zhenpengzheng 2021-07-13 266 case txgbe_phy_sfp_passive_unknown:
a493f74ade8fe6 zhenpengzheng 2021-07-13 267 case txgbe_phy_sfp_ftl:
a493f74ade8fe6 zhenpengzheng 2021-07-13 268 case txgbe_phy_sfp_avago:
a493f74ade8fe6 zhenpengzheng 2021-07-13 269 case txgbe_phy_sfp_intel:
a493f74ade8fe6 zhenpengzheng 2021-07-13 270 case txgbe_phy_sfp_unknown:
a493f74ade8fe6 zhenpengzheng 2021-07-13 271 switch (adapter->hw.phy.sfp_type) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 272 /* SFP+ devices, further checking needed */
a493f74ade8fe6 zhenpengzheng 2021-07-13 273 case txgbe_sfp_type_da_cu:
a493f74ade8fe6 zhenpengzheng 2021-07-13 274 case txgbe_sfp_type_da_cu_core0:
a493f74ade8fe6 zhenpengzheng 2021-07-13 275 case txgbe_sfp_type_da_cu_core1:
a493f74ade8fe6 zhenpengzheng 2021-07-13 276 supported |= SUPPORTED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 277 advertising |= ADVERTISED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 278 cmd->base.port = PORT_DA;
a493f74ade8fe6 zhenpengzheng 2021-07-13 279 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 280 case txgbe_sfp_type_sr:
a493f74ade8fe6 zhenpengzheng 2021-07-13 281 case txgbe_sfp_type_lr:
a493f74ade8fe6 zhenpengzheng 2021-07-13 282 case txgbe_sfp_type_srlr_core0:
a493f74ade8fe6 zhenpengzheng 2021-07-13 283 case txgbe_sfp_type_srlr_core1:
a493f74ade8fe6 zhenpengzheng 2021-07-13 284 case txgbe_sfp_type_1g_sx_core0:
a493f74ade8fe6 zhenpengzheng 2021-07-13 285 case txgbe_sfp_type_1g_sx_core1:
a493f74ade8fe6 zhenpengzheng 2021-07-13 286 case txgbe_sfp_type_1g_lx_core0:
a493f74ade8fe6 zhenpengzheng 2021-07-13 287 case txgbe_sfp_type_1g_lx_core1:
a493f74ade8fe6 zhenpengzheng 2021-07-13 288 supported |= SUPPORTED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 289 advertising |= ADVERTISED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 290 cmd->base.port = PORT_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 291 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 292 case txgbe_sfp_type_not_present:
a493f74ade8fe6 zhenpengzheng 2021-07-13 293 supported |= SUPPORTED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 294 advertising |= ADVERTISED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 295 cmd->base.port = PORT_NONE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 296 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 297 case txgbe_sfp_type_1g_cu_core0:
a493f74ade8fe6 zhenpengzheng 2021-07-13 298 case txgbe_sfp_type_1g_cu_core1:
a493f74ade8fe6 zhenpengzheng 2021-07-13 299 supported |= SUPPORTED_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 300 advertising |= ADVERTISED_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 301 cmd->base.port = PORT_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 302 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 303 case txgbe_sfp_type_unknown:
a493f74ade8fe6 zhenpengzheng 2021-07-13 304 default:
a493f74ade8fe6 zhenpengzheng 2021-07-13 305 supported |= SUPPORTED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 306 advertising |= ADVERTISED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 307 cmd->base.port = PORT_OTHER;
a493f74ade8fe6 zhenpengzheng 2021-07-13 308 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 309 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 310 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 311 case txgbe_phy_xaui:
a493f74ade8fe6 zhenpengzheng 2021-07-13 312 supported |= SUPPORTED_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 313 advertising |= ADVERTISED_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 314 cmd->base.port = PORT_TP;
a493f74ade8fe6 zhenpengzheng 2021-07-13 315 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 316 case txgbe_phy_unknown:
a493f74ade8fe6 zhenpengzheng 2021-07-13 317 case txgbe_phy_generic:
a493f74ade8fe6 zhenpengzheng 2021-07-13 318 case txgbe_phy_sfp_unsupported:
a493f74ade8fe6 zhenpengzheng 2021-07-13 319 default:
a493f74ade8fe6 zhenpengzheng 2021-07-13 320 supported |= SUPPORTED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 321 advertising |= ADVERTISED_FIBRE;
a493f74ade8fe6 zhenpengzheng 2021-07-13 322 cmd->base.port = PORT_OTHER;
a493f74ade8fe6 zhenpengzheng 2021-07-13 323 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 324 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 325
a493f74ade8fe6 zhenpengzheng 2021-07-13 326 if (!in_interrupt()) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 327 TCALL(hw, mac.ops.check_link, &link_speed, &link_up, false);
a493f74ade8fe6 zhenpengzheng 2021-07-13 328 } else {
a493f74ade8fe6 zhenpengzheng 2021-07-13 329 /*
a493f74ade8fe6 zhenpengzheng 2021-07-13 330 * this case is a special workaround for RHEL5 bonding
a493f74ade8fe6 zhenpengzheng 2021-07-13 331 * that calls this routine from interrupt context
a493f74ade8fe6 zhenpengzheng 2021-07-13 332 */
a493f74ade8fe6 zhenpengzheng 2021-07-13 333 link_speed = adapter->link_speed;
a493f74ade8fe6 zhenpengzheng 2021-07-13 334 link_up = adapter->link_up;
a493f74ade8fe6 zhenpengzheng 2021-07-13 335 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 336
a493f74ade8fe6 zhenpengzheng 2021-07-13 337 supported |= SUPPORTED_Pause;
a493f74ade8fe6 zhenpengzheng 2021-07-13 338
a493f74ade8fe6 zhenpengzheng 2021-07-13 339 switch (hw->fc.requested_mode) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 340 case txgbe_fc_full:
a493f74ade8fe6 zhenpengzheng 2021-07-13 341 advertising |= ADVERTISED_Pause;
a493f74ade8fe6 zhenpengzheng 2021-07-13 342 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 343 case txgbe_fc_rx_pause:
a493f74ade8fe6 zhenpengzheng 2021-07-13 344 advertising |= ADVERTISED_Pause |
a493f74ade8fe6 zhenpengzheng 2021-07-13 345 ADVERTISED_Asym_Pause;
a493f74ade8fe6 zhenpengzheng 2021-07-13 346 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 347 case txgbe_fc_tx_pause:
a493f74ade8fe6 zhenpengzheng 2021-07-13 348 advertising |= ADVERTISED_Asym_Pause;
a493f74ade8fe6 zhenpengzheng 2021-07-13 349 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 350 default:
a493f74ade8fe6 zhenpengzheng 2021-07-13 351 advertising &= ~(ADVERTISED_Pause |
a493f74ade8fe6 zhenpengzheng 2021-07-13 352 ADVERTISED_Asym_Pause);
a493f74ade8fe6 zhenpengzheng 2021-07-13 353 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 354
a493f74ade8fe6 zhenpengzheng 2021-07-13 355 if (link_up) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 356 switch (link_speed) {
a493f74ade8fe6 zhenpengzheng 2021-07-13 357 case TXGBE_LINK_SPEED_10GB_FULL:
a493f74ade8fe6 zhenpengzheng 2021-07-13 358 cmd->base.speed = SPEED_10000;
a493f74ade8fe6 zhenpengzheng 2021-07-13 359 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 360 case TXGBE_LINK_SPEED_1GB_FULL:
a493f74ade8fe6 zhenpengzheng 2021-07-13 361 cmd->base.speed = SPEED_1000;
a493f74ade8fe6 zhenpengzheng 2021-07-13 362 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 363 case TXGBE_LINK_SPEED_100_FULL:
a493f74ade8fe6 zhenpengzheng 2021-07-13 364 cmd->base.speed = SPEED_100;
a493f74ade8fe6 zhenpengzheng 2021-07-13 365 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 366 case TXGBE_LINK_SPEED_10_FULL:
a493f74ade8fe6 zhenpengzheng 2021-07-13 367 cmd->base.speed = SPEED_10;
a493f74ade8fe6 zhenpengzheng 2021-07-13 368 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 369 default:
a493f74ade8fe6 zhenpengzheng 2021-07-13 370 break;
a493f74ade8fe6 zhenpengzheng 2021-07-13 371 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 372 cmd->base.duplex = DUPLEX_FULL;
a493f74ade8fe6 zhenpengzheng 2021-07-13 373 } else {
a493f74ade8fe6 zhenpengzheng 2021-07-13 374 cmd->base.speed = -1;
a493f74ade8fe6 zhenpengzheng 2021-07-13 375 cmd->base.duplex = -1;
a493f74ade8fe6 zhenpengzheng 2021-07-13 376 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 377
a493f74ade8fe6 zhenpengzheng 2021-07-13 378 ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.supported,
a493f74ade8fe6 zhenpengzheng 2021-07-13 379 supported);
a493f74ade8fe6 zhenpengzheng 2021-07-13 380 ethtool_convert_legacy_u32_to_link_mode(cmd->link_modes.advertising,
a493f74ade8fe6 zhenpengzheng 2021-07-13 381 advertising);
a493f74ade8fe6 zhenpengzheng 2021-07-13 382 return 0;
a493f74ade8fe6 zhenpengzheng 2021-07-13 383 }
a493f74ade8fe6 zhenpengzheng 2021-07-13 384
:::::: The code at line 177 was first introduced by commit
:::::: a493f74ade8fe69f3446a65ddf7627fdf34c183c net: txgbe: Add support for Netswift 10G NIC
:::::: TO: zhenpengzheng <zhenpengzheng(a)net-swift.com>
:::::: CC: Zheng Zengkai <zhengzengkai(a)huawei.com>
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
1
0