[Bug 1093217] Re: 8086:0166 [Lenovo IdeaPad Z580] 12.04-13.10 10-20min boot delay (From 3.2.0.29-3.12-rc2)

2014-05-12 Thread Jon Baca
The only way I have been able to get the patched DSDT to work is to
build it into the kernel.  This is less than ideal but will allow you to
use your computer.  If you have been unable to get a patched DSDT to
work, this should work for you.  I am currently running 14.04 with a
custom kernel build.  The following should work with other kernel
versions as well.  I am only posting the steps exactly as I performed
them, so if version number etc don't match for you, you are on your own.

1) Install Ubuntu 14.04.  If you have to, just pull out your battery and
complete the installation.  Just leave it out until we are finished.

2) Compile your custom DSDT - this should produce a DSDT.hex file that you will 
need for incorporation into the kernel.  
sudo iasl -tc DSDT.dsl

3) Get the source:
sudo apt-get source linux-image-3.13.0-24-generic

4) Untar the source:
gzip -cd linux_3.13.0.orig.tar.gz | tar xvf -

5) Move into the directory that contains the kernel source code and apply the 
patch:
cd linux-3.13/
gzip -cd ~/linux_3.13.0-24.47.diff.gz | patch -p1

6) Get the required tools to build the kernel
sudo apt-get install git-core libncurses5 libncurses5-dev libelf-dev asciidoc 
binutils-dev linux-source qt3-dev-tools libqt3-mt-dev libncurses5 
libncurses5-dev fakeroot build-essential crash kexec-tools makedumpfile 
kernel-wedge kernel-package gcc

7) Configure the kernel for compilation:
make menuconfig

When the menu comes up navigate to Power Management and ACPI options - ACPI
In the field Custom DSDT Table file to include enter the path to your 
DSDT.hex file which for me was /home/DSDT.hex

Now navigate to General Setup (you will have to go back to the main menu)
In the field Local Version enter -custom-dsdt

Now navigate to Device Drivers - Generic Driver Options 
Deselect the field Prevent Firmware from being built

Select save at the bottom, accept the default file name and exit

8) Build the kernel:
sudo make -j3 deb-pkg

At this point, just walk away from you computer.  Come back every so
often to check on the progress but the build will probably take a couple
of hours(depending on your system).  Try to resolve it and retry
building the kernel

9) Install the kernel:
sudo dpkg -i linux-image-3.13.9-custom-dsdt_3.13.9-custom-dsdt-4_amd64.deb

This will install the new kernel.  If it completes successfully, reboot
your system.  The default grub option should now be your new kernel.
You can verify the custom DSDT is loaded in dmesg and you should see
your custom version number with the uname -r command.  If all goes
well power off your computer, reinstall your battery, and boot your
computer up.

Let me know if I missed anything and good luck.

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

Title:
  8086:0166 [Lenovo IdeaPad Z580] 12.04-13.10 10-20min boot delay (From
  3.2.0.29-3.12-rc2)

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

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


[Bug 1093217] Re: 8086:0166 [Lenovo IdeaPad Z580] 12.04-13.10 10-20min boot delay (From 3.2.0.29-3.12-rc2)

2014-05-12 Thread Jon Baca
Sorry, end of 8 was supposed to say if you encounter any errors, try to
resolve them and retry building the kernel.

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

Title:
  8086:0166 [Lenovo IdeaPad Z580] 12.04-13.10 10-20min boot delay (From
  3.2.0.29-3.12-rc2)

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-06-01 Thread Jon Baca
I think that I have found the culprit code change that is causing the
slow boot issue.  I have been comparing changes across the 3.2, 3.5, and
3.8 kernels and paying attention to the changes that remained the same
across the 3.5 and 3.8 sources.

All calls to exit_idle() and irq_enter() were reversed from the 3.2 kernel to 
the 3.5 and 3.8 kernels in the file arch/x86/kernel/apic/apic.c.  I reversed 
them all to match the 3.2 kernel and have been booting successfully with this 
kernel build.  I have tried booting in every combination I could think of 
(quickly and slowly booting from grub, booting plugged in and uplugged etc.).  
My changes are marked by the ADDED and REMOVED comments.  The following is a 
copy of all the functions I edited.

void __irq_entry smp_apic_timer_interrupt(struct pt_regs *regs)
{
struct pt_regs *old_regs = set_irq_regs(regs);

/*
 * NOTE! We'd better ACK the irq immediately,
 * because timer handling can be slow.
 */
ack_APIC_irq();
/*
 * update_process_times() expects us to have done irq_enter().
 * Besides, if we don't timer interrupts ignore the global
 * interrupt lock, which is the WrongThing (tm) to do.
 */
exit_idle();//ADDED
irq_enter();
//REMOVED   exit_idle();
local_apic_timer_interrupt();
irq_exit();

set_irq_regs(old_regs);
}

void smp_spurious_interrupt(struct pt_regs *regs)
{
u32 v;
exit_idle();//ADDED
irq_enter();
//REMOVED   exit_idle();
/*
 * Check if this really is a spurious interrupt and ACK it
 * if it is a vectored one.  Just in case...
 * Spurious interrupts should not be ACKed.
 */
v = apic_read(APIC_ISR + ((SPURIOUS_APIC_VECTOR  ~0x1f)  1));
if (v  (1  (SPURIOUS_APIC_VECTOR  0x1f)))
ack_APIC_irq();

inc_irq_stat(irq_spurious_count);

/* see sw-dev-man vol 3, chapter 7.4.13.5 */
pr_info(spurious APIC interrupt on CPU#%d, 
should never happen.\n, smp_processor_id());
irq_exit();
}

