mailweb.openeuler.org
Manage this list

Keyboard Shortcuts

Thread View

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

Kernel

Threads by month
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • 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
kernel@openeuler.org

  • 50 participants
  • 22104 discussions
[PATCH OLK-6.6] erofs: avoid infinite loops due to corrupted subpage compact indexes
by Zizhi Wo 22 Dec '25

22 Dec '25
From: Gao Xiang <hsiangkao(a)linux.alibaba.com> stable inclusion from stable-v6.17.6 commit 8675447a8794983f2b7e694b378112772c17635e category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IDDF3Q CVE: CVE-2025-68251 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit e13d315ae077bb7c3c6027cc292401bc0f4ec683 ] Robert reported an infinite loop observed by two crafted images. The root cause is that `clusterofs` can be larger than `lclustersize` for !NONHEAD `lclusters` in corrupted subpage compact indexes, e.g.: blocksize = lclustersize = 512 lcn = 6 clusterofs = 515 Move the corresponding check for full compress indexes to `z_erofs_load_lcluster_from_disk()` to also cover subpage compact compress indexes. It also fixes the position of `m->type >= Z_EROFS_LCLUSTER_TYPE_MAX` check, since it should be placed right after `z_erofs_load_{compact,full}_lcluster()`. Fixes: 8d2517aaeea3 ("erofs: fix up compacted indexes for block size < 4096") Fixes: 1a5223c182fd ("erofs: do sanity check on m->type in z_erofs_load_compact_lcluster()") Reported-by: Robert Morris <rtm(a)csail.mit.edu> Closes: https://lore.kernel.org/r/35167.1760645886@localhost Reviewed-by: Hongbo Li <lihongbo22(a)huawei.com> Signed-off-by: Gao Xiang <hsiangkao(a)linux.alibaba.com> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Conflicts: fs/erofs/zmap.c [1. z_erofs_load_full_lcluster() function conflicts due to commit: d69189428d50 ("erofs: clean up z_erofs_load_full_lcluster()"); 2. z_erofs_load_lcluster_from_disk() function conflicts due to commit: 1a5223c182fd ("erofs: do sanity check on m->type in z_erofs_load_compact_lcluster()"); 3. "z_lclusterbits" -> "z_logical_clusterbits" due to commit: efb2aef569b3 ("erofs: add encoded extent on-disk definition"); Both are not affect this patch.] Signed-off-by: Zizhi Wo <wozizhi(a)huawei.com> --- fs/erofs/zmap.c | 29 ++++++++++++++++++----------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/fs/erofs/zmap.c b/fs/erofs/zmap.c index 76566c2cbf63..0603ccd00b3c 100644 --- a/fs/erofs/zmap.c +++ b/fs/erofs/zmap.c @@ -67,10 +67,6 @@ static int z_erofs_load_full_lcluster(struct z_erofs_maprecorder *m, if (advise & Z_EROFS_LI_PARTIAL_REF) m->partialref = true; m->clusterofs = le16_to_cpu(di->di_clusterofs); - if (m->clusterofs >= 1 << vi->z_logical_clusterbits) { - DBG_BUGON(1); - return -EFSCORRUPTED; - } m->pblk = le32_to_cpu(di->di_u.blkaddr); break; default: @@ -276,14 +272,25 @@ static int z_erofs_load_compact_lcluster(struct z_erofs_maprecorder *m, static int z_erofs_load_lcluster_from_disk(struct z_erofs_maprecorder *m, unsigned int lcn, bool lookahead) { - switch (EROFS_I(m->inode)->datalayout) { - case EROFS_INODE_COMPRESSED_FULL: - return z_erofs_load_full_lcluster(m, lcn); - case EROFS_INODE_COMPRESSED_COMPACT: - return z_erofs_load_compact_lcluster(m, lcn, lookahead); - default: - return -EINVAL; + struct erofs_inode *vi = EROFS_I(m->inode); + int err; + + if (vi->datalayout == EROFS_INODE_COMPRESSED_COMPACT) { + err = z_erofs_load_compact_lcluster(m, lcn, lookahead); + } else { + DBG_BUGON(vi->datalayout != EROFS_INODE_COMPRESSED_FULL); + err = z_erofs_load_full_lcluster(m, lcn); } + if (err) + return err; + + if (m->type != Z_EROFS_LCLUSTER_TYPE_NONHEAD && + m->clusterofs >= (1 << vi->z_logical_clusterbits)) { + DBG_BUGON(1); + return -EFSCORRUPTED; + } + + return 0; } static int z_erofs_extent_lookback(struct z_erofs_maprecorder *m, -- 2.39.2
1 0
0 0
[PATCH OLK-6.6] ftrace: Fix softlockup in ftrace_module_enable
by Tengda Wu 22 Dec '25

