All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andreas Herrmann <andreas.herrmann3@amd.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Ingo Molnar <mingo@elte.hu>, Thomas Gleixner <tglx@linutronix.de>,
	Arjan van de Ven <arjan@infradead.org>,
	linux-kernel@vger.kernel.org
Subject: Re: 2.6.27-rc8+ - first impressions
Date: Tue, 7 Oct 2008 11:10:32 +0200	[thread overview]
Message-ID: <20081007091032.GD22097@alberich.amd.com> (raw)
In-Reply-To: <20081007034230.GA6095@amd.corenet.prv>

>On Mon, Oct 06, 2008 at 11:42:35PM -0400, Dmitry Torokhov wrote:
> On Mon, Oct 06, 2008 at 09:53:50PM +0200, Andreas Herrmann wrote:
> > On Mon, Oct 06, 2008 at 02:28:39AM -0400, Dmitry Torokhov wrote:
> > > On Sun, Oct 05, 2008 at 12:10:46PM -0700, Arjan van de Ven wrote:
> > > > On Sun, 5 Oct 2008 14:36:25 -0400
> > > > Dmitry Torokhov <dmitry.torokhov@gmail.com> wrote:
> > > > 
> > > > > Hi,
> > > > > 
> > > > > Lats night I loaded 2.6.27-rc8-tip for the first time on my AMD Turion
> > > > > 64 laptop that is normally runs with Fedora distribution kernel.
> > > > > Compared to 2.6.25 the thing is broken - hdparm reports about 3MB/sec
> > > > > speed, fans are constantly on, everything seems sluggish.
> > > > > 
> > > > > Booting with hpet=force (HPET is disabled in BIOS) hangs the box
> > > > > somewhere in tty_init.
> > > > 
> > > > hpet=force is a "the kernel thinks it's not wise to use, but you think
> > > > better"... don't do that ;(
> > > > 
> > > 
> > > That is not how I parse dmesg:
> > > 
> > > [    0.077927] HPET not enabled in BIOS. You might try hpet=force boot
> > > option
> > > 
> > > Here kernel recommends to try and enable it. If we generally don't recommed
> > > using 'force' I'd suggest removing the 2nd sentence from the message.
> > 
> > FYI.
> > Commit e7250b8ae3870f37f660c2f65cafcaba85e3bfd3 of tip/master is
> > needed to really enable hpet on SB400. I guess that patch should go
> > upstream asap -- and probably it's a good idea to add a check for timer
> > interrupt routing as well which could solve the issues on HP nx6xxx
> > laptops.
> > 
> 
> Having trouble locating this one. Could you please send me a patch so I
> can try it here? Thanks!

Here it is.

commit e7250b8ae3870f37f660c2f65cafcaba85e3bfd3
Author: Andreas Herrmann <andreas.herrmann3@amd.com>
Date:   Fri Sep 5 18:33:26 2008 +0200

    x86: hpet: modify IXP400 quirk to enable interrupts
    
    The current quirk is incomplete. Some more chipset fiddling has to be
    done to enable HPET interrupts. This patch aims to do this. From my
    tests it seems to work faultlessly.
    
    But the official statement is that HPET is not supported on SB4X0.
    
    Users will still have to use hpet=force to enable it.
    
    Use it at your own risk.
    
    Signed-off-by: Andreas Herrmann <andreas.herrmann3@amd.com>
    Signed-off-by: Ingo Molnar <mingo@elte.hu>

diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c
index d138588..f6a11b9 100644
--- a/arch/x86/kernel/quirks.c
+++ b/arch/x86/kernel/quirks.c
@@ -354,9 +354,27 @@ static void ati_force_hpet_resume(void)
 	printk(KERN_DEBUG "Force enabled HPET at resume\n");
 }
 
+static u32 ati_ixp4x0_rev(struct pci_dev *dev)
+{
+	u32 d;
+	u8  b;
+
+	pci_read_config_byte(dev, 0xac, &b);
+	b &= ~(1<<5);
+	pci_write_config_byte(dev, 0xac, b);
+	pci_read_config_dword(dev, 0x70, &d);
+	d |= 1<<8;
+	pci_write_config_dword(dev, 0x70, d);
+	pci_read_config_dword(dev, 0x8, &d);
+	d &= 0xff;
+	dev_printk(KERN_DEBUG, &dev->dev, "SB4X0 revision 0x%x\n", d);
+	return d;
+}
+
 static void ati_force_enable_hpet(struct pci_dev *dev)
 {
-	u32 uninitialized_var(val);
+	u32 d, val;
+	u8  b;
 
 	if (hpet_address || force_hpet_address)
 		return;
@@ -366,14 +384,33 @@ static void ati_force_enable_hpet(struct pci_dev *dev)
 		return;
 	}
 