void smp_error_interrupt(struct pt_regs *regs)
{
u32 v0, v1;
u32 i = 0;
static const char * const error_interrupt_reason[] = {
Send CS error,/* APIC Error Bit 0 */
Receive CS error, /* APIC Error Bit 1 */
Send accept error,/* APIC Error Bit 2 */
Receive accept error, /* APIC Error Bit 3 */
Redirectable IPI, /* APIC Error Bit 4 */
Send illegal vector,  /* APIC Error Bit 5 */
Received illegal vector,  /* APIC Error Bit 6 */
Illegal register address, /* APIC Error Bit 7 */
};
exit_idle();//ADDED
irq_enter();
//REMOVED   exit_idle();
/* First tickle the hardware, only then report what went on. -- REW */
v0 = apic_read(APIC_ESR);
apic_write(APIC_ESR, 0);
v1 = apic_read(APIC_ESR);
ack_APIC_irq();
atomic_inc(irq_err_count);

apic_printk(APIC_DEBUG, KERN_DEBUG APIC error on CPU%d: %02x(%02x),
smp_processor_id(), v0 , v1);

v1 = v1  0xff;
while (v1) {
if (v1  0x1)
apic_printk(APIC_DEBUG, KERN_CONT  : %s, 
error_interrupt_reason[i]);
i++;
v1 = 1;
}

apic_printk(APIC_DEBUG, KERN_CONT \n);

irq_exit();
}

Other than the changes at the ADDED and REMOVED comments the source code
I used to build my kernel is identical to 3.8.0-23.34, which I believe
is the latest Raring kernel.

I am not sure how to submit these changes for approval/testing, is
anyone willing to apply these changes and test it out on their machine
and/or submit the changes?

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-06-01 Thread Jon Baca
I realized I built the kernel with ACPI debugging enabled, rebuilt the
kernel and now it doesn't work.  So I guess don't waste your time
testing the fix I proposed.

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-05-08 Thread Jon Baca
I am not sure if it fixed my computer or not.  I seem to have better
luck booting than a lot of people for some reason.  Because the issue
has occurred after a kernel update, I am just suggesting that maybe
altering the DSDT is not the best solution to this problem(especially
since Windows 8 is using the same code and it boots 100% of the time).

I did compile a kernel with the altered DSDT and it does seem to boot
without problems.  I have also tried diffing the 3.2 and 3.8 kernels and
backing out some changes, focusing on the battery.c code in the ACPI
drivers, but I have not been able to find anything that affects boot
time.  Anyone have any ideas on where else to look?

You should try booting your computer with some of the OS options that
are listed in your decompiled DSDT.  Until a solution is found, altering
the DSDT is a good temporary solution(in my opinion).

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-05-01 Thread Jon Baca
I found that there is also a Linux option you can try too.  It looks
like there is a list of OS names in the DSDT and if Ubuntu isn't
supplying one of those names, a lot of things don't get initialized
properly.  After saying that the Windows 2012 option was working, it
immediately stopped workingSo I am using the LInux option now and it
seems to be working.  Hopefully this trend continues after I post this.

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-04-30 Thread Jon Baca
After a lot of digging, I found that the DSDT for my Windows 8 and
Ubuntu are nearly identical.  There is no delay in the WAEC method that
Windows 8 is using.  In method _OSC of the decompiled DSDT, there is a
test against the OS name reported to the ACPI.  In my case, I am dual
booting with Windows 8 and the name that is being checked for is
Windows 2012.

That being said, I looked into my dmesg and the acpi command was not
working for me either, just extra magic in my computer I guess :).
Remove the acpi command from the grub.cfg menu entry for the version of
Ubuntu you are running add the kernel parameter acpi_os_name=Windows
2012 as follows:

linux   /boot/vmlinuz-3.8.0-19-generic root=UUID=b6449636-2d59-426d-
88e4-4f6132af9e2f ro   crashkernel=384M-2G:64M,2G-:128M quiet splash
$vt_handoff acpi_os_name=Windows 2012

If you are not running Windows 8, you may have to put a different string
in for the acpi_os_name.

My magic ran out when I upgraded to 13.04.  I have been using this to
boot 13.04 with no issues.  Give this a try and let us know if it works
for you.

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-04-21 Thread Jon Baca
I successfully applied this fix to 12.10.  Did you put add the acpi
command to the grub.cfg file?

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-04-21 Thread Jon Baca
Forgot to mention that I installed 12.10 in UEFI mode and am dual
booting Windows8 from grub.

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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


[Bug 1093217] Re: Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19) [Lenovo IdeaPad Z580]

2013-04-21 Thread Jon Baca
I am always booting in UEFI mode.  I put the patched DSDT in the same
location, but I edited /boot/grub/grub.cfg to include acpi
/boot/DSDT.aml just before the linux and initrd load commands.  This
works for me on every boot. I am not at my computer right now, so if any
of the info seems wrong I can double check it later, but it for sure
works every time in UEFI mode.

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

Title:
  Ubuntu 12.04/12.10/13.04 10-20min boot delay (From 3.2.0.29-3.8.0.19)
  [Lenovo IdeaPad Z580]

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

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