22 Dec '25
From: Vladimir Riabchun <ferr.lambarginio(a)gmail.com> stable inclusion from stable-v6.6.119 commit e81e6d6d99b16dae11adbeda5c996317942a940c category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/IDDEWE CVE: CVE-2025-68173 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id… -------------------------------- [ Upstream commit 4099b98203d6b33d990586542fa5beee408032a3 ] A soft lockup was observed when loading amdgpu module. If a module has a lot of tracable functions, multiple calls to kallsyms_lookup can spend too much time in RCU critical section and with disabled preemption, causing kernel panic. This is the same issue that was fixed in commit d0b24b4e91fc ("ftrace: Prevent RCU stall on PREEMPT_VOLUNTARY kernels") and commit 42ea22e754ba ("ftrace: Add cond_resched() to ftrace_graph_set_hash()"). Fix it the same way by adding cond_resched() in ftrace_module_enable. Link: https://lore.kernel.org/aMQD9_lxYmphT-up@vova-pc Signed-off-by: Vladimir Riabchun <ferr.lambarginio(a)gmail.com> Signed-off-by: Steven Rostedt (Google) <rostedt(a)goodmis.org> Signed-off-by: Sasha Levin <sashal(a)kernel.org> Signed-off-by: Tengda Wu <wutengda2(a)huawei.com> --- kernel/trace/ftrace.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 15785a729a0c..398992597685 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -6873,6 +6873,8 @@ void ftrace_module_enable(struct module *mod) if (!within_module(rec->ip, mod)) break; + cond_resched(); + /* Weak functions should still be ignored */ if (!test_for_valid_rec(rec)) { /* Clear all other flags. Should not be enabled anyway */ -- 2.34.1
1 0
0 0
[openeuler:OLK-5.10 3420/3420] drivers/cpufreq/intel_pstate.c:1473:6: sparse: sparse: symbol 'notify_hwp_interrupt' was not declared. Should it be static?
by kernel test robot 22 Dec '25