+	d = ati_ixp4x0_rev(dev);
+	if (d  < 0x82)
+		return;
+
+	/* base address */
 	pci_write_config_dword(dev, 0x14, 0xfed00000);
 	pci_read_config_dword(dev, 0x14, &val);
+
+	/* enable interrupt */
+	outb(0x72, 0xcd6); b = inb(0xcd7);
+	b |= 0x1;
+	outb(0x72, 0xcd6); outb(b, 0xcd7);
+	outb(0x72, 0xcd6); b = inb(0xcd7);
+	if (!(b & 0x1))
+		return;
+	pci_read_config_dword(dev, 0x64, &d);
+	d |= (1<<10);
+	pci_write_config_dword(dev, 0x64, d);
+	pci_read_config_dword(dev, 0x64, &d);
+	if (!(d & (1<<10)))
+		return;
+
 	force_hpet_address = val;
 	force_hpet_resume_type = ATI_FORCE_HPET_RESUME;
 	dev_printk(KERN_DEBUG, &dev->dev, "Force enabled HPET at 0x%lx\n",
 		   force_hpet_address);
 	cached_dev = dev;
-	return;
 }
 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_IXP400_SMBUS,
 			 ati_force_enable_hpet);



  reply	other threads:[~2008-10-07  9:12 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-05 18:36 2.6.27-rc8+ - first impressions Dmitry Torokhov
2008-10-05 18:59 ` Rafael J. Wysocki
2008-10-05 19:06   ` Dmitry Torokhov
2008-10-05 19:19     ` Rafael J. Wysocki
2008-10-05 19:27       ` Thomas Gleixner
2008-10-05 21:18       ` Dmitry Torokhov
2008-10-05 21:40         ` Parag Warudkar
2008-10-05 22:29         ` Rafael J. Wysocki
2008-10-06  6:23           ` Dmitry Torokhov
2008-10-06  9:59             ` [PATCH] x86 ACPI: Blacklist two HP machines with buggy BIOSes (Re: 2.6.27-rc8+ - first impressions) Rafael J. Wysocki
2008-10-06 14:54               ` Linus Torvalds
2008-10-06 15:00                 ` Ingo Molnar
2008-10-06 17:17                   ` Rafael J. Wysocki
2008-10-06 17:51                   ` Maciej W. Rozycki
2008-10-06 17:54                     ` Ingo Molnar
2008-10-06 20:59                     ` Andi Kleen
2008-10-06 21:39                       ` Maciej W. Rozycki
2008-10-06 22:11                         ` [PATCH] x86: SB450: skip IRQ0 override if it is not routed to INT2 of IOAPIC Andreas Herrmann
2008-10-07  3:41                           ` Ingo Molnar
2008-10-07  3:51                             ` Dmitry Torokhov
2008-10-07  4:57                               ` Ingo Molnar
2008-10-07 11:19                                 ` Dmitry Torokhov
2008-10-07 15:25                           ` Maciej W. Rozycki
2008-10-07 20:31                           ` Rafael J. Wysocki
2008-10-06 23:10                         ` [PATCH] x86 ACPI: Blacklist two HP machines with buggy BIOSes (Re: 2.6.27-rc8+ - first impressions) Andi Kleen
2008-10-07  1:35                           ` Maciej W. Rozycki
2008-10-07  4:42                             ` Ingo Molnar
2008-10-07  5:38                             ` Andi Kleen
2008-10-07 11:45                               ` Matthew Garrett
2008-10-07 12:04                               ` Ingo Molnar
2008-10-08  8:23                       ` Peter Zijlstra
2008-10-06 17:15                 ` Rafael J. Wysocki
2008-10-06 17:54                   ` Maciej W. Rozycki
2008-10-05 19:10 ` 2.6.27-rc8+ - first impressions Arjan van de Ven
2008-10-06  6:28   ` Dmitry Torokhov
2008-10-06 19:53     ` Andreas Herrmann
2008-10-07  3:42       ` Dmitry Torokhov
2008-10-07  9:10         ` Andreas Herrmann [this message]
2008-10-07 11:37           ` Dmitry Torokhov
2008-10-07 12:07             ` Parag Warudkar
2008-10-08  1:07               ` Dmitry Torokhov
2008-10-07 13:19             ` Andreas Herrmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081007091032.GD22097@alberich.amd.com \
    --to=andreas.herrmann3@amd.com \
    --cc=arjan@infradead.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.