From: Greg KH <greg@kroah.com>
To: Vladimir Kondratiev <vladimir.kondratiev@intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: PCI Express support for 2.4 kernel
Date: Tue, 16 Dec 2003 09:45:05 -0800 [thread overview]
Message-ID: <20031216174505.GC2716@kroah.com> (raw)
In-Reply-To: <3FDEDC77.9010203@intel.com>
Minor code comments below:
On Tue, Dec 16, 2003 at 12:20:39PM +0200, Vladimir Kondratiev wrote:
> +
> +#ifdef CONFIG_PCI_EXPRESS
> +#define PCI_PROBE_EXP 0x0008
> +#endif
> +
If you change this to:
#ifdef CONFIG_PCI_EXPRESS
#define PCI_PROBE_EXP 0x0008
#else
#define PCI_PROBE_EXP 0x0000
#endif
You can get rid of a number of "#ifdef CONFIG_PCI_EXPRESS" statements
later on in the .c files by just always using the PCI_PROBE_EXP value.
That cleans up the patch a bit.
> -unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2;
> +unsigned int pci_probe = PCI_PROBE_BIOS | PCI_PROBE_CONF1 | PCI_PROBE_CONF2
> +#ifdef CONFIG_PCI_EXPRESS
> + | PCI_PROBE_EXP
> +#endif
> +;
Like right there :)
> +/**
> + * RRBAR (memory base for PCI-E config space) resides here.
> + * Initialized to default address. Actually, it is platform specific, and
> + * value may vary.
> + * I don't know how to detect it properly, it is chipset specific.
> + */
> +static u32 rrbar_phys = CONFIG_PCI_EXPRESS_BASE * 0x10000000UL;
<snip>
> +/**
> + * I don't know how to detect it properly.
> + * assume it is PCI-E, sanity_check will
> + * stop me if it is not.
> + *
> + * Also, this function supposed to set rrbar_phys
> + */
> +static int is_pcie_platform(void)
> +{ return 1; }
Shouldn't your comments at least match your code for the rrbar_phys
statement for your first release? :)
> +/**
> + * Initializes PCI Express method for config space access.
> + *
> + * There is no standard method to recognize presence of PCI Express,
> + * thus we will assume it is PCI-E, and rely on sanity check to
> + * deassert PCI-E presense. If PCI-E not present,
> + * there is no physical RAM on RRBAR address, and we should read
> + * something like 0xff.
> + *
> + * @return 1 if OK, 0 if error
> + */
> +static int pci_express_init(void)
> +{
> + rrbar_window_virt = (void*)fix_to_virt(FIX_PCIE_CONFIG);
> + if (!is_pcie_platform())
> + return 0;
Call fix_to_virt() after you do the check and not before?
> +/**
> + * Shuts down PCI-E resources.
> + */
> +static inline void pci_express_fini(void)
> +{}
If this isn't needed, why have it anymore?
> +static struct pci_ops pci_express_conf = {
> + pci_exp_read_config_byte,
> + pci_exp_read_config_word,
> + pci_exp_read_config_dword,
> + pci_exp_write_config_byte,
> + pci_exp_write_config_word,
> + pci_exp_write_config_dword
> +};
C99 initializers here?
> + printk(KERN_INFO "PCI-Express config at 0x%08x\n", rrbar_phys);
"%p" to show the address might be nicer.
thanks,
greg k-h
next prev parent reply other threads:[~2003-12-16 17:45 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-12-14 20:00 PCI Express support for 2.4 kernel Vladimir Kondratiev
2003-12-14 20:46 ` Jeff Garzik
2003-12-15 10:01 ` Vladimir Kondratiev
2003-12-15 10:31 ` Gabriel Paubert
2003-12-15 12:44 ` Vladimir Kondratiev
2003-12-15 13:15 ` Arjan van de Ven
2003-12-15 13:58 ` Vladimir Kondratiev
2003-12-15 14:31 ` Arjan van de Ven
2003-12-15 14:44 ` Brian Gerst
2003-12-15 18:40 ` Greg KH
2003-12-15 19:23 ` Alan Cox
2003-12-15 20:00 ` Linus Torvalds
2003-12-16 10:20 ` Vladimir Kondratiev
2003-12-16 16:47 ` Linus Torvalds
2003-12-17 6:30 ` Vladimir Kondratiev
2003-12-17 6:46 ` Linus Torvalds
2003-12-17 6:55 ` Jeff Garzik
2003-12-17 7:24 ` Vladimir Kondratiev
2003-12-17 16:17 ` Linus Torvalds
2003-12-17 8:22 ` Arjan van de Ven
2003-12-17 10:35 ` Martin Mares
2003-12-17 23:06 ` Alan Cox
2003-12-17 10:08 ` Geert Uytterhoeven
2003-12-17 15:54 ` Linus Torvalds
2003-12-17 16:14 ` Geert Uytterhoeven
2003-12-17 17:44 ` Dan Hopper
2003-12-17 18:14 ` Vladimir Kondratiev
2003-12-17 21:44 ` Martin Mares
2003-12-16 17:10 ` Jeff Garzik
2003-12-16 17:48 ` Arjan van de Ven
2003-12-16 17:55 ` Jeff Garzik
2003-12-16 22:39 ` Vladimir Kondratiev
2003-12-17 0:12 ` Richard B. Johnson
2003-12-16 21:59 ` Vladimir Kondratiev
2003-12-16 17:45 ` Greg KH [this message]
2003-12-16 22:14 ` Vladimir Kondratiev
2003-12-17 10:05 ` Geert Uytterhoeven
2003-12-15 15:57 ` Vladimir Kondratiev
2003-12-15 10:42 ` Martin Mares
2003-12-15 10:07 ` Greg KH
2003-12-15 11:20 ` Vladimir Kondratiev
[not found] <12InT-wQ-5@gated-at.bofh.it>
[not found] ` <135Nw-5gv-3@gated-at.bofh.it>
[not found] ` <137wc-q1-23@gated-at.bofh.it>
2003-12-15 21:56 ` Andi Kleen
2003-12-15 22:48 ` Vladimir Kondratiev
2003-12-15 23:06 ` Andi Kleen
2003-12-15 23:14 ` Greg KH
-- strict thread matches above, loose matches on Subject: below --
2003-12-15 20:08 Nakajima, Jun
[not found] <Pine.LNX.4.44.0312150917170.32061-100000@coffee.psychology.mcmaster.ca>
2003-12-15 15:52 ` Vladimir Kondratiev
2003-12-15 16:08 ` Kevin P. Fleming
2003-12-15 16:38 ` Vladimir Kondratiev
2003-12-15 16:55 ` Richard B. Johnson
2003-12-15 17:08 ` Tomas Szepe
2003-12-15 18:03 ` Richard B. Johnson
2003-12-15 18:15 ` Tomas Szepe
2003-12-15 18:35 ` Richard B. Johnson
2003-12-15 18:43 ` Keith Owens
2003-12-15 18:45 ` Tomas Szepe
2003-12-15 17:24 ` Vladimir Kondratiev
2003-12-15 17:22 ` Randy.Dunlap
2003-12-15 18:16 ` Greg KH
2003-12-15 18:20 ` Richard B. Johnson
2003-12-15 17:09 ` Keith Owens
2003-12-15 17:38 ` Tomas Szepe
2003-12-15 18:16 ` Keith Owens
2003-12-15 18:23 ` Tomas Szepe
[not found] <12KJ6-4F2-13@gated-at.bofh.it>
[not found] ` <12Lvu-5X5-5@gated-at.bofh.it>
[not found] ` <12XQ2-7Vs-9@gated-at.bofh.it>
2003-12-15 10:17 ` Andi Kleen
[not found] ` <12YsA-nt-1@gated-at.bofh.it>
[not found] ` <130kQ-3A0-13@gated-at.bofh.it>
[not found] ` <130Xy-4Ia-3@gated-at.bofh.it>
[not found] ` <131Ac-5Qy-3@gated-at.bofh.it>
[not found] ` <137cD-8eg-9@gated-at.bofh.it>
[not found] ` <13kD2-1kF-11@gated-at.bofh.it>
2003-12-16 17:44 ` Andi Kleen
[not found] ` <13r1S-3FB-11@gated-at.bofh.it>
[not found] ` <13vyg-43O-7@gated-at.bofh.it>
2003-12-16 22:18 ` Andi Kleen
[not found] ` <13qIi-31G-1@gated-at.bofh.it>
[not found] ` <13DvZ-2RY-9@gated-at.bofh.it>
[not found] ` <13DFw-3a8-9@gated-at.bofh.it>
[not found] ` <13DPq-3s4-7@gated-at.bofh.it>
[not found] ` <13Fem-6iy-7@gated-at.bofh.it>
[not found] ` <13SY1-35z-19@gated-at.bofh.it>
2003-12-17 23:22 ` Andi Kleen
2003-12-17 23:38 ` Alan Cox
[not found] ` <12XQc-7Vs-29@gated-at.bofh.it>
[not found] ` <12Z5u-1tG-11@gated-at.bofh.it>
2003-12-15 14:58 ` Andi Kleen
2003-12-15 15:40 ` Vladimir Kondratiev
[not found] <3FDCA569.5070006@pobox.com>
2003-12-15 4:47 ` Pete Zaitcev
2003-12-14 17:28 Vladimir Kondratiev
2003-12-15 7:48 ` Christoph Hellwig
2003-12-15 18:26 ` Linus Torvalds
2003-12-15 20:03 ` Jeff Garzik
2003-12-15 22:00 ` Linus Torvalds
2003-12-16 4:53 ` Jeff Garzik
2003-12-15 20:21 ` Vladimir Kondratiev
2003-12-15 20:36 ` Jeff Garzik
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=20031216174505.GC2716@kroah.com \
--to=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=vladimir.kondratiev@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;
as well as URLs for NNTP newsgroup(s).