22 Dec '25
tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 1588d318a9e388d05b6cf5e2a63134c8beb6a355 commit: e217d5958ee378eb304fb0b4eb6fcb551e555842 [3420/3420] cpufreq: intel_pstate: Process HWP Guaranteed change notification config: x86_64-randconfig-123-20251218 (https://download.01.org/0day-ci/archive/20251222/202512220826.pYRgbdJv-lkp@…) compiler: gcc-14 (Debian 14.2.0-19) 14.2.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512220826.pYRgbdJv-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/202512220826.pYRgbdJv-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/cpufreq/intel_pstate.c:1473:6: sparse: sparse: symbol 'notify_hwp_interrupt' was not declared. Should it be static? vim +/notify_hwp_interrupt +1473 drivers/cpufreq/intel_pstate.c 1472 > 1473 void notify_hwp_interrupt(void) 1474 { 1475 unsigned int this_cpu = smp_processor_id(); 1476 struct cpudata *cpudata; 1477 unsigned long flags; 1478 u64 value; 1479 1480 if (!READ_ONCE(hwp_active) || !boot_cpu_has(X86_FEATURE_HWP_NOTIFY)) 1481 return; 1482 1483 rdmsrl_safe(MSR_HWP_STATUS, &value); 1484 if (!(value & 0x01)) 1485 return; 1486 1487 spin_lock_irqsave(&hwp_notify_lock, flags); 1488 1489 if (!cpumask_test_cpu(this_cpu, &hwp_intr_enable_mask)) 1490 goto ack_intr; 1491 1492 /* 1493 * Currently we never free all_cpu_data. And we can't reach here 1494 * without this allocated. But for safety for future changes, added 1495 * check. 1496 */ 1497 if (unlikely(!READ_ONCE(all_cpu_data))) 1498 goto ack_intr; 1499 1500 /* 1501 * The free is done during cleanup, when cpufreq registry is failed. 1502 * We wouldn't be here if it fails on init or switch status. But for 1503 * future changes, added check. 1504 */ 1505 cpudata = READ_ONCE(all_cpu_data[this_cpu]); 1506 if (unlikely(!cpudata)) 1507 goto ack_intr; 1508 1509 schedule_delayed_work(&cpudata->hwp_notify_work, msecs_to_jiffies(10)); 1510 1511 spin_unlock_irqrestore(&hwp_notify_lock, flags); 1512 1513 return; 1514 1515 ack_intr: 1516 wrmsrl_safe(MSR_HWP_STATUS, 0); 1517 spin_unlock_irqrestore(&hwp_notify_lock, flags); 1518 } 1519 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-5.10 3415/3415] arch/arm64/kernel/fpsimd.c:158:12: warning: 'get_sve_default_vl' defined but not used
by kernel test robot 22 Dec '25

22 Dec '25
Hi Mark, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 1588d318a9e388d05b6cf5e2a63134c8beb6a355 commit: bf04fdf1fcc0040e6c81b413cdae84c0eb9212b9 [3415/3415] arm64/sve: Track vector lengths for tasks in an array config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20251222/202512220837.hZSDu6Y4-lkp@…) compiler: aarch64-linux-gcc (GCC) 15.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512220837.hZSDu6Y4-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/202512220837.hZSDu6Y4-lkp@intel.com/ All warnings (new ones prefixed by >>): >> arch/arm64/kernel/fpsimd.c:158:12: warning: 'get_sve_default_vl' defined but not used [-Wunused-function] 158 | static int get_sve_default_vl(void) | ^~~~~~~~~~~~~~~~~~ vim +/get_sve_default_vl +158 arch/arm64/kernel/fpsimd.c 1e570f512cbdc5 Dave Martin 2020-06-10 157 1e570f512cbdc5 Dave Martin 2020-06-10 @158 static int get_sve_default_vl(void) 1e570f512cbdc5 Dave Martin 2020-06-10 159 { 68da302c8ae303 Mark Brown 2023-11-28 160 return get_default_vl(ARM64_VEC_SVE); 1e570f512cbdc5 Dave Martin 2020-06-10 161 } 79ab047c75d6a9 Dave Martin 2017-10-31 162 :::::: The code at line 158 was first introduced by commit :::::: 1e570f512cbdc5e9e401ba640d9827985c1bea1e arm64/sve: Eliminate data races on sve_default_vl :::::: TO: Dave Martin <Dave.Martin(a)arm.com> :::::: CC: Will Deacon <will(a)kernel.org> -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-5.10 3415/3415] arch/arm64/mm/init.c:730:6: warning: no previous prototype for 'ascend_enable_all_features'
by kernel test robot 22 Dec '25

22 Dec '25
Hi Wang, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 1588d318a9e388d05b6cf5e2a63134c8beb6a355 commit: 66ae8ddda388386daea0623a65ea2ac85c24ca00 [3415/3415] ascend/arm64: Add ascend_enable_all kernel parameter config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20251222/202512220606.726hmC01-lkp@…) compiler: aarch64-linux-gcc (GCC) 15.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512220606.726hmC01-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/202512220606.726hmC01-lkp@intel.com/ All warnings (new ones prefixed by >>): >> arch/arm64/mm/init.c:730:6: warning: no previous prototype for 'ascend_enable_all_features' [-Wmissing-prototypes] 730 | void ascend_enable_all_features(void) | ^~~~~~~~~~~~~~~~~~~~~~~~~~ vim +/ascend_enable_all_features +730 arch/arm64/mm/init.c 729 > 730 void ascend_enable_all_features(void) 731 { 732 if (IS_ENABLED(CONFIG_ASCEND_DVPP_MMAP)) 733 enable_mmap_dvpp = 1; 734 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-5.10 3415/3415] arch/arm64/kernel/ipi_nmi.c:40:9: error: implicit declaration of function 'printk_safe_exit'; did you mean 'printk_nmi_exit'?
by kernel test robot 22 Dec '25

