From 23fa18eaa71266feff7ba8d83022d9e1cc83c65a Mon Sep 17 00:00:00 2001 From: hc <hc@nodka.com> Date: Fri, 10 May 2024 07:42:03 +0000 Subject: [PATCH] disable pwm7 --- kernel/arch/powerpc/kernel/time.c | 60 ++++++++++++++++++------------------------------------------ 1 files changed, 18 insertions(+), 42 deletions(-) diff --git a/kernel/arch/powerpc/kernel/time.c b/kernel/arch/powerpc/kernel/time.c index 7e0a497..ba9b54d 100644 --- a/kernel/arch/powerpc/kernel/time.c +++ b/kernel/arch/powerpc/kernel/time.c @@ -312,11 +312,12 @@ return stime_scaled; } -static unsigned long vtime_delta(struct cpu_accounting_data *acct, +static unsigned long vtime_delta(struct task_struct *tsk, unsigned long *stime_scaled, unsigned long *steal_time) { unsigned long now, stime; + struct cpu_accounting_data *acct = get_accounting(tsk); WARN_ON_ONCE(!irqs_disabled()); @@ -331,30 +332,29 @@ return stime; } -static void vtime_delta_kernel(struct cpu_accounting_data *acct, - unsigned long *stime, unsigned long *stime_scaled) -{ - unsigned long steal_time; - - *stime = vtime_delta(acct, stime_scaled, &steal_time); - *stime -= min(*stime, steal_time); - acct->steal_time += steal_time; -} - void vtime_account_kernel(struct task_struct *tsk) { + unsigned long stime, stime_scaled, steal_time; struct cpu_accounting_data *acct = get_accounting(tsk); - unsigned long stime, stime_scaled; - vtime_delta_kernel(acct, &stime, &stime_scaled); + stime = vtime_delta(tsk, &stime_scaled, &steal_time); - if (tsk->flags & PF_VCPU) { + stime -= min(stime, steal_time); + acct->steal_time += steal_time; + + if ((tsk->flags & PF_VCPU) && !irq_count()) { acct->gtime += stime; #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME acct->utime_scaled += stime_scaled; #endif } else { - acct->stime += stime; + if (hardirq_count()) + acct->hardirq_time += stime; + else if (in_serving_softirq()) + acct->softirq_time += stime; + else + acct->stime += stime; + #ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME acct->stime_scaled += stime_scaled; #endif @@ -367,32 +367,8 @@ unsigned long stime, stime_scaled, steal_time; struct cpu_accounting_data *acct = get_accounting(tsk); - stime = vtime_delta(acct, &stime_scaled, &steal_time); + stime = vtime_delta(tsk, &stime_scaled, &steal_time); acct->idle_time += stime + steal_time; -} - -static void vtime_account_irq_field(struct cpu_accounting_data *acct, - unsigned long *field) -{ - unsigned long stime, stime_scaled; - - vtime_delta_kernel(acct, &stime, &stime_scaled); - *field += stime; -#ifdef CONFIG_ARCH_HAS_SCALED_CPUTIME - acct->stime_scaled += stime_scaled; -#endif -} - -void vtime_account_softirq(struct task_struct *tsk) -{ - struct cpu_accounting_data *acct = get_accounting(tsk); - vtime_account_irq_field(acct, &acct->softirq_time); -} - -void vtime_account_hardirq(struct task_struct *tsk) -{ - struct cpu_accounting_data *acct = get_accounting(tsk); - vtime_account_irq_field(acct, &acct->hardirq_time); } static void vtime_flush_scaled(struct task_struct *tsk, @@ -460,7 +436,7 @@ #define calc_cputime_factors() #endif -void __delay(unsigned long loops) +void __no_kcsan __delay(unsigned long loops) { unsigned long start; @@ -481,7 +457,7 @@ } EXPORT_SYMBOL(__delay); -void udelay(unsigned long usecs) +void __no_kcsan udelay(unsigned long usecs) { __delay(tb_ticks_per_usec * usecs); } -- Gitblit v1.6.2