Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
* Andrew Morton <[EMAIL PROTECTED]> wrote: > > please check some updated patches in -mm that could be affected. > > hope it could save you some time > > > > x86-validate-against-acpi-motherboard-resources.patch > > x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch > > x86-mmconf-enable-mcfg-early.patch > > x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch > > I have unhappy feelings here - the patches seem to be churning a bit > and when I last sent them to Greg and Ingo they received no apparent > response. i actually carried them for a while and validate-against-acpi-motherboard-resources.patch got a fair bit of test time with positive results. So it has a clear ACK from me. It's something that looks appealing: | This path adds validation of the MMCONFIG table against the ACPI | reserved motherboard resources. If the MMCONFIG table is found to be | reserved in ACPI, we don't bother checking the E820 table. The PCI | Express firmware spec apparently tells BIOS developers that | reservation in ACPI is required and E820 reservation is optional, so | checking against ACPI first makes sense. Many BIOSes don't reserve | the MMCONFIG region in E820 even though it is perfectly functional, | the existing check needlessly disables MMCONFIG in these cases. anything that isolates Linux from BIOS messups should be music to our ears. i also think the mmconf-enable stuff for Barcelona stuff from Yinghai, albeit not particularly pretty, is probably good too for similar reasons. It makes the kernel boot with noacpi which is a good sign IMO. I have testsystems that simply do not boot with ACPI turned off - and i have a testsystem that locks up hard if it takes an NMI in certain ACPI AML sequences ... Just Because. So i'd ACK them just on general principle - earlier versions of the patches were carried in x86.git and caused no particular problems. but ... then we got complaints from you that stuff collides and that such patches should be carried in your or Greg's tree, so we dropped them. And there was another 100 KLOC of x86 code to worry about ;-) So i'd suggest to send those patches upstream, they are system enablers and they are at fundamental enough places to be apparent if they cause any breakage i think. Ingo -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, 10 Feb 2008 17:49:34 -0800 "Yinghai Lu" <[EMAIL PROTECTED]> wrote: > On Feb 10, 2008 12:45 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > > > On Sun, Feb 10, 2008 at 12:24:18PM -0800, Linus Torvalds wrote: > > > On Sun, 10 Feb 2008, Yinghai Lu wrote: > > > > > > > > > > I suggest Ivan's patch be merged ASAP as it actually fixes bugs. > > > > > This patch is just cleanup (and takes care of some future concerns). > > > > > > > > your patch and Ivan's patch should be merged in one... > > > > > > I really don't care whether they get merges as one or separately, but I > > > think it should be merged _now_ (-rc1 is already delayed), and I'd like to > > > see the final versions of both. Does anybody have them in a final > > > agreed-upon format (preferably with that oddness in quirk_intel_irqbalance > > > also fixed?) > > > > I just looked at fixing that -- the reason seems to be that we don't > > actually have the struct pci_dev at that point. I can fix it, but I > > think it's actually buggy. I want to look at some chipset docs to > > confirm that though. > > > > I've attached the two patches that I believe are the ones we want. We > > can (and should) fix quirk_intel_irqbalance separately. > > Andrew, > > those two patch just got into linus 2.6.25-rc1. > > I assume that you will drop > gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in > -mm. That's no longer in Greg's tree. > please check some updated patches in -mm that could be affected. hope > it could save you some time > > x86-validate-against-acpi-motherboard-resources.patch > x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch > x86-mmconf-enable-mcfg-early.patch > x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch I have unhappy feelings here - the patches seem to be churning a bit and when I last sent them to Greg and Ingo they received no apparent response. So I think I'll just drop all four. Please redo, retest and fully resubmit, thanks. And we need to work out who owns these patches. Are they rightly part of the PCI tree, or of the x86 tree? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
* Andrew Morton [EMAIL PROTECTED] wrote: please check some updated patches in -mm that could be affected. hope it could save you some time x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch I have unhappy feelings here - the patches seem to be churning a bit and when I last sent them to Greg and Ingo they received no apparent response. i actually carried them for a while and validate-against-acpi-motherboard-resources.patch got a fair bit of test time with positive results. So it has a clear ACK from me. It's something that looks appealing: | This path adds validation of the MMCONFIG table against the ACPI | reserved motherboard resources. If the MMCONFIG table is found to be | reserved in ACPI, we don't bother checking the E820 table. The PCI | Express firmware spec apparently tells BIOS developers that | reservation in ACPI is required and E820 reservation is optional, so | checking against ACPI first makes sense. Many BIOSes don't reserve | the MMCONFIG region in E820 even though it is perfectly functional, | the existing check needlessly disables MMCONFIG in these cases. anything that isolates Linux from BIOS messups should be music to our ears. i also think the mmconf-enable stuff for Barcelona stuff from Yinghai, albeit not particularly pretty, is probably good too for similar reasons. It makes the kernel boot with noacpi which is a good sign IMO. I have testsystems that simply do not boot with ACPI turned off - and i have a testsystem that locks up hard if it takes an NMI in certain ACPI AML sequences ... Just Because. So i'd ACK them just on general principle - earlier versions of the patches were carried in x86.git and caused no particular problems. but ... then we got complaints from you that stuff collides and that such patches should be carried in your or Greg's tree, so we dropped them. And there was another 100 KLOC of x86 code to worry about ;-) So i'd suggest to send those patches upstream, they are system enablers and they are at fundamental enough places to be apparent if they cause any breakage i think. Ingo -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, 10 Feb 2008 17:49:34 -0800 Yinghai Lu [EMAIL PROTECTED] wrote: On Feb 10, 2008 12:45 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sun, Feb 10, 2008 at 12:24:18PM -0800, Linus Torvalds wrote: On Sun, 10 Feb 2008, Yinghai Lu wrote: I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... I really don't care whether they get merges as one or separately, but I think it should be merged _now_ (-rc1 is already delayed), and I'd like to see the final versions of both. Does anybody have them in a final agreed-upon format (preferably with that oddness in quirk_intel_irqbalance also fixed?) I just looked at fixing that -- the reason seems to be that we don't actually have the struct pci_dev at that point. I can fix it, but I think it's actually buggy. I want to look at some chipset docs to confirm that though. I've attached the two patches that I believe are the ones we want. We can (and should) fix quirk_intel_irqbalance separately. Andrew, those two patch just got into linus 2.6.25-rc1. I assume that you will drop gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in -mm. That's no longer in Greg's tree. please check some updated patches in -mm that could be affected. hope it could save you some time x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch I have unhappy feelings here - the patches seem to be churning a bit and when I last sent them to Greg and Ingo they received no apparent response. So I think I'll just drop all four. Please redo, retest and fully resubmit, thanks. And we need to work out who owns these patches. Are they rightly part of the PCI tree, or of the x86 tree? -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 6:53 PM, Robert Hancock <[EMAIL PROTECTED]> wrote: > > Yinghai Lu wrote: > > On Feb 10, 2008 12:45 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: .. > >> I've attached the two patches that I believe are the ones we want. We > >> can (and should) fix quirk_intel_irqbalance separately. > > > > Andrew, > > > > those two patch just got into linus 2.6.25-rc1. > > > > I assume that you will drop > > gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in > > -mm. > > > > please check some updated patches in -mm that could be affected. hope > > it could save you some time > > > > x86-validate-against-acpi-motherboard-resources.patch > > x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch > > x86-mmconf-enable-mcfg-early.patch > > x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch > > I don't think any of these patches are affected. They all affect whether > to use MMCONFIG globally or not, regardless of whether not particular > accesses will use it. what i mean: gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch is not needed. and > > x86-validate-against-acpi-motherboard-resources.patch > > x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch > > x86-mmconf-enable-mcfg-early.patch > > x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch need some update because of changes by "Change pci_raw_ops to pci_raw_read/write" patch. such as pci_conf1_read became static...unreachable_devices() is gone.. YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
Yinghai Lu wrote: On Feb 10, 2008 12:45 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: On Sun, Feb 10, 2008 at 12:24:18PM -0800, Linus Torvalds wrote: On Sun, 10 Feb 2008, Yinghai Lu wrote: I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... I really don't care whether they get merges as one or separately, but I think it should be merged _now_ (-rc1 is already delayed), and I'd like to see the final versions of both. Does anybody have them in a final agreed-upon format (preferably with that oddness in quirk_intel_irqbalance also fixed?) I just looked at fixing that -- the reason seems to be that we don't actually have the struct pci_dev at that point. I can fix it, but I think it's actually buggy. I want to look at some chipset docs to confirm that though. I've attached the two patches that I believe are the ones we want. We can (and should) fix quirk_intel_irqbalance separately. Andrew, those two patch just got into linus 2.6.25-rc1. I assume that you will drop gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in -mm. please check some updated patches in -mm that could be affected. hope it could save you some time x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch I don't think any of these patches are affected. They all affect whether to use MMCONFIG globally or not, regardless of whether not particular accesses will use it. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 12:45 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > On Sun, Feb 10, 2008 at 12:24:18PM -0800, Linus Torvalds wrote: > > On Sun, 10 Feb 2008, Yinghai Lu wrote: > > > > > > > > I suggest Ivan's patch be merged ASAP as it actually fixes bugs. > > > > This patch is just cleanup (and takes care of some future concerns). > > > > > > your patch and Ivan's patch should be merged in one... > > > > I really don't care whether they get merges as one or separately, but I > > think it should be merged _now_ (-rc1 is already delayed), and I'd like to > > see the final versions of both. Does anybody have them in a final > > agreed-upon format (preferably with that oddness in quirk_intel_irqbalance > > also fixed?) > > I just looked at fixing that -- the reason seems to be that we don't > actually have the struct pci_dev at that point. I can fix it, but I > think it's actually buggy. I want to look at some chipset docs to > confirm that though. > > I've attached the two patches that I believe are the ones we want. We > can (and should) fix quirk_intel_irqbalance separately. Andrew, those two patch just got into linus 2.6.25-rc1. I assume that you will drop gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in -mm. please check some updated patches in -mm that could be affected. hope it could save you some time x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch YH x.tar.bz2 Description: BZip2 compressed data
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 12:32 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > On Sun, Feb 10, 2008 at 12:25:02PM -0800, Yinghai Lu wrote: > > Even Greg didn't know that there was another patch need to be applied > > before this one yesterday. > > I don't believe you. For example: > > On Mon, Jan 28, 2008 at 02:53:34PM -0800, Greg KH wrote: > > Please send me patches, in a form that can be merged, along with a > > proper changelog entry, in the order in which you wish them to be > > applied, so I know exactly what changes you are referring to. > > Which I then did. then you may need to send patches to Greg: So Grey or others don'e need to dig Ivan's patch [PATCH 0/2]... [PATCH 1/2]... Ivan's patch with from statement [PATCH 2/2] ... your patch YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
truct acpi_mcfg_allocation *cfg; int cfg_num; - if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS && - test_bit(PCI_SLOT(devfn) + 32*bus, pci_mmcfg_fallback_slots)) - return 0; - for (cfg_num = 0; cfg_num < pci_mmcfg_config_num; cfg_num++) { cfg = _mmcfg_config[cfg_num]; if (cfg->pci_segment == seg && @@ -68,13 +64,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, u32 base; if ((bus > 255) || (devfn > 255) || (reg > 4095)) { - *value = -1; +err: *value = -1; return -EINVAL; } + if (reg < 256) + return pci_conf1_read(seg,bus,devfn,reg,len,value); + base = get_base_addr(seg, bus, devfn); if (!base) - return pci_conf1_read(seg,bus,devfn,reg,len,value); + goto err; spin_lock_irqsave(_config_lock, flags); @@ -105,9 +104,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, if ((bus > 255) || (devfn > 255) || (reg > 4095)) return -EINVAL; + if (reg < 256) + return pci_conf1_write(seg,bus,devfn,reg,len,value); + base = get_base_addr(seg, bus, devfn); if (!base) - return pci_conf1_write(seg,bus,devfn,reg,len,value); + return -EINVAL; spin_lock_irqsave(_config_lock, flags); @@ -134,12 +136,6 @@ static struct pci_raw_ops pci_mmcfg = { .write =pci_mmcfg_write, }; -int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, - unsigned int devfn) -{ - return get_base_addr(seg, bus, devfn) != 0; -} - int __init pci_mmcfg_arch_init(void) { printk(KERN_INFO "PCI: Using MMCONFIG\n"); diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c index 4095e4d..c4cf318 100644 --- a/arch/x86/pci/mmconfig_64.c +++ b/arch/x86/pci/mmconfig_64.c @@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus) static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) { char __iomem *addr; - if (seg == 0 && bus < PCI_MMCFG_MAX_CHECK_BUS && - test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots)) - return NULL; + addr = get_virt(seg, bus); if (!addr) return NULL; @@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) { - *value = -1; +err: *value = -1; return -EINVAL; } + if (reg < 256) + return pci_conf1_read(seg,bus,devfn,reg,len,value); + addr = pci_dev_base(seg, bus, devfn); if (!addr) - return pci_conf1_read(seg,bus,devfn,reg,len,value); + goto err; switch (len) { case 1: @@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, if (unlikely((bus > 255) || (devfn > 255) || (reg > 4095))) return -EINVAL; + if (reg < 256) + return pci_conf1_write(seg,bus,devfn,reg,len,value); + addr = pci_dev_base(seg, bus, devfn); if (!addr) - return pci_conf1_write(seg,bus,devfn,reg,len,value); + return -EINVAL; switch (len) { case 1: @@ -126,12 +130,6 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg) return addr; } -int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, - unsigned int devfn) -{ - return pci_dev_base(seg, bus, devfn) != NULL; -} - int __init pci_mmcfg_arch_init(void) { int i; diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h index ac56d39..36cb44c 100644 --- a/arch/x86/pci/pci.h +++ b/arch/x86/pci/pci.h @@ -98,13 +98,6 @@ extern void pcibios_sort(void); /* pci-mmconfig.c */ -/* Verify the first 16 busses. We assume that systems with more busses - get MCFG right. */ -#define PCI_MMCFG_MAX_CHECK_BUS 16 -extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS); - -extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, - unsigned int devfn); extern int __init pci_mmcfg_arch_init(void); /* -- 1.5.2.5 >From ad4c3f135cda6f5210735231d30ef8e9dbd58c7c Mon Sep 17 00:00:00 2001 From: Matthew Wilcox <[EMAIL PROTECTED]> Date: Sun, 10 Feb 2008 09:45:28 -0500 Subject: [PATCH] Change pci_raw_ops to pci_raw_read/write We want to allow different implementations of pci_raw_ops for standard and extended config space on x86.
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 12:25:02PM -0800, Yinghai Lu wrote: > Even Greg didn't know that there was another patch need to be applied > before this one yesterday. I don't believe you. For example: On Mon, Jan 28, 2008 at 02:53:34PM -0800, Greg KH wrote: > Please send me patches, in a form that can be merged, along with a > proper changelog entry, in the order in which you wish them to be > applied, so I know exactly what changes you are referring to. Which I then did. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, 10 Feb 2008, Yinghai Lu wrote: > > > > I suggest Ivan's patch be merged ASAP as it actually fixes bugs. > > This patch is just cleanup (and takes care of some future concerns). > > your patch and Ivan's patch should be merged in one... I really don't care whether they get merges as one or separately, but I think it should be merged _now_ (-rc1 is already delayed), and I'd like to see the final versions of both. Does anybody have them in a final agreed-upon format (preferably with that oddness in quirk_intel_irqbalance also fixed?) Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 12:19 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > On Sun, Feb 10, 2008 at 12:16:43PM -0800, Yinghai Lu wrote: > > On Feb 10, 2008 6:51 AM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > > On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: > > > > Can I get a revised version of this, without the incorrect hunk? > > > > > > Sure. I've even rebased it against current HEAD. Damn whitespace > > > cleanup introducing unnecessary conflicts > > > > > > I suggest Ivan's patch be merged ASAP as it actually fixes bugs. > > > This patch is just cleanup (and takes care of some future concerns). > > > > your patch and Ivan's patch should be merged in one... > > Why? Even Greg didn't know that there was another patch need to be applied before this one yesterday. he said there was some hunks.. YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 12:16:43PM -0800, Yinghai Lu wrote: > On Feb 10, 2008 6:51 AM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: > > > Can I get a revised version of this, without the incorrect hunk? > > > > Sure. I've even rebased it against current HEAD. Damn whitespace > > cleanup introducing unnecessary conflicts > > > > I suggest Ivan's patch be merged ASAP as it actually fixes bugs. > > This patch is just cleanup (and takes care of some future concerns). > > your patch and Ivan's patch should be merged in one... Why? -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 6:51 AM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: > > Can I get a revised version of this, without the incorrect hunk? > > Sure. I've even rebased it against current HEAD. Damn whitespace > cleanup introducing unnecessary conflicts > > I suggest Ivan's patch be merged ASAP as it actually fixes bugs. > This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 12:13:13PM -0700, Grant Grundler wrote: > Just wondering...why don't we just pass "struct bus*" through to the > raw_pci* ops? > My thinking is if a PCI bus controller or bridge is discovered, then we should > always create a matching "struct bus *". ACPI may need to access PCI config space before we've done a PCI bus walk. There's an opregion that AML may access that is for PCI config space, and an apparently unrelated method might happen to contain such a piece of AML. > > --- a/arch/x86/kernel/quirks.c > > +++ b/arch/x86/kernel/quirks.c > > @@ -27,7 +27,7 @@ static void __devinit quirk_intel_irqbalance(struct > > pci_dev *dev) > > pci_write_config_byte(dev, 0xf4, config|0x2); > > > > /* read xTPR register */ > > - raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, ); > > + raw_pci_read(0, 0, 0x40, 0x4c, 2, ); > > Why are we using raw_pci_read here instead of pci_read_config_dword()? > If the pci_write_config_byte() above works, then I expect the read > to work too. I have no idea. I didn't want to change the semantics in this patch. Presumably the original author would have an idea why they needed to do this. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 07:51:22AM -0700, Matthew Wilcox wrote: > From: Matthew Wilcox <[EMAIL PROTECTED]> > Date: Sun, 10 Feb 2008 09:45:28 -0500 > Subject: [PATCH] Change pci_raw_ops to pci_raw_read/write ... > -static int > -pci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 > *value) > +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, > + int size, u32 *value) > { > - return raw_pci_ops->read(pci_domain_nr(bus), bus->number, > + return raw_pci_read(pci_domain_nr(bus), bus->number, >devfn, where, size, value); Willy, Just wondering...why don't we just pass "struct bus*" through to the raw_pci* ops? My thinking is if a PCI bus controller or bridge is discovered, then we should always create a matching "struct bus *". Your patch looks fine to me but if you (and others) agree with the above, I can make patch to change the internal interface. The pci_*_config API needs to remain the same. ... > --- a/arch/x86/kernel/quirks.c > +++ b/arch/x86/kernel/quirks.c > @@ -27,7 +27,7 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev > *dev) > pci_write_config_byte(dev, 0xf4, config|0x2); > > /* read xTPR register */ > - raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, ); > + raw_pci_read(0, 0, 0x40, 0x4c, 2, ); Why are we using raw_pci_read here instead of pci_read_config_dword()? If the pci_write_config_byte() above works, then I expect the read to work too. To be clear, this is not a problem with this patch...rather a seperate problem with the original code. hth, grant -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: > Can I get a revised version of this, without the incorrect hunk? Sure. I've even rebased it against current HEAD. Damn whitespace cleanup introducing unnecessary conflicts I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). >From ad4c3f135cda6f5210735231d30ef8e9dbd58c7c Mon Sep 17 00:00:00 2001 From: Matthew Wilcox <[EMAIL PROTECTED]> Date: Sun, 10 Feb 2008 09:45:28 -0500 Subject: [PATCH] Change pci_raw_ops to pci_raw_read/write We want to allow different implementations of pci_raw_ops for standard and extended config space on x86. Rather than clutter generic code with knowledge of this, we make pci_raw_ops private to x86 and use it to implement the new raw interface -- raw_pci_read() and raw_pci_write(). Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> --- arch/ia64/pci/pci.c | 25 - arch/ia64/sn/pci/tioce_provider.c | 16 arch/x86/kernel/quirks.c |2 +- arch/x86/pci/common.c | 25 +++-- arch/x86/pci/direct.c |4 ++-- arch/x86/pci/fixup.c |6 -- arch/x86/pci/legacy.c |2 +- arch/x86/pci/mmconfig-shared.c|6 +++--- arch/x86/pci/mmconfig_32.c| 10 ++ arch/x86/pci/mmconfig_64.c|8 +--- arch/x86/pci/pci.h| 15 +++ arch/x86/pci/visws.c |3 --- drivers/acpi/osl.c| 25 ++--- include/linux/pci.h | 16 14 files changed, 78 insertions(+), 85 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 488e48a..8fd7e82 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -43,8 +43,7 @@ #define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg) \ (((u64) seg << 28) | (bus << 20) | (devfn << 12) | (reg)) -static int -pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { u64 addr, data = 0; @@ -68,8 +67,7 @@ pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static int -pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { u64 addr; @@ -91,24 +89,17 @@ pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static struct pci_raw_ops pci_sal_ops = { - .read = pci_sal_read, - .write =pci_sal_write -}; - -struct pci_raw_ops *raw_pci_ops = _sal_ops; - -static int -pci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 *value) { - return raw_pci_ops->read(pci_domain_nr(bus), bus->number, + return raw_pci_read(pci_domain_nr(bus), bus->number, devfn, where, size, value); } -static int -pci_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) +static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 value) { - return raw_pci_ops->write(pci_domain_nr(bus), bus->number, + return raw_pci_write(pci_domain_nr(bus), bus->number, devfn, where, size, value); } diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c index e1a3e19..999f14f 100644 --- a/arch/ia64/sn/pci/tioce_provider.c +++ b/arch/ia64/sn/pci/tioce_provider.c @@ -752,13 +752,13 @@ tioce_kern_init(struct tioce_common *tioce_common) * Determine the secondary bus number of the port2 logical PPB. * This is used to decide whether a given pci device resides on * port1 or port2. Note: We don't have enough plumbing set up -* here to use pci_read_config_xxx() so use the raw_pci_ops vector. +* here to use pci_read_config_xxx() so use raw_pci_read(). */ seg = tioce_common->ce_pcibus.bs_persist_segment; bus = tioce_common->ce_pcibus.bs_persist_busnum; - raw_pci_ops->read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,); + raw_pci_read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,); tioce_kern->ce_port1_secondary = (u8) tmp; /* @@ -799,11 +799,11 @@ tioce_kern_init(struct tioce_common *tioce_common) /* mem base/limit */ - raw_pci_ops->read(seg, bus, PCI_D
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: Can I get a revised version of this, without the incorrect hunk? Sure. I've even rebased it against current HEAD. Damn whitespace cleanup introducing unnecessary conflicts I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). From ad4c3f135cda6f5210735231d30ef8e9dbd58c7c Mon Sep 17 00:00:00 2001 From: Matthew Wilcox [EMAIL PROTECTED] Date: Sun, 10 Feb 2008 09:45:28 -0500 Subject: [PATCH] Change pci_raw_ops to pci_raw_read/write We want to allow different implementations of pci_raw_ops for standard and extended config space on x86. Rather than clutter generic code with knowledge of this, we make pci_raw_ops private to x86 and use it to implement the new raw interface -- raw_pci_read() and raw_pci_write(). Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- arch/ia64/pci/pci.c | 25 - arch/ia64/sn/pci/tioce_provider.c | 16 arch/x86/kernel/quirks.c |2 +- arch/x86/pci/common.c | 25 +++-- arch/x86/pci/direct.c |4 ++-- arch/x86/pci/fixup.c |6 -- arch/x86/pci/legacy.c |2 +- arch/x86/pci/mmconfig-shared.c|6 +++--- arch/x86/pci/mmconfig_32.c| 10 ++ arch/x86/pci/mmconfig_64.c|8 +--- arch/x86/pci/pci.h| 15 +++ arch/x86/pci/visws.c |3 --- drivers/acpi/osl.c| 25 ++--- include/linux/pci.h | 16 14 files changed, 78 insertions(+), 85 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 488e48a..8fd7e82 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -43,8 +43,7 @@ #define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg) \ (((u64) seg 28) | (bus 20) | (devfn 12) | (reg)) -static int -pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { u64 addr, data = 0; @@ -68,8 +67,7 @@ pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static int -pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { u64 addr; @@ -91,24 +89,17 @@ pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static struct pci_raw_ops pci_sal_ops = { - .read = pci_sal_read, - .write =pci_sal_write -}; - -struct pci_raw_ops *raw_pci_ops = pci_sal_ops; - -static int -pci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 *value) { - return raw_pci_ops-read(pci_domain_nr(bus), bus-number, + return raw_pci_read(pci_domain_nr(bus), bus-number, devfn, where, size, value); } -static int -pci_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) +static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 value) { - return raw_pci_ops-write(pci_domain_nr(bus), bus-number, + return raw_pci_write(pci_domain_nr(bus), bus-number, devfn, where, size, value); } diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c index e1a3e19..999f14f 100644 --- a/arch/ia64/sn/pci/tioce_provider.c +++ b/arch/ia64/sn/pci/tioce_provider.c @@ -752,13 +752,13 @@ tioce_kern_init(struct tioce_common *tioce_common) * Determine the secondary bus number of the port2 logical PPB. * This is used to decide whether a given pci device resides on * port1 or port2. Note: We don't have enough plumbing set up -* here to use pci_read_config_xxx() so use the raw_pci_ops vector. +* here to use pci_read_config_xxx() so use raw_pci_read(). */ seg = tioce_common-ce_pcibus.bs_persist_segment; bus = tioce_common-ce_pcibus.bs_persist_busnum; - raw_pci_ops-read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,tmp); + raw_pci_read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,tmp); tioce_kern-ce_port1_secondary = (u8) tmp; /* @@ -799,11 +799,11 @@ tioce_kern_init(struct tioce_common *tioce_common) /* mem base/limit */ - raw_pci_ops-read(seg, bus, PCI_DEVFN(dev, 0), + raw_pci_read(seg, bus, PCI_DEVFN(dev, 0
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 07:51:22AM -0700, Matthew Wilcox wrote: From: Matthew Wilcox [EMAIL PROTECTED] Date: Sun, 10 Feb 2008 09:45:28 -0500 Subject: [PATCH] Change pci_raw_ops to pci_raw_read/write ... -static int -pci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 *value) { - return raw_pci_ops-read(pci_domain_nr(bus), bus-number, + return raw_pci_read(pci_domain_nr(bus), bus-number, devfn, where, size, value); Willy, Just wondering...why don't we just pass struct bus* through to the raw_pci* ops? My thinking is if a PCI bus controller or bridge is discovered, then we should always create a matching struct bus *. Your patch looks fine to me but if you (and others) agree with the above, I can make patch to change the internal interface. The pci_*_config API needs to remain the same. ... --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -27,7 +27,7 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) pci_write_config_byte(dev, 0xf4, config|0x2); /* read xTPR register */ - raw_pci_ops-read(0, 0, 0x40, 0x4c, 2, word); + raw_pci_read(0, 0, 0x40, 0x4c, 2, word); Why are we using raw_pci_read here instead of pci_read_config_dword()? If the pci_write_config_byte() above works, then I expect the read to work too. To be clear, this is not a problem with this patch...rather a seperate problem with the original code. hth, grant -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 12:13:13PM -0700, Grant Grundler wrote: Just wondering...why don't we just pass struct bus* through to the raw_pci* ops? My thinking is if a PCI bus controller or bridge is discovered, then we should always create a matching struct bus *. ACPI may need to access PCI config space before we've done a PCI bus walk. There's an opregion that AML may access that is for PCI config space, and an apparently unrelated method might happen to contain such a piece of AML. --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -27,7 +27,7 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) pci_write_config_byte(dev, 0xf4, config|0x2); /* read xTPR register */ - raw_pci_ops-read(0, 0, 0x40, 0x4c, 2, word); + raw_pci_read(0, 0, 0x40, 0x4c, 2, word); Why are we using raw_pci_read here instead of pci_read_config_dword()? If the pci_write_config_byte() above works, then I expect the read to work too. I have no idea. I didn't want to change the semantics in this patch. Presumably the original author would have an idea why they needed to do this. -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, 10 Feb 2008, Yinghai Lu wrote: I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... I really don't care whether they get merges as one or separately, but I think it should be merged _now_ (-rc1 is already delayed), and I'd like to see the final versions of both. Does anybody have them in a final agreed-upon format (preferably with that oddness in quirk_intel_irqbalance also fixed?) Linus -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 12:19 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sun, Feb 10, 2008 at 12:16:43PM -0800, Yinghai Lu wrote: On Feb 10, 2008 6:51 AM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: Can I get a revised version of this, without the incorrect hunk? Sure. I've even rebased it against current HEAD. Damn whitespace cleanup introducing unnecessary conflicts I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... Why? Even Greg didn't know that there was another patch need to be applied before this one yesterday. he said there was some hunks.. YH -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 6:51 AM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: Can I get a revised version of this, without the incorrect hunk? Sure. I've even rebased it against current HEAD. Damn whitespace cleanup introducing unnecessary conflicts I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... YH -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 12:16:43PM -0800, Yinghai Lu wrote: On Feb 10, 2008 6:51 AM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sat, Feb 09, 2008 at 11:21:16PM -0800, Greg KH wrote: Can I get a revised version of this, without the incorrect hunk? Sure. I've even rebased it against current HEAD. Damn whitespace cleanup introducing unnecessary conflicts I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... Why? -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
, pci_mmcfg_fallback_slots)) - return 0; - for (cfg_num = 0; cfg_num pci_mmcfg_config_num; cfg_num++) { cfg = pci_mmcfg_config[cfg_num]; if (cfg-pci_segment == seg @@ -68,13 +64,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, u32 base; if ((bus 255) || (devfn 255) || (reg 4095)) { - *value = -1; +err: *value = -1; return -EINVAL; } + if (reg 256) + return pci_conf1_read(seg,bus,devfn,reg,len,value); + base = get_base_addr(seg, bus, devfn); if (!base) - return pci_conf1_read(seg,bus,devfn,reg,len,value); + goto err; spin_lock_irqsave(pci_config_lock, flags); @@ -105,9 +104,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, if ((bus 255) || (devfn 255) || (reg 4095)) return -EINVAL; + if (reg 256) + return pci_conf1_write(seg,bus,devfn,reg,len,value); + base = get_base_addr(seg, bus, devfn); if (!base) - return pci_conf1_write(seg,bus,devfn,reg,len,value); + return -EINVAL; spin_lock_irqsave(pci_config_lock, flags); @@ -134,12 +136,6 @@ static struct pci_raw_ops pci_mmcfg = { .write =pci_mmcfg_write, }; -int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, - unsigned int devfn) -{ - return get_base_addr(seg, bus, devfn) != 0; -} - int __init pci_mmcfg_arch_init(void) { printk(KERN_INFO PCI: Using MMCONFIG\n); diff --git a/arch/x86/pci/mmconfig_64.c b/arch/x86/pci/mmconfig_64.c index 4095e4d..c4cf318 100644 --- a/arch/x86/pci/mmconfig_64.c +++ b/arch/x86/pci/mmconfig_64.c @@ -40,9 +40,7 @@ static char __iomem *get_virt(unsigned int seg, unsigned bus) static char __iomem *pci_dev_base(unsigned int seg, unsigned int bus, unsigned int devfn) { char __iomem *addr; - if (seg == 0 bus PCI_MMCFG_MAX_CHECK_BUS - test_bit(32*bus + PCI_SLOT(devfn), pci_mmcfg_fallback_slots)) - return NULL; + addr = get_virt(seg, bus); if (!addr) return NULL; @@ -56,13 +54,16 @@ static int pci_mmcfg_read(unsigned int seg, unsigned int bus, /* Why do we have this when nobody checks it. How about a BUG()!? -AK */ if (unlikely((bus 255) || (devfn 255) || (reg 4095))) { - *value = -1; +err: *value = -1; return -EINVAL; } + if (reg 256) + return pci_conf1_read(seg,bus,devfn,reg,len,value); + addr = pci_dev_base(seg, bus, devfn); if (!addr) - return pci_conf1_read(seg,bus,devfn,reg,len,value); + goto err; switch (len) { case 1: @@ -88,9 +89,12 @@ static int pci_mmcfg_write(unsigned int seg, unsigned int bus, if (unlikely((bus 255) || (devfn 255) || (reg 4095))) return -EINVAL; + if (reg 256) + return pci_conf1_write(seg,bus,devfn,reg,len,value); + addr = pci_dev_base(seg, bus, devfn); if (!addr) - return pci_conf1_write(seg,bus,devfn,reg,len,value); + return -EINVAL; switch (len) { case 1: @@ -126,12 +130,6 @@ static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg) return addr; } -int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, - unsigned int devfn) -{ - return pci_dev_base(seg, bus, devfn) != NULL; -} - int __init pci_mmcfg_arch_init(void) { int i; diff --git a/arch/x86/pci/pci.h b/arch/x86/pci/pci.h index ac56d39..36cb44c 100644 --- a/arch/x86/pci/pci.h +++ b/arch/x86/pci/pci.h @@ -98,13 +98,6 @@ extern void pcibios_sort(void); /* pci-mmconfig.c */ -/* Verify the first 16 busses. We assume that systems with more busses - get MCFG right. */ -#define PCI_MMCFG_MAX_CHECK_BUS 16 -extern DECLARE_BITMAP(pci_mmcfg_fallback_slots, 32*PCI_MMCFG_MAX_CHECK_BUS); - -extern int __init pci_mmcfg_arch_reachable(unsigned int seg, unsigned int bus, - unsigned int devfn); extern int __init pci_mmcfg_arch_init(void); /* -- 1.5.2.5 From ad4c3f135cda6f5210735231d30ef8e9dbd58c7c Mon Sep 17 00:00:00 2001 From: Matthew Wilcox [EMAIL PROTECTED] Date: Sun, 10 Feb 2008 09:45:28 -0500 Subject: [PATCH] Change pci_raw_ops to pci_raw_read/write We want to allow different implementations of pci_raw_ops for standard and extended config space on x86. Rather than clutter generic code with knowledge of this, we make pci_raw_ops private to x86 and use it to implement the new raw interface -- raw_pci_read() and raw_pci_write(). Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- arch/ia64/pci/pci.c | 25 - arch/ia64/sn
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sun, Feb 10, 2008 at 12:25:02PM -0800, Yinghai Lu wrote: Even Greg didn't know that there was another patch need to be applied before this one yesterday. I don't believe you. For example: On Mon, Jan 28, 2008 at 02:53:34PM -0800, Greg KH wrote: Please send me patches, in a form that can be merged, along with a proper changelog entry, in the order in which you wish them to be applied, so I know exactly what changes you are referring to. Which I then did. -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 12:32 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sun, Feb 10, 2008 at 12:25:02PM -0800, Yinghai Lu wrote: Even Greg didn't know that there was another patch need to be applied before this one yesterday. I don't believe you. For example: On Mon, Jan 28, 2008 at 02:53:34PM -0800, Greg KH wrote: Please send me patches, in a form that can be merged, along with a proper changelog entry, in the order in which you wish them to be applied, so I know exactly what changes you are referring to. Which I then did. then you may need to send patches to Greg: So Grey or others don'e need to dig Ivan's patch [PATCH 0/2]... [PATCH 1/2]... Ivan's patch with from statement [PATCH 2/2] ... your patch YH -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 12:45 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sun, Feb 10, 2008 at 12:24:18PM -0800, Linus Torvalds wrote: On Sun, 10 Feb 2008, Yinghai Lu wrote: I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... I really don't care whether they get merges as one or separately, but I think it should be merged _now_ (-rc1 is already delayed), and I'd like to see the final versions of both. Does anybody have them in a final agreed-upon format (preferably with that oddness in quirk_intel_irqbalance also fixed?) I just looked at fixing that -- the reason seems to be that we don't actually have the struct pci_dev at that point. I can fix it, but I think it's actually buggy. I want to look at some chipset docs to confirm that though. I've attached the two patches that I believe are the ones we want. We can (and should) fix quirk_intel_irqbalance separately. Andrew, those two patch just got into linus 2.6.25-rc1. I assume that you will drop gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in -mm. please check some updated patches in -mm that could be affected. hope it could save you some time x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch YH x.tar.bz2 Description: BZip2 compressed data
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
Yinghai Lu wrote: On Feb 10, 2008 12:45 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Sun, Feb 10, 2008 at 12:24:18PM -0800, Linus Torvalds wrote: On Sun, 10 Feb 2008, Yinghai Lu wrote: I suggest Ivan's patch be merged ASAP as it actually fixes bugs. This patch is just cleanup (and takes care of some future concerns). your patch and Ivan's patch should be merged in one... I really don't care whether they get merges as one or separately, but I think it should be merged _now_ (-rc1 is already delayed), and I'd like to see the final versions of both. Does anybody have them in a final agreed-upon format (preferably with that oddness in quirk_intel_irqbalance also fixed?) I just looked at fixing that -- the reason seems to be that we don't actually have the struct pci_dev at that point. I can fix it, but I think it's actually buggy. I want to look at some chipset docs to confirm that though. I've attached the two patches that I believe are the ones we want. We can (and should) fix quirk_intel_irqbalance separately. Andrew, those two patch just got into linus 2.6.25-rc1. I assume that you will drop gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in -mm. please check some updated patches in -mm that could be affected. hope it could save you some time x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch I don't think any of these patches are affected. They all affect whether to use MMCONFIG globally or not, regardless of whether not particular accesses will use it. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 10, 2008 6:53 PM, Robert Hancock [EMAIL PROTECTED] wrote: Yinghai Lu wrote: On Feb 10, 2008 12:45 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: .. I've attached the two patches that I believe are the ones we want. We can (and should) fix quirk_intel_irqbalance separately. Andrew, those two patch just got into linus 2.6.25-rc1. I assume that you will drop gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch in -mm. please check some updated patches in -mm that could be affected. hope it could save you some time x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch I don't think any of these patches are affected. They all affect whether to use MMCONFIG globally or not, regardless of whether not particular accesses will use it. what i mean: gregkh-pci-pci-make-pci-extended-config-space-a-driver-opt-in.patch is not needed. and x86-validate-against-acpi-motherboard-resources.patch x86-clear-pci_mmcfg_virt-when-mmcfg-get-rejected.patch x86-mmconf-enable-mcfg-early.patch x86_64-check-msr-to-get-mmconfig-for-amd-family-10h-opteron-v3.patch need some update because of changes by Change pci_raw_ops to pci_raw_read/write patch. such as pci_conf1_read became static...unreachable_devices() is gone.. YH -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sat, Feb 09, 2008 at 10:25:23PM -0800, Yinghai Lu wrote: > On Feb 9, 2008 4:41 AM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > On Thu, Feb 07, 2008 at 10:54:05AM -0500, Tony Camuso wrote: > > > Matthew, > > > > > > Perhaps I missed it, but did you address Yinghai's concerns? > > > > No, I was on holiday. > > > > > Yinghai Lu wrote: > > > >On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > > >> > > > >>-int pci_conf1_write(unsigned int seg, unsigned int bus, > > > >>+static int pci_conf1_write(unsigned int seg, unsigned int bus, > > > >> unsigned int devfn, int reg, int len, u32 > > > >> value) > > > > > > > >any reason to change pci_conf1_read/write to static? > > > > Yes -- it no longer needs to be called from outside this file. > > > > > >>+config ATA_RAM > > > >>+ tristate "ATA RAM driver" > > > >>+ > > > > > > > >related? > > > > looks good. it should get into -mm or x86/mm for some testing Can I get a revised version of this, without the incorrect hunk? thanks, greg k-h -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 9, 2008 4:41 AM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > On Thu, Feb 07, 2008 at 10:54:05AM -0500, Tony Camuso wrote: > > Matthew, > > > > Perhaps I missed it, but did you address Yinghai's concerns? > > No, I was on holiday. > > > Yinghai Lu wrote: > > >On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > >> > > >>-int pci_conf1_write(unsigned int seg, unsigned int bus, > > >>+static int pci_conf1_write(unsigned int seg, unsigned int bus, > > >> unsigned int devfn, int reg, int len, u32 > > >> value) > > > > > >any reason to change pci_conf1_read/write to static? > > Yes -- it no longer needs to be called from outside this file. > > > >>+config ATA_RAM > > >>+ tristate "ATA RAM driver" > > >>+ > > > > > >related? > looks good. it should get into -mm or x86/mm for some testing YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Thu, Feb 07, 2008 at 10:54:05AM -0500, Tony Camuso wrote: > Matthew, > > Perhaps I missed it, but did you address Yinghai's concerns? No, I was on holiday. > Yinghai Lu wrote: > >On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > >> > >>-int pci_conf1_write(unsigned int seg, unsigned int bus, > >>+static int pci_conf1_write(unsigned int seg, unsigned int bus, > >> unsigned int devfn, int reg, int len, u32 > >> value) > > > >any reason to change pci_conf1_read/write to static? Yes -- it no longer needs to be called from outside this file. > >>+config ATA_RAM > >>+ tristate "ATA RAM driver" > >>+ > > > >related? No. An unrelated patch that I didn't trim out. -- Intel are signing my paycheques ... these opinions are still mine "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Thu, Feb 07, 2008 at 10:54:05AM -0500, Tony Camuso wrote: Matthew, Perhaps I missed it, but did you address Yinghai's concerns? No, I was on holiday. Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) any reason to change pci_conf1_read/write to static? Yes -- it no longer needs to be called from outside this file. +config ATA_RAM + tristate ATA RAM driver + related? No. An unrelated patch that I didn't trim out. -- Intel are signing my paycheques ... these opinions are still mine Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step. -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Feb 9, 2008 4:41 AM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Thu, Feb 07, 2008 at 10:54:05AM -0500, Tony Camuso wrote: Matthew, Perhaps I missed it, but did you address Yinghai's concerns? No, I was on holiday. Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) any reason to change pci_conf1_read/write to static? Yes -- it no longer needs to be called from outside this file. +config ATA_RAM + tristate ATA RAM driver + related? looks good. it should get into -mm or x86/mm for some testing YH -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Sat, Feb 09, 2008 at 10:25:23PM -0800, Yinghai Lu wrote: On Feb 9, 2008 4:41 AM, Matthew Wilcox [EMAIL PROTECTED] wrote: On Thu, Feb 07, 2008 at 10:54:05AM -0500, Tony Camuso wrote: Matthew, Perhaps I missed it, but did you address Yinghai's concerns? No, I was on holiday. Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) any reason to change pci_conf1_read/write to static? Yes -- it no longer needs to be called from outside this file. +config ATA_RAM + tristate ATA RAM driver + related? looks good. it should get into -mm or x86/mm for some testing Can I get a revised version of this, without the incorrect hunk? thanks, greg k-h -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Thu, Feb 07, 2008 at 11:36:18AM -0500, Tony Camuso wrote: > Arjan van de Ven wrote: >> On Thu, 07 Feb 2008 10:54:05 -0500 >> Tony Camuso <[EMAIL PROTECTED]> wrote: >>> Matthew, >>> >>> Perhaps I missed it, but did you address Yinghai's concerns? >>> >>> Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > -int pci_conf1_write(unsigned int seg, unsigned int bus, > +static int pci_conf1_write(unsigned int seg, unsigned int bus, >unsigned int devfn, int reg, int len, > u32 value) any reason to change pci_conf1_read/write to static? >> nothing should use these directly. So static is the right answer ;) > > Agreed. Thanks, Arjan. > > Matthew, > What about the ATA_RAM addition to Kconfig? Was it accidental, > or intended? If intended, how is it related? AFAICT, it looks accidental. I can't see how it's related. He should be back online next week and can answer for himself. hth, grant -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
Arjan van de Ven wrote: On Thu, 07 Feb 2008 10:54:05 -0500 Tony Camuso <[EMAIL PROTECTED]> wrote: Matthew, Perhaps I missed it, but did you address Yinghai's concerns? Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) any reason to change pci_conf1_read/write to static? nothing should use these directly. So static is the right answer ;) Agreed. Thanks, Arjan. Matthew, What about the ATA_RAM addition to Kconfig? Was it accidental, or intended? If intended, how is it related? -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Thu, 07 Feb 2008 10:54:05 -0500 Tony Camuso <[EMAIL PROTECTED]> wrote: > Matthew, > > Perhaps I missed it, but did you address Yinghai's concerns? > > Yinghai Lu wrote: > > On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > >> > >> -int pci_conf1_write(unsigned int seg, unsigned int bus, > >> +static int pci_conf1_write(unsigned int seg, unsigned int bus, > >>unsigned int devfn, int reg, int len, > >> u32 value) > > > > any reason to change pci_conf1_read/write to static? > > > nothing should use these directly. So static is the right answer ;) -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
Matthew, Perhaps I missed it, but did you address Yinghai's concerns? Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) any reason to change pci_conf1_read/write to static? +config ATA_RAM + tristate "ATA RAM driver" + related? YH -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Thu, 07 Feb 2008 10:54:05 -0500 Tony Camuso [EMAIL PROTECTED] wrote: Matthew, Perhaps I missed it, but did you address Yinghai's concerns? Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) any reason to change pci_conf1_read/write to static? nothing should use these directly. So static is the right answer ;) -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Thu, Feb 07, 2008 at 11:36:18AM -0500, Tony Camuso wrote: Arjan van de Ven wrote: On Thu, 07 Feb 2008 10:54:05 -0500 Tony Camuso [EMAIL PROTECTED] wrote: Matthew, Perhaps I missed it, but did you address Yinghai's concerns? Yinghai Lu wrote: On Jan 28, 2008 7:03 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) any reason to change pci_conf1_read/write to static? nothing should use these directly. So static is the right answer ;) Agreed. Thanks, Arjan. Matthew, What about the ATA_RAM addition to Kconfig? Was it accidental, or intended? If intended, how is it related? AFAICT, it looks accidental. I can't see how it's related. He should be back online next week and can answer for himself. hth, grant -- To unsubscribe from this list: send the line unsubscribe linux-kernel in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Jan 28, 2008 7:03 PM, Matthew Wilcox <[EMAIL PROTECTED]> wrote: > > We want to allow different implementations of pci_raw_ops for standard > and extended config space on x86. Rather than clutter generic code with > knowledge of this, we make pci_raw_ops private to x86 and use it to > implement the new raw interface -- raw_pci_read() and raw_pci_write(). > > Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> > --- > arch/ia64/pci/pci.c | 25 - > arch/ia64/sn/pci/tioce_provider.c | 16 > arch/x86/kernel/quirks.c |2 +- > arch/x86/pci/common.c | 25 +++-- > arch/x86/pci/direct.c |4 ++-- > arch/x86/pci/fixup.c |6 -- > arch/x86/pci/legacy.c |2 +- > arch/x86/pci/mmconfig-shared.c|6 +++--- > arch/x86/pci/mmconfig_32.c| 10 ++ > arch/x86/pci/mmconfig_64.c|8 +--- > arch/x86/pci/pci.h| 15 +++ > arch/x86/pci/visws.c |3 --- > drivers/acpi/osl.c| 25 ++--- > drivers/ata/Kconfig |3 +++ > drivers/ata/Makefile |3 +++ > include/linux/pci.h | 16 > 16 files changed, 84 insertions(+), 85 deletions(-) > ... > > diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c > index fab30e1..7f73f7c 100644 > --- a/arch/x86/kernel/quirks.c > +++ b/arch/x86/kernel/quirks.c > @@ -27,7 +27,7 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev > *dev) > pci_write_config_byte(dev, 0xf4, config|0x2); > > /* read xTPR register */ > - raw_pci_ops->read(0, 0, 0x40, 0x4c, 2, ); > + raw_pci_read(0, 0, 0x40, 0x4c, 2, ); > > if (!(word & (1 << 13))) { > printk(KERN_INFO "Intel E7520/7320/7525 detected. " > diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c > index 8627463..f2bd9f3 100644 > --- a/arch/x86/pci/common.c > +++ b/arch/x86/pci/common.c > @@ -26,16 +26,37 @@ int pcibios_last_bus = -1; > unsigned long pirq_table_addr; > struct pci_bus *pci_root_bus; > struct pci_raw_ops *raw_pci_ops; > +struct pci_raw_ops *raw_pci_ext_ops; > + > +int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, > + int reg, int len, u32 *val) > +{ > + if (reg < 256 && raw_pci_ops) > + return raw_pci_ops->read(domain, bus, devfn, reg, len, val); > + if (raw_pci_ext_ops) > + return raw_pci_ext_ops->read(domain, bus, devfn, reg, len, > val); > + return -EINVAL; > +} > + > +int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, > + int reg, int len, u32 val) > +{ > + if (reg < 256 && raw_pci_ops) > + return raw_pci_ops->write(domain, bus, devfn, reg, len, val); > + if (raw_pci_ext_ops) > + return raw_pci_ext_ops->write(domain, bus, devfn, reg, len, > val); > + return -EINVAL; > +} > > static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int > size, u32 *value) > { > - return raw_pci_ops->read(pci_domain_nr(bus), bus->number, > + return raw_pci_read(pci_domain_nr(bus), bus->number, > devfn, where, size, value); > } > > static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int > size, u32 value) > { > - return raw_pci_ops->write(pci_domain_nr(bus), bus->number, > + return raw_pci_write(pci_domain_nr(bus), bus->number, > devfn, where, size, value); > } > > diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c > index 431c9a5..42f3e4c 100644 > --- a/arch/x86/pci/direct.c > +++ b/arch/x86/pci/direct.c > @@ -14,7 +14,7 @@ > #define PCI_CONF1_ADDRESS(bus, devfn, reg) \ > (0x8000 | (bus << 16) | (devfn << 8) | (reg & ~3)) > > -int pci_conf1_read(unsigned int seg, unsigned int bus, > +static int pci_conf1_read(unsigned int seg, unsigned int bus, > unsigned int devfn, int reg, int len, u32 *value) > { > unsigned long flags; > @@ -45,7 +45,7 @@ int pci_conf1_read(unsigned int seg, unsigned int bus, > return 0; > } > > -int pci_conf1_write(unsigned int seg, unsigned int bus, > +static int pci_conf1_write(unsigned int seg, unsigned int bus, >unsigned int devfn, int reg, int len, u32 value) > { > unsigned long flags; any reason to change pci_conf1_read/write to static? > diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c > index 6cff66d..b31cd6a 100644 > --- a/arch/x86/pci/fixup.c > +++ b/arch/x86/pci/fixup.c > @@ -215,7 +215,8 @@ static int quirk_aspm_offset[MAX_PCIEROOT << 3]; > > static int quirk_pcie_aspm_read(struct pci_bus *bus, unsigned int devfn, int > where, int
Re: [PATCH] Change pci_raw_ops to pci_raw_read/write
On Jan 28, 2008 7:03 PM, Matthew Wilcox [EMAIL PROTECTED] wrote: We want to allow different implementations of pci_raw_ops for standard and extended config space on x86. Rather than clutter generic code with knowledge of this, we make pci_raw_ops private to x86 and use it to implement the new raw interface -- raw_pci_read() and raw_pci_write(). Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- arch/ia64/pci/pci.c | 25 - arch/ia64/sn/pci/tioce_provider.c | 16 arch/x86/kernel/quirks.c |2 +- arch/x86/pci/common.c | 25 +++-- arch/x86/pci/direct.c |4 ++-- arch/x86/pci/fixup.c |6 -- arch/x86/pci/legacy.c |2 +- arch/x86/pci/mmconfig-shared.c|6 +++--- arch/x86/pci/mmconfig_32.c| 10 ++ arch/x86/pci/mmconfig_64.c|8 +--- arch/x86/pci/pci.h| 15 +++ arch/x86/pci/visws.c |3 --- drivers/acpi/osl.c| 25 ++--- drivers/ata/Kconfig |3 +++ drivers/ata/Makefile |3 +++ include/linux/pci.h | 16 16 files changed, 84 insertions(+), 85 deletions(-) ... diff --git a/arch/x86/kernel/quirks.c b/arch/x86/kernel/quirks.c index fab30e1..7f73f7c 100644 --- a/arch/x86/kernel/quirks.c +++ b/arch/x86/kernel/quirks.c @@ -27,7 +27,7 @@ static void __devinit quirk_intel_irqbalance(struct pci_dev *dev) pci_write_config_byte(dev, 0xf4, config|0x2); /* read xTPR register */ - raw_pci_ops-read(0, 0, 0x40, 0x4c, 2, word); + raw_pci_read(0, 0, 0x40, 0x4c, 2, word); if (!(word (1 13))) { printk(KERN_INFO Intel E7520/7320/7525 detected. diff --git a/arch/x86/pci/common.c b/arch/x86/pci/common.c index 8627463..f2bd9f3 100644 --- a/arch/x86/pci/common.c +++ b/arch/x86/pci/common.c @@ -26,16 +26,37 @@ int pcibios_last_bus = -1; unsigned long pirq_table_addr; struct pci_bus *pci_root_bus; struct pci_raw_ops *raw_pci_ops; +struct pci_raw_ops *raw_pci_ext_ops; + +int raw_pci_read(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 *val) +{ + if (reg 256 raw_pci_ops) + return raw_pci_ops-read(domain, bus, devfn, reg, len, val); + if (raw_pci_ext_ops) + return raw_pci_ext_ops-read(domain, bus, devfn, reg, len, val); + return -EINVAL; +} + +int raw_pci_write(unsigned int domain, unsigned int bus, unsigned int devfn, + int reg, int len, u32 val) +{ + if (reg 256 raw_pci_ops) + return raw_pci_ops-write(domain, bus, devfn, reg, len, val); + if (raw_pci_ext_ops) + return raw_pci_ext_ops-write(domain, bus, devfn, reg, len, val); + return -EINVAL; +} static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) { - return raw_pci_ops-read(pci_domain_nr(bus), bus-number, + return raw_pci_read(pci_domain_nr(bus), bus-number, devfn, where, size, value); } static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) { - return raw_pci_ops-write(pci_domain_nr(bus), bus-number, + return raw_pci_write(pci_domain_nr(bus), bus-number, devfn, where, size, value); } diff --git a/arch/x86/pci/direct.c b/arch/x86/pci/direct.c index 431c9a5..42f3e4c 100644 --- a/arch/x86/pci/direct.c +++ b/arch/x86/pci/direct.c @@ -14,7 +14,7 @@ #define PCI_CONF1_ADDRESS(bus, devfn, reg) \ (0x8000 | (bus 16) | (devfn 8) | (reg ~3)) -int pci_conf1_read(unsigned int seg, unsigned int bus, +static int pci_conf1_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { unsigned long flags; @@ -45,7 +45,7 @@ int pci_conf1_read(unsigned int seg, unsigned int bus, return 0; } -int pci_conf1_write(unsigned int seg, unsigned int bus, +static int pci_conf1_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { unsigned long flags; any reason to change pci_conf1_read/write to static? diff --git a/arch/x86/pci/fixup.c b/arch/x86/pci/fixup.c index 6cff66d..b31cd6a 100644 --- a/arch/x86/pci/fixup.c +++ b/arch/x86/pci/fixup.c @@ -215,7 +215,8 @@ static int quirk_aspm_offset[MAX_PCIEROOT 3]; static int quirk_pcie_aspm_read(struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) { - return raw_pci_ops-read(0, bus-number, devfn, where, size, value); + return raw_pci_read(pci_domain_nr(bus),
[PATCH] Change pci_raw_ops to pci_raw_read/write
We want to allow different implementations of pci_raw_ops for standard and extended config space on x86. Rather than clutter generic code with knowledge of this, we make pci_raw_ops private to x86 and use it to implement the new raw interface -- raw_pci_read() and raw_pci_write(). Signed-off-by: Matthew Wilcox <[EMAIL PROTECTED]> --- arch/ia64/pci/pci.c | 25 - arch/ia64/sn/pci/tioce_provider.c | 16 arch/x86/kernel/quirks.c |2 +- arch/x86/pci/common.c | 25 +++-- arch/x86/pci/direct.c |4 ++-- arch/x86/pci/fixup.c |6 -- arch/x86/pci/legacy.c |2 +- arch/x86/pci/mmconfig-shared.c|6 +++--- arch/x86/pci/mmconfig_32.c| 10 ++ arch/x86/pci/mmconfig_64.c|8 +--- arch/x86/pci/pci.h| 15 +++ arch/x86/pci/visws.c |3 --- drivers/acpi/osl.c| 25 ++--- drivers/ata/Kconfig |3 +++ drivers/ata/Makefile |3 +++ include/linux/pci.h | 16 16 files changed, 84 insertions(+), 85 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 488e48a..8fd7e82 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -43,8 +43,7 @@ #define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg) \ (((u64) seg << 28) | (bus << 20) | (devfn << 12) | (reg)) -static int -pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { u64 addr, data = 0; @@ -68,8 +67,7 @@ pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static int -pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { u64 addr; @@ -91,24 +89,17 @@ pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static struct pci_raw_ops pci_sal_ops = { - .read = pci_sal_read, - .write =pci_sal_write -}; - -struct pci_raw_ops *raw_pci_ops = _sal_ops; - -static int -pci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 *value) { - return raw_pci_ops->read(pci_domain_nr(bus), bus->number, + return raw_pci_read(pci_domain_nr(bus), bus->number, devfn, where, size, value); } -static int -pci_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) +static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 value) { - return raw_pci_ops->write(pci_domain_nr(bus), bus->number, + return raw_pci_write(pci_domain_nr(bus), bus->number, devfn, where, size, value); } diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c index e1a3e19..999f14f 100644 --- a/arch/ia64/sn/pci/tioce_provider.c +++ b/arch/ia64/sn/pci/tioce_provider.c @@ -752,13 +752,13 @@ tioce_kern_init(struct tioce_common *tioce_common) * Determine the secondary bus number of the port2 logical PPB. * This is used to decide whether a given pci device resides on * port1 or port2. Note: We don't have enough plumbing set up -* here to use pci_read_config_xxx() so use the raw_pci_ops vector. +* here to use pci_read_config_xxx() so use raw_pci_read(). */ seg = tioce_common->ce_pcibus.bs_persist_segment; bus = tioce_common->ce_pcibus.bs_persist_busnum; - raw_pci_ops->read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,); + raw_pci_read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,); tioce_kern->ce_port1_secondary = (u8) tmp; /* @@ -799,11 +799,11 @@ tioce_kern_init(struct tioce_common *tioce_common) /* mem base/limit */ - raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0), + raw_pci_read(seg, bus, PCI_DEVFN(dev, 0), PCI_MEMORY_BASE, 2, ); base = (u64)tmp << 16; - raw_pci_ops->read(seg, bus, PCI_DEVFN(dev, 0), + raw_pci_read(seg, bus, PCI_DEVFN(dev, 0), PCI_MEMORY_LIMIT, 2, ); limit = (u64)tmp << 16; limit |= 0xfUL; @@ -817,21 +817,21 @@ tioce_kern_init(struct tioce_common *tioce_common) * attributes. */ -
[PATCH] Change pci_raw_ops to pci_raw_read/write
We want to allow different implementations of pci_raw_ops for standard and extended config space on x86. Rather than clutter generic code with knowledge of this, we make pci_raw_ops private to x86 and use it to implement the new raw interface -- raw_pci_read() and raw_pci_write(). Signed-off-by: Matthew Wilcox [EMAIL PROTECTED] --- arch/ia64/pci/pci.c | 25 - arch/ia64/sn/pci/tioce_provider.c | 16 arch/x86/kernel/quirks.c |2 +- arch/x86/pci/common.c | 25 +++-- arch/x86/pci/direct.c |4 ++-- arch/x86/pci/fixup.c |6 -- arch/x86/pci/legacy.c |2 +- arch/x86/pci/mmconfig-shared.c|6 +++--- arch/x86/pci/mmconfig_32.c| 10 ++ arch/x86/pci/mmconfig_64.c|8 +--- arch/x86/pci/pci.h| 15 +++ arch/x86/pci/visws.c |3 --- drivers/acpi/osl.c| 25 ++--- drivers/ata/Kconfig |3 +++ drivers/ata/Makefile |3 +++ include/linux/pci.h | 16 16 files changed, 84 insertions(+), 85 deletions(-) diff --git a/arch/ia64/pci/pci.c b/arch/ia64/pci/pci.c index 488e48a..8fd7e82 100644 --- a/arch/ia64/pci/pci.c +++ b/arch/ia64/pci/pci.c @@ -43,8 +43,7 @@ #define PCI_SAL_EXT_ADDRESS(seg, bus, devfn, reg) \ (((u64) seg 28) | (bus 20) | (devfn 12) | (reg)) -static int -pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_read(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 *value) { u64 addr, data = 0; @@ -68,8 +67,7 @@ pci_sal_read (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static int -pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, +int raw_pci_write(unsigned int seg, unsigned int bus, unsigned int devfn, int reg, int len, u32 value) { u64 addr; @@ -91,24 +89,17 @@ pci_sal_write (unsigned int seg, unsigned int bus, unsigned int devfn, return 0; } -static struct pci_raw_ops pci_sal_ops = { - .read = pci_sal_read, - .write =pci_sal_write -}; - -struct pci_raw_ops *raw_pci_ops = pci_sal_ops; - -static int -pci_read (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 *value) +static int pci_read(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 *value) { - return raw_pci_ops-read(pci_domain_nr(bus), bus-number, + return raw_pci_read(pci_domain_nr(bus), bus-number, devfn, where, size, value); } -static int -pci_write (struct pci_bus *bus, unsigned int devfn, int where, int size, u32 value) +static int pci_write(struct pci_bus *bus, unsigned int devfn, int where, + int size, u32 value) { - return raw_pci_ops-write(pci_domain_nr(bus), bus-number, + return raw_pci_write(pci_domain_nr(bus), bus-number, devfn, where, size, value); } diff --git a/arch/ia64/sn/pci/tioce_provider.c b/arch/ia64/sn/pci/tioce_provider.c index e1a3e19..999f14f 100644 --- a/arch/ia64/sn/pci/tioce_provider.c +++ b/arch/ia64/sn/pci/tioce_provider.c @@ -752,13 +752,13 @@ tioce_kern_init(struct tioce_common *tioce_common) * Determine the secondary bus number of the port2 logical PPB. * This is used to decide whether a given pci device resides on * port1 or port2. Note: We don't have enough plumbing set up -* here to use pci_read_config_xxx() so use the raw_pci_ops vector. +* here to use pci_read_config_xxx() so use raw_pci_read(). */ seg = tioce_common-ce_pcibus.bs_persist_segment; bus = tioce_common-ce_pcibus.bs_persist_busnum; - raw_pci_ops-read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,tmp); + raw_pci_read(seg, bus, PCI_DEVFN(2, 0), PCI_SECONDARY_BUS, 1,tmp); tioce_kern-ce_port1_secondary = (u8) tmp; /* @@ -799,11 +799,11 @@ tioce_kern_init(struct tioce_common *tioce_common) /* mem base/limit */ - raw_pci_ops-read(seg, bus, PCI_DEVFN(dev, 0), + raw_pci_read(seg, bus, PCI_DEVFN(dev, 0), PCI_MEMORY_BASE, 2, tmp); base = (u64)tmp 16; - raw_pci_ops-read(seg, bus, PCI_DEVFN(dev, 0), + raw_pci_read(seg, bus, PCI_DEVFN(dev, 0), PCI_MEMORY_LIMIT, 2, tmp); limit = (u64)tmp 16; limit |= 0xfUL; @@ -817,21 +817,21 @@ tioce_kern_init(struct tioce_common *tioce_common) * attributes. */ - raw_pci_ops-read(seg, bus,