22 Dec '25
Hi Li, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git OLK-5.10 head: 1588d318a9e388d05b6cf5e2a63134c8beb6a355 commit: f86d165bfe5f6248743774bb07af0bd7cff12443 [3415/3415] arm64: Add non nmi ipi backtrace support config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20251222/202512220254.DKUPaC7y-lkp@…) compiler: aarch64-linux-gcc (GCC) 15.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512220254.DKUPaC7y-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/202512220254.DKUPaC7y-lkp@intel.com/ All errors (new ones prefixed by >>): arch/arm64/kernel/ipi_nmi.c: In function 'ipi_cpu_backtrace': arch/arm64/kernel/ipi_nmi.c:38:9: error: implicit declaration of function 'printk_safe_enter'; did you mean 'printk_nmi_enter'? [-Werror=implicit-function-declaration] 38 | printk_safe_enter(); | ^~~~~~~~~~~~~~~~~ | printk_nmi_enter >> arch/arm64/kernel/ipi_nmi.c:40:9: error: implicit declaration of function 'printk_safe_exit'; did you mean 'printk_nmi_exit'? [-Werror=implicit-function-declaration] 40 | printk_safe_exit(); | ^~~~~~~~~~~~~~~~ | printk_nmi_exit cc1: some warnings being treated as errors vim +40 arch/arm64/kernel/ipi_nmi.c 35 36 static void ipi_cpu_backtrace(void *info) 37 { > 38 printk_safe_enter(); 39 nmi_cpu_backtrace(get_irq_regs()); > 40 printk_safe_exit(); 41 } 42 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:OLK-6.6 3557/3557] drivers/arm/mm_monitor/spe-decoder/arm-spe-pkt-decoder.c:43:35: sparse: sparse: cast to restricted __le16
by kernel test robot 22 Dec '25

22 Dec '25
tree: https://gitee.com/openeuler/kernel.git OLK-6.6 head: 04473ee9ed912a16fff0d8846ad565bbf3d63c77 commit: b8a759002c48f227d03084fb6b6213a3beaa44e3 [3557/3557] mm_monitor/mm_spe: Introduce standalone SPE profiling framework config: arm64-randconfig-r132-20251218 (https://download.01.org/0day-ci/archive/20251222/202512220002.7l3mjSAD-lkp@…) compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261) reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251222/202512220002.7l3mjSAD-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/202512220002.7l3mjSAD-lkp@intel.com/ sparse warnings: (new ones prefixed by >>) >> drivers/arm/mm_monitor/spe-decoder/arm-spe-pkt-decoder.c:43:35: sparse: sparse: cast to restricted __le16 >> drivers/arm/mm_monitor/spe-decoder/arm-spe-pkt-decoder.c:46:35: sparse: sparse: cast to restricted __le32 >> drivers/arm/mm_monitor/spe-decoder/arm-spe-pkt-decoder.c:49:35: sparse: sparse: cast to restricted __le64 vim +43 drivers/arm/mm_monitor/spe-decoder/arm-spe-pkt-decoder.c 26 27 static int arm_spe_get_payload(const unsigned char *buf, size_t len, 28 unsigned char ext_hdr, 29 struct arm_spe_pkt *packet) 30 { 31 size_t payload_len = arm_spe_payload_len(buf[ext_hdr]); 32 33 if (len < 1 + ext_hdr + payload_len) 34 return ARM_SPE_NEED_MORE_BYTES; 35 36 buf += 1 + ext_hdr; 37 38 switch (payload_len) { 39 case 1: 40 packet->payload = *(uint8_t *)buf; 41 break; 42 case 2: > 43 packet->payload = le16_to_cpu(*(uint16_t *)buf); 44 break; 45 case 4: > 46 packet->payload = le32_to_cpu(*(uint32_t *)buf); 47 break; 48 case 8: > 49 packet->payload = le64_to_cpu(*(uint64_t *)buf); 50 break; 51 default: 52 return ARM_SPE_BAD_PACKET; 53 } 54 55 return 1 + ext_hdr + payload_len; 56 } 57 -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[openeuler:openEuler-1.0-LTS 1942/1942] arch/arm64/kernel/vdso/gettimeofday.c:268:13: warning: no previous prototype for '__kernel_clock_gettime'
by kernel test robot 21 Dec '25

