[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2018-04-02 Thread Vladimir Marko
Upstream:
Linux 4.14: BAD
Linux 4.16: GOOD

I did not bisect to find out which CL fixed the bug.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/linux/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2017-01-14 Thread Vladimir Marko
I didn't try to send the patches upstream. I was hoping that someone who
already knows how to do that would pick it up.

I just searched the kernel bug database for this issue and found
https://bugzilla.kernel.org/show_bug.cgi?id=189291 . In comment #9, cthx
posted a link to this bug on 9 Dec, i.e. after I have already posted the
bisect results and patches. I guess people don't bother following links,
I'll have to post there directly.

** Bug watch added: Linux Kernel Bug Tracker #189291
   http://bugzilla.kernel.org/show_bug.cgi?id=189291

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-19 Thread Vladimir Marko
Sorry, I missed the request in comment #17 to add the tag kernel-bug-
exists-upstream. Done now.

** Tags added: kernel-bug-exists-upstream

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-08 Thread Vladimir Marko
** Changed in: linux (Ubuntu)
   Status: Incomplete => Confirmed

** Changed in: linux-lts-xenial (Ubuntu)
   Status: Incomplete => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-08 Thread Vladimir Marko
Both patches apply cleanly to the 4.9-rc8 but I cannot build the kernel
with the configuration /boot/config-4.9.0-040900rc8-generic on my laptop
without upgrading the compiler:

Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not
supported by compiler

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-08 Thread Vladimir Marko
Installed
linux-headers-4.9.0-040900rc8_4.9.0-040900rc8.201612051443_all.deb
linux-headers-4.9.0-040900rc8-generic_4.9.0-040900rc8.201612051443_amd64.deb
linux-image-4.9.0-040900rc8-generic_4.9.0-040900rc8.201612051443_amd64.deb
Laptop boots, bug still present:

$ uname -r
4.9.0-040900rc8-generic
$ cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_*_temp
105000
15900
15900
15900
15900
15900
$ cpufreq-info | grep -E 'policy|steps'
  available frequency steps: 1.60 GHz, 800 MHz
  current policy: frequency should be within 800 MHz and 800 MHz.
  available frequency steps: 1.60 GHz, 800 MHz
  current policy: frequency should be within 800 MHz and 800 MHz.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-07 Thread Vladimir Marko
This patches also apply cleanly to current master in
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
with 1 line offset.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-07 Thread Vladimir Marko
Attaching the "alternative" patch.

** Patch added: "alternative.patch"
   
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+attachment/4788864/+files/alternative.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-07 Thread Vladimir Marko
Looks like pasting the patches directly to the editor wasn't a good
idea. It messed up the whitespace. Attaching the "revert" patch.

** Patch added: "revert.patch"
   
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+attachment/4788863/+files/revert.patch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-12-07 Thread Vladimir Marko
The revert of the offending commit does not apply cleanly to the
Ubuntu-4.4.0-47.68 kernel. The closest we can get to a revert is this
patch:

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 64f233a..aec995c 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2523,7 +2523,6 @@ void __init setup_ioapic_dest(void)
const struct cpumask *mask;
struct irq_desc *desc;
struct irq_data *idata;
-   struct irq_chip *chip;
 
if (skip_ioapic_setup == 1)
return;
@@ -2538,7 +2537,6 @@ void __init setup_ioapic_dest(void)
continue;
 
desc = irq_to_desc(irq);
-   raw_spin_lock_irq(>lock);
idata = irq_desc_get_irq_data(desc);
 
/*
@@ -2549,11 +2547,7 @@ void __init setup_ioapic_dest(void)
else
mask = apic->target_cpus();
 
-   chip = irq_data_get_irq_chip(idata);
-   /* Might be lapic_chip for irq 0 */
-   if (chip->irq_set_affinity)
-   chip->irq_set_affinity(idata, mask, false);
-   raw_spin_unlock_irq(>lock);
+   irq_set_affinity(irq, mask);
}
 }
 #endif

I tried this and it works. Another option is this smaller patch:

diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index 64f233a..f185a1e 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2523,7 +2523,6 @@ void __init setup_ioapic_dest(void)
const struct cpumask *mask;
struct irq_desc *desc;
struct irq_data *idata;
-   struct irq_chip *chip;
 
if (skip_ioapic_setup == 1)
return;
@@ -2549,10 +2548,7 @@ void __init setup_ioapic_dest(void)
else
mask = apic->target_cpus();
 
-   chip = irq_data_get_irq_chip(idata);
-   /* Might be lapic_chip for irq 0 */
-   if (chip->irq_set_affinity)
-   chip->irq_set_affinity(idata, mask, false);
+   irq_set_affinity_locked(idata, mask, false);
raw_spin_unlock_irq(>lock);
}
 }

which essentially keeps the raw_spin_lock_irq()/raw_spin_unlock_irq()
rather than raw_spin_lock_irqsave()/raw_spin_unlock_irqrestore() used by
__irq_set_affinity() in kernel/irq/manage.c .

I tested both patches on top of Ubuntu-4.4.0-47.68 and they work.
They also apply cleanly to Ubuntu-4.2.0-42.49 but I didn't actually check that 
it builds/works.

I tried manually inlining the irq_set_affinity_locked() (which required
further inlining of some helper functions and providing a declaration of
irq_do_set_affinity()) and it still worked. However, forcing the "if
(irq_can_move_pcntxt())" path that immediately performs
"chip->irq_set_affinity(idata, mask, false)" exposes the bug.

