mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Bjorn Helgaas <bjorn.helgaas@hp.com>
To: Andrew Morton <akpm@osdl.org>
Cc: venkatesh.pallipadi@intel.com, Bob Picco <Robert.Picco@hp.com>,
	linux-kernel@vger.kernel.org
Subject: [PATCH] announce hpet devices claimed
Date: Wed, 1 Sep 2004 10:36:02 -0600	[thread overview]
Message-ID: <200409011036.02276.bjorn.helgaas@hp.com> (raw)

I think the HPET driver should announce the hardware it claims.  Here's
a patch that prints this:

	hpet0: at MMIO 0xc0000ffffc002000, IRQs 74, 75, 76
	hpet0: 4ns tick, 3 64-bit timers
	hpet1: at MMIO 0xc0000ffffc082000, IRQs 77, 78, 79
	hpet1: 4ns tick, 3 64-bit timers

This has been acked by Bob.  I haven't heard from Venkatesh.


Print basic information (MMIO address, IRQs used, tick rate, number
of timers) when claiming an HPET device.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>

===== drivers/char/hpet.c 1.5 vs edited =====
--- 1.5/drivers/char/hpet.c	2004-08-02 02:00:44 -06:00
+++ edited/drivers/char/hpet.c	2004-08-26 12:46:01 -06:00
@@ -789,6 +789,7 @@
 	size_t siz;
 	struct hpet *hpet;
 	static struct hpets *last __initdata = (struct hpets *)0;
+	unsigned long ns;
 
 	/*
 	 * hpet_alloc can be called by platform dependent code.
@@ -840,6 +841,18 @@
 	hpetp->hp_period = (cap & HPET_COUNTER_CLK_PERIOD_MASK) >>
 	    HPET_COUNTER_CLK_PERIOD_SHIFT;
 
+	printk(KERN_INFO "hpet%d: at MMIO 0x%p, IRQ%s",
+		hpetp->hp_which, hpet, hpetp->hp_ntimer > 1 ? "s" : "");
+	for (i = 0; i < hpetp->hp_ntimer; i++)
+		printk("%s %d", i > 0 ? "," : "", hdp->hd_irq[i]);
+	printk("\n");
+
+	ns = hpetp->hp_period;	/* femptoseconds, 10^-15 */
+	do_div(ns, 1000000);	/* convert to nanoseconds, 10^-9 */
+	printk(KERN_INFO "hpet%d: %ldns tick, %d %d-bit timers\n",
+		hpetp->hp_which, ns, hpetp->hp_ntimer,
+		cap & HPET_COUNTER_SIZE_MASK ? 64 : 32);
+
 	mcfg = readq(&hpet->hpet_config);
 	if ((mcfg & HPET_ENABLE_CNF_MASK) == 0) {
 		write_counter(0L, &hpet->hpet_mc);
@@ -946,7 +960,6 @@
 
 static struct acpi_driver hpet_acpi_driver __initdata = {
 	.name = "hpet",
-	.class = "",
 	.ids = "PNP0103",
 	.ops = {
 		.add = hpet_acpi_add,


                 reply	other threads:[~2004-09-01 16:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=200409011036.02276.bjorn.helgaas@hp.com \
    --to=bjorn.helgaas@hp.com \
    --cc=Robert.Picco@hp.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=venkatesh.pallipadi@intel.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®