21 Dec '25
Hi Andrew, FYI, the error/warning still remains. tree: https://gitee.com/openeuler/kernel.git openEuler-1.0-LTS head: 4e9c55920995d70b3e88b60c69753df54b03fdf4 commit: f43f336031282e8ea7e5f7f887c5a6ff7b9c99b0 [1942/1942] arm64:vdso: Rewrite gettimeofday into C. config: arm64-allnoconfig (https://download.01.org/0day-ci/archive/20251221/202512212208.f4EG9uym-lkp@…) compiler: aarch64-linux-gcc (GCC) 15.1.0 reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251221/202512212208.f4EG9uym-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/202512212208.f4EG9uym-lkp@intel.com/ Note: functions only called from assembly code should be annotated with the asmlinkage attribute All warnings (new ones prefixed by >>): >> arch/arm64/kernel/vdso/gettimeofday.c:268:13: warning: no previous prototype for '__kernel_clock_gettime' [-Wmissing-prototypes] 268 | notrace int __kernel_clock_gettime(clockid_t clock, struct timespec *ts) | ^~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/vdso/gettimeofday.c:302:13: warning: no previous prototype for '__kernel_gettimeofday' [-Wmissing-prototypes] 302 | notrace int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz) | ^~~~~~~~~~~~~~~~~~~~~ >> arch/arm64/kernel/vdso/gettimeofday.c:325:5: warning: no previous prototype for '__kernel_clock_getres' [-Wmissing-prototypes] 325 | int __kernel_clock_getres(clockid_t clock_id, struct timespec *res) | ^~~~~~~~~~~~~~~~~~~~~ -- >> arch/arm64/kernel/vdso/gettimeofday.c:268:13: warning: no previous prototype for '__kernel_clock_gettime' [-Wmissing-prototypes] 268 | notrace int __kernel_clock_gettime(clockid_t clock, struct timespec *ts) | ^~~~~~~~~~~~~~~~~~~~~~ arch/arm64/kernel/vdso/gettimeofday.c:302:13: warning: no previous prototype for '__kernel_gettimeofday' [-Wmissing-prototypes] 302 | notrace int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz) | ^~~~~~~~~~~~~~~~~~~~~ >> arch/arm64/kernel/vdso/gettimeofday.c:325:5: warning: no previous prototype for '__kernel_clock_getres' [-Wmissing-prototypes] 325 | int __kernel_clock_getres(clockid_t clock_id, struct timespec *res) | ^~~~~~~~~~~~~~~~~~~~~ vim +/__kernel_clock_gettime +268 arch/arm64/kernel/vdso/gettimeofday.c 267 > 268 notrace int __kernel_clock_gettime(clockid_t clock, struct timespec *ts) 269 { 270 const struct vdso_data *vd = &_vdso_data; 271 272 switch (clock) { 273 case CLOCK_REALTIME: 274 if (do_realtime(vd, ts)) 275 goto fallback; 276 break; 277 case CLOCK_MONOTONIC: 278 if (do_monotonic(vd, ts)) 279 goto fallback; 280 break; 281 case CLOCK_MONOTONIC_RAW: 282 if (do_monotonic_raw(vd, ts)) 283 goto fallback; 284 break; 285 case CLOCK_REALTIME_COARSE: 286 do_realtime_coarse(vd, ts); 287 break; 288 case CLOCK_MONOTONIC_COARSE: 289 do_monotonic_coarse(vd, ts); 290 break; 291 default: 292 goto fallback; 293 } 294 295 return 0; 296 fallback: 297 return clock_gettime_fallback(clock, ts); 298 } 299 300 301 302 notrace int __kernel_gettimeofday(struct timeval *tv, struct timezone *tz) 303 { 304 const struct vdso_data *vd = &_vdso_data; 305 306 if (likely(tv != NULL)) { 307 struct timespec ts; 308 309 if (do_realtime(vd, &ts)) 310 return gettimeofday_fallback(tv, tz); 311 312 tv->tv_sec = ts.tv_sec; 313 tv->tv_usec = ts.tv_nsec / 1000; 314 } 315 316 if (unlikely(tz != NULL)) { 317 tz->tz_minuteswest = vd->tz_minuteswest; 318 tz->tz_dsttime = vd->tz_dsttime; 319 } 320 321 return 0; 322 } 323 324 > 325 int __kernel_clock_getres(clockid_t clock_id, struct timespec *res) -- 0-DAY CI Kernel Test Service https://github.com/intel/lkp-tests/wiki
1 0
0 0
[PATCH OLK-5.10] scsi/hiraid: Support New Raid feature
by LinKun 21 Dec '25