This confirms what I expected after reading
https://lkml.org/lkml/2012/3/26/392 . Basically, when the hardware says
that you cannot do something right away, you really cannot. And the
offending commit just ignores this.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-11-29 Thread Vladimir Marko
3b806e2b94cad37a8809df7c86f7cfdcd3baa719 is the first bad commit
commit 3b806e2b94cad37a8809df7c86f7cfdcd3baa719
Author: Thomas Gleixner 
Date:   Mon Sep 14 12:00:55 2015 +0200

x86/ioapic: Force affinity setting in setup_ioapic_dest()

BugLink: http://bugs.launchpad.net/bugs/1509886

commit 4857c91f0d195f05908fff296ba1ec5fca87066c upstream.

The recent ioapic cleanups changed the affinity setting in
setup_ioapic_dest() from a direct write to the hardware to the delayed
affinity setup via irq_set_affinity().

That results in a warning from chained_irq_exit():
WARNING: CPU: 0 PID: 5 at kernel/irq/migration.c:32 irq_move_masked_irq
[] irq_move_masked_irq+0xb8/0xc0
[] ioapic_ack_level+0x111/0x130
[] intel_gpio_irq_handler+0x148/0x1c0

The reason is that irq_set_affinity() does not write directly to the
hardware. It marks the affinity setting as pending and executes it
from the next interrupt. The chained handler infrastructure does not
take the irq descriptor lock for performance reasons because such a
chained interrupt is not visible to any interfaces. So the delayed
affinity setting triggers the warning in irq_move_masked_irq().

Restore the old behaviour by calling the set_affinity function of the
ioapic chip in setup_ioapic_dest(). This is safe as none of the
interrupts can be on the fly at this point.

Fixes: aa5cb97f14a2 'x86/irq: Remove x86_io_apic_ops.set_affinity and 
related interfaces'
Reported-and-tested-by: Mika Westerberg 
Signed-off-by: Thomas Gleixner 
Cc: Jiang Liu 
Cc: jarkko.nik...@linux.intel.com
Signed-off-by: Greg Kroah-Hartman 

Signed-off-by: Tim Gardner 
Signed-off-by: Brad Figg 

:04 04 0233ddd54b0d7f34ceb513fe09e8df462ab8b777
e811435d773d53cdb9c2a26e68586f0dc2e41bf8 M  arch

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-11-24 Thread Vladimir Marko
The workaround makes networking very unstable (both WiFi and wired).

4.2.0-18 is OK.
4.2.0-19 is BROKEN.

No suspicious configuration changes:

$ diff /boot/config-4.2.0-18-generic /boot/config-4.2.0-19-generic 
3c3
< # Linux/x86_64 4.2.0-18-generic Kernel Configuration
---
> # Linux/x86_64 4.2.0-19-generic Kernel Configuration
69c69
< CONFIG_VERSION_SIGNATURE="Ubuntu 4.2.0-18.22~14.04.1-generic 4.2.3"
---
> CONFIG_VERSION_SIGNATURE="Ubuntu 4.2.0-19.23~14.04.1-generic 4.2.6"
5334c5334,5335
< # CONFIG_SND_PCM_OSS is not set
---
> CONFIG_SND_PCM_OSS=m
> CONFIG_SND_PCM_OSS_PLUGINS=y
7530c7531,7532
< # CONFIG_AUFS_EXPORT is not set
---
> CONFIG_AUFS_EXPORT=y
> CONFIG_AUFS_INO_T_64=y

I'll get the ubuntu kernel source and try to bisect.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-11-19 Thread Vladimir Marko
Upgrading the nx6325 BIOS from F.04 to F.07 did not help, the workaround
is still necessary.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-11-19 Thread Vladimir Marko
Permanently adding kernel parameters to grub config is described at
http://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter
(But it's all or nothing, so you cannot add the parameter only to one of two 
dual-booting Linuxes.)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-11-19 Thread Vladimir Marko
Trying the different kernel parameters suggested at
https://wiki.ubuntu.com/DebuggingACPI I've got these results:

acpi=off: kernel panic (something too do with PCI)
acpi=ht: no change
pci=noacpi: kernel panic (something too do with PCI)
acpi=noirq: WORKS

So this is a bug in ACPI IRQ routing. Recommended workaround is acpi=noirq.
(Now how to configure grub to add that kernel parameter when doing update-grub?)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs


[Bug 1598312] Re: Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

2016-11-18 Thread Vladimir Marko
Same on HP Compaq nx6325 with AMD Turion(tm) 64 X2 Mobile Technology
TL-52, including the fan running at full speed. But given the the
thermal trip points, I think the CPU frequency scaling works as
intended.

When idle, with the old kernel I see

$ uname -r
3.13.0-101-generic
$ cat /sys/devices/virtual/thermal/thermal_zone0/temp 
42000
$ cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_*_temp 
105000
95000
75000
65000
55000
4

but with the new kernel it is

$ uname -r
4.4.0-47-generic
$ cat /sys/devices/virtual/thermal/thermal_zone0/temp
32000
$ cat /sys/devices/virtual/thermal/thermal_zone0/trip_point_*_temp
105000
15900
15900
15900
15900
15900

So it's essentially trying to keep the CPU from overheating.

Additionally, shutting down the laptop does not work, it gets the laptop
to some weird power state where it looks like powered down but it won't
boot after turning back on. Then I have to long-press the power button
to shut down properly. Reboot just gets stuck. If I understand
correctly, this is all related to ACPI, so I guess I should learn how to
debug ACPI issues.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1598312

Title:
  Cannot scale AMD Turion CPU frequency. It runs on lowest 800MHz

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-lts-wily/+bug/1598312/+subscriptions

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs