All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: "Jordan Crouse" <jordan.crouse@amd.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 6/7] AMD Geode GX/LX support
Date: 04 Oct 2005 15:18:23 +0200	[thread overview]
Message-ID: <p737jct1kv4.fsf@verdi.suse.de> (raw)
In-Reply-To: <20051003180200.GH29264@cosmic.amd.com>

"Jordan Crouse" <jordan.crouse@amd.com> writes:

> This patch adds support for the hardware RNG device on the Geode LX
> processor.  As a side note, the LX processor also includes a hardware

Interesting. Wish the mainstream AMD K8 CPUs had one too :)

> AES encryption engine, support for which is not included here because
> I'm not one to increase the kernel source size if it doesn't need to be.

If it's faster than the i386 assembly version I think you
should add it.

> +#ifdef CONFIG_MGEODE_LX
> +static int __init geode_init(struct pci_dev *dev);
> +static void geode_cleanup(void);
> +static unsigned int geode_data_present (void);
> +static u32 geode_data_read (void);
> +#endif

Declarations don't need ifdefs.

> +static u32 geode_data_read(void) {
> +	u32 val;
> +
> +	val = *((u32 *) (geode_rng_base + GEODE_RNG_DATA_REG));

This should use readl

> +	return val;
> +}
> +
> +static unsigned int geode_data_present(void) {

The bracket should be on an own line. Further occurrences.


> +}
> +
> +static int geode_init(struct pci_dev *dev) {
> +	u32 rng_base = pci_resource_start(dev, 0);

This should be unsigned long

> +	if (!rng_base) return 1;
> +
> +	geode_rng_base = ioremap(rng_base, 0x58);

This should be ioremap_nocache() 

> +
> +	if (geode_rng_base == NULL) {
> +		printk(KERN_ERR PFX "Cannot ioremap RNG memory\n");
> +		return -EBUSY;
> +	}
> +
> +	printk(KERN_INFO PFX "Geode RNG registers at %p\n", geode_rng_base);

I would advise to not print virtual addresses into the kernel log.
They are usually completely useless to the user. Either physical
or nothing.


-Andi

      parent reply	other threads:[~2005-10-04 13:18 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-10-03 18:02 [PATCH 6/7] AMD Geode GX/LX support Jordan Crouse
2005-10-03 18:28 ` Valdis.Kletnieks
2005-10-03 19:07 ` Alan Cox
2005-10-04 13:18 ` Andi Kleen [this message]

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=p737jct1kv4.fsf@verdi.suse.de \
    --to=ak@suse.de \
    --cc=jordan.crouse@amd.com \
    --cc=linux-kernel@vger.kernel.org \
    /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.