21 Dec '25
From: 岳智超 <yuezhichao1(a)h-partners.com> driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IDDE3S?from=project-issue CVE: NA -------------------------------- Add thread irq for io queue Signed-off-by: 岳智超 <yuezhichao1(a)h-partners.com> --- drivers/scsi/hisi_raid/hiraid.h | 1 + drivers/scsi/hisi_raid/hiraid_main.c | 60 ++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/hisi_raid/hiraid.h b/drivers/scsi/hisi_raid/hiraid.h index 04b2e25..b786066 100644 --- a/drivers/scsi/hisi_raid/hiraid.h +++ b/drivers/scsi/hisi_raid/hiraid.h @@ -686,6 +686,7 @@ struct hiraid_queue { atomic_t inflight; void *sense_buffer_virt; dma_addr_t sense_buffer_phy; + s32 pci_irq; struct dma_pool *prp_small_pool; }; diff --git a/drivers/scsi/hisi_raid/hiraid_main.c b/drivers/scsi/hisi_raid/hiraid_main.c index 2f33339..ee5cb10 100644 --- a/drivers/scsi/hisi_raid/hiraid_main.c +++ b/drivers/scsi/hisi_raid/hiraid_main.c @@ -107,6 +107,13 @@ static u32 log_debug_switch; module_param(log_debug_switch, uint, 0644); MODULE_PARM_DESC(log_debug_switch, "set log state, default zero for switch off"); +static bool threaded_irq = true; +module_param(threaded_irq, bool, 0444); +MODULE_PARM_DESC(threaded_irq, "use threaded irq for io queue, default on"); + +static u32 poll_delay_min = 9; +static u32 poll_delay_max = 19; + static int extra_pool_num_set(const char *val, const struct kernel_param *kp) { u8 n = 0; @@ -152,7 +159,7 @@ static struct workqueue_struct *work_queue; __func__, ##__VA_ARGS__); \ } while (0) -#define HIRAID_DRV_VERSION "1.1.0.1" +#define HIRAID_DRV_VERSION "1.1.0.2" #define ADMIN_TIMEOUT (admin_tmout * HZ) #define USRCMD_TIMEOUT (180 * HZ) @@ -1305,6 +1312,7 @@ static int hiraid_alloc_queue(struct hiraid_dev *hdev, u16 qid, u16 depth) hiraidq->q_depth = depth; hiraidq->qid = qid; hiraidq->cq_vector = -1; + hiraidq->pci_irq = -1; hdev->queue_count++; return 0; @@ -1631,6 +1639,39 @@ static irqreturn_t hiraid_handle_irq(int irq, void *data) return ret; } +static irqreturn_t hiraid_io_poll(int irq, void *data) +{ + struct hiraid_queue *hiraidq = data; + irqreturn_t ret = IRQ_NONE; + u16 start, end; + + do { + spin_lock(&hiraidq->cq_lock); + hiraid_process_cq(hiraidq, &start, &end, -1); + hiraidq->last_cq_head = hiraidq->cq_head; + spin_unlock(&hiraidq->cq_lock); + + if (start != end) { + hiraid_complete_cqes(hiraidq, start, end); + ret = IRQ_HANDLED; + } + usleep_range(poll_delay_min, poll_delay_max); + } while (start != end); + enable_irq(hiraidq->pci_irq); + return ret; +} + +static irqreturn_t hiraid_io_irq(int irq, void *data) +{ + struct hiraid_queue *q = data; + + if (hiraid_cqe_pending(q)) { + disable_irq_nosync(q->pci_irq); + return IRQ_WAKE_THREAD; + } + return IRQ_NONE; +} + static int hiraid_setup_admin_queue(struct hiraid_dev *hdev) { struct hiraid_queue *adminq = &hdev->queues[0]; @@ -1666,9 +1707,11 @@ static int hiraid_setup_admin_queue(struct hiraid_dev *hdev) adminq, "hiraid%d_q%d", hdev->instance, adminq->qid); if (ret) { adminq->cq_vector = -1; + adminq->pci_irq = -1; return ret; } + adminq->pci_irq = pci_irq_vector(hdev->pdev, adminq->cq_vector); hiraid_init_queue(adminq, 0); dev_info(hdev->dev, "setup admin queue success, queuecount[%d] online[%d] pagesize[%d]\n", @@ -1937,14 +1980,23 @@ static int hiraid_create_queue(struct hiraid_queue *hiraidq, u16 qid) goto delete_cq; hiraidq->cq_vector = cq_vector; - ret = pci_request_irq(hdev->pdev, cq_vector, hiraid_handle_irq, NULL, - hiraidq, "hiraid%d_q%d", hdev->instance, qid); + + if (threaded_irq) + ret = pci_request_irq(hdev->pdev, cq_vector, hiraid_io_irq, + hiraid_io_poll, hiraidq, "hiraid%d_q%d", + hdev->instance, qid); + else + ret = pci_request_irq(hdev->pdev, cq_vector, hiraid_handle_irq, + NULL, hiraidq, "hiraid%d_q%d", + hdev->instance, qid); if (ret) { hiraidq->cq_vector = -1; + hiraidq->pci_irq = -1; dev_err(hdev->dev, "request queue[%d] irq failed\n", qid); goto delete_sq; } + hiraidq->pci_irq = pci_irq_vector(hdev->pdev, hiraidq->cq_vector); hiraid_init_queue(hiraidq, qid); return 0; @@ -2094,10 +2146,12 @@ static int hiraid_setup_io_queues(struct hiraid_dev *hdev) adminq, "hiraid%d_q%d", hdev->instance, adminq->qid); if (ret) { dev_err(hdev->dev, "request admin irq failed\n"); + adminq->pci_irq = -1; adminq->cq_vector = -1; return ret; } + adminq->pci_irq = pci_irq_vector(hdev->pdev, adminq->cq_vector); hdev->online_queues++; for (i = hdev->queue_count; i <= hdev->max_qid; i++) { -- 2.45.1.windows.1
2 1
0 0
[PATCH OLK-5.10] scsi/hiraid: Support New Raid feature
by LinKun 21 Dec '25

21 Dec '25
From: 岳智超 <yuezhichao1(a)h-partners.com> driver inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IDDE4S?from=project-issue CVE: NA -------------------------------- Add thread irq for io queue Signed-off-by: 岳智超 <yuezhichao1(a)h-partners.com> --- drivers/scsi/hisi_raid/hiraid.h | 1 + drivers/scsi/hisi_raid/hiraid_main.c | 60 ++++++++++++++++++++++++++-- 2 files changed, 58 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/hisi_raid/hiraid.h b/drivers/scsi/hisi_raid/hiraid.h index 04b2e25..b786066 100644 --- a/drivers/scsi/hisi_raid/hiraid.h +++ b/drivers/scsi/hisi_raid/hiraid.h @@ -686,6 +686,7 @@ struct hiraid_queue { atomic_t inflight; void *sense_buffer_virt; dma_addr_t sense_buffer_phy; + s32 pci_irq; struct dma_pool *prp_small_pool; }; diff --git a/drivers/scsi/hisi_raid/hiraid_main.c b/drivers/scsi/hisi_raid/hiraid_main.c index 2f33339..ee5cb10 100644 --- a/drivers/scsi/hisi_raid/hiraid_main.c +++ b/drivers/scsi/hisi_raid/hiraid_main.c @@ -107,6 +107,13 @@ static u32 log_debug_switch; module_param(log_debug_switch, uint, 0644); MODULE_PARM_DESC(log_debug_switch, "set log state, default zero for switch off"); +static bool threaded_irq = true; +module_param(threaded_irq, bool, 0444); +MODULE_PARM_DESC(threaded_irq, "use threaded irq for io queue, default on"); + +static u32 poll_delay_min = 9; +static u32 poll_delay_max = 19; + static int extra_pool_num_set(const char *val, const struct kernel_param *kp) { u8 n = 0; @@ -152,7 +159,7 @@ static struct workqueue_struct *work_queue; __func__, ##__VA_ARGS__); \ } while (0) -#define HIRAID_DRV_VERSION "1.1.0.1" +#define HIRAID_DRV_VERSION "1.1.0.2" #define ADMIN_TIMEOUT (admin_tmout * HZ) #define USRCMD_TIMEOUT (180 * HZ) @@ -1305,6 +1312,7 @@ static int hiraid_alloc_queue(struct hiraid_dev *hdev, u16 qid, u16 depth) hiraidq->q_depth = depth; hiraidq->qid = qid; hiraidq->cq_vector = -1; + hiraidq->pci_irq = -1; hdev->queue_count++; return 0; @@ -1631,6 +1639,39 @@ static irqreturn_t hiraid_handle_irq(int irq, void *data) return ret; } +static irqreturn_t hiraid_io_poll(int irq, void *data) +{ + struct hiraid_queue *hiraidq = data; + irqreturn_t ret = IRQ_NONE; + u16 start, end; + + do { + spin_lock(&hiraidq->cq_lock); + hiraid_process_cq(hiraidq, &start, &end, -1); + hiraidq->last_cq_head = hiraidq->cq_head; + spin_unlock(&hiraidq->cq_lock); + + if (start != end) { + hiraid_complete_cqes(hiraidq, start, end); + ret = IRQ_HANDLED; + } + usleep_range(poll_delay_min, poll_delay_max); + } while (start != end); + enable_irq(hiraidq->pci_irq); + return ret; +} + +static irqreturn_t hiraid_io_irq(int irq, void *data) +{ + struct hiraid_queue *q = data; + + if (hiraid_cqe_pending(q)) { + disable_irq_nosync(q->pci_irq); + return IRQ_WAKE_THREAD; + } + return IRQ_NONE; +} + static int hiraid_setup_admin_queue(struct hiraid_dev *hdev) { struct hiraid_queue *adminq = &hdev->queues[0]; @@ -1666,9 +1707,11 @@ static int hiraid_setup_admin_queue(struct hiraid_dev *hdev) adminq, "hiraid%d_q%d", hdev->instance, adminq->qid); if (ret) { adminq->cq_vector = -1; + adminq->pci_irq = -1; return ret; } + adminq->pci_irq = pci_irq_vector(hdev->pdev, adminq->cq_vector); hiraid_init_queue(adminq, 0); dev_info(hdev->dev, "setup admin queue success, queuecount[%d] online[%d] pagesize[%d]\n", @@ -1937,14 +1980,23 @@ static int hiraid_create_queue(struct hiraid_queue *hiraidq, u16 qid) goto delete_cq; hiraidq->cq_vector = cq_vector; - ret = pci_request_irq(hdev->pdev, cq_vector, hiraid_handle_irq, NULL, - hiraidq, "hiraid%d_q%d", hdev->instance, qid); + + if (threaded_irq) + ret = pci_request_irq(hdev->pdev, cq_vector, hiraid_io_irq, + hiraid_io_poll, hiraidq, "hiraid%d_q%d", + hdev->instance, qid); + else + ret = pci_request_irq(hdev->pdev, cq_vector, hiraid_handle_irq, + NULL, hiraidq, "hiraid%d_q%d", + hdev->instance, qid); if (ret) { hiraidq->cq_vector = -1; + hiraidq->pci_irq = -1; dev_err(hdev->dev, "request queue[%d] irq failed\n", qid); goto delete_sq; } + hiraidq->pci_irq = pci_irq_vector(hdev->pdev, hiraidq->cq_vector); hiraid_init_queue(hiraidq, qid); return 0; @@ -2094,10 +2146,12 @@ static int hiraid_setup_io_queues(struct hiraid_dev *hdev) adminq, "hiraid%d_q%d", hdev->instance, adminq->qid); if (ret) { dev_err(hdev->dev, "request admin irq failed\n"); + adminq->pci_irq = -1; adminq->cq_vector = -1; return ret; } + adminq->pci_irq = pci_irq_vector(hdev->pdev, adminq->cq_vector); hdev->online_queues++; for (i = hdev->queue_count; i <= hdev->max_qid; i++) { -- 2.45.1.windows.1
2 1
0 0
  • ← Newer
  • 1
  • 2
  • 3
  • 4
  • ...
  • 2211
  • Older →

HyperKitty Powered by HyperKitty