[PATCH] gianfar:don't add FCB length to hard_header_len

2012-05-22 Thread Jiajun Wu
FCB(Frame Control Block) isn't the part of netdev hard header.
Add FCB to hard_header_len will make GRO fail at MAC comparision stage.

Signed-off-by: Jiajun Wu 
---
 drivers/net/ethernet/freescale/gianfar.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ethernet/freescale/gianfar.c 
b/drivers/net/ethernet/freescale/gianfar.c
index 1adb024..0741ade 100644
--- a/drivers/net/ethernet/freescale/gianfar.c
+++ b/drivers/net/ethernet/freescale/gianfar.c
@@ -1082,7 +1082,7 @@ static int gfar_probe(struct platform_device *ofdev)
 
if (dev->features & NETIF_F_IP_CSUM ||
priv->device_flags & FSL_GIANFAR_DEV_HAS_TIMER)
-   dev->hard_header_len += GMAC_FCB_LEN;
+   dev->needed_headroom = GMAC_FCB_LEN;
 
/* Program the isrg regs only if number of grps > 1 */
if (priv->num_grps > 1) {
-- 
1.5.6.5


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: powerpc -next rebase WARNING

2012-05-22 Thread Josh Boyer
On Tue, May 22, 2012 at 12:40 AM, Benjamin Herrenschmidt
 wrote:
> On Tue, 2012-05-22 at 11:51 +1000, Benjamin Herrenschmidt wrote:
>> Folks, bad news ... my fault.
>>
>> I accidentally forgot a --signoff on a git am command last week, meaning
>> that a pair of patches are in -next and not signed off by me.
>>
>> For various (legal) reasons that cannot go into Linus tree as-is, so I
>> have to rebase the tree to fix it.
>>
>> Sorry about that ...
>
> Note that the rebase only affects the top 3 commits, so if your
> tree is based on something older you're fine (Kumar, you seem to
> be ok, I haven't checked Josh).

Should be fine.  Even if not, all 4 of its users will manage to cope.

josh
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Handling spin table in kdump

2012-05-22 Thread Suzuki K. Poulose

Hi

I came across the following issue while testing Kdump on an SMP 
board(Currituck) running a non-SMP kernel. Even though the kernel is UP,

the device-tree has the nodes for second CPU and the related details.


The kexec tool adds the spin table area as a reserved section in the 
device tree for the dump capture kernel. This value is read from the 
'cpu-release-addr'.


But now, if the spin table is not located within the 'Reserved region' 
for the crash kernel, the dump capture kernel would fail to boot, 
hitting a BUG in mm/bootmem.c as in [1].


This is because we try to reserve a region which is not available to the 
kernel.


So I am wondering how is this handled really on an SMP board (Fsl_bookE).

There are two possible solutions :
1) Do not reserve the regions for the spin-table, as we will use
only the crashing CPU in the second kernel(maxcpus=1).


2) Add the spin-table region to the available memory regions passed
to the kernel by kexec-tools.

I have tested (1) and it works fine for me. Yet to test (2).


Thoughts ?


Thanks
Suzuki



[1] Kernel Bug



Linux version 3.3.0-rc5 (r...@suzukikp.in.ibm.com) (gcc version 4.3.4 
[gcc-4_3-branch revision 152973] (GCC) ) #12 Tue May 22 18:03:01 IST2

Found legacy serial port 0 for /plb/opb/serial@1000
  mem=2001000, taddr=2001000, irq=0, clk=1851851, speed=115200
[ cut here ]
kernel BUG at mm/bootmem.c:351!
Vector: 700 (Program Check) at [c8a61e90]
pc: c847f91c: mark_bootmem+0xa0/0x14c
lr: c8472670: do_init_bootmem+0x1ac/0x218
sp: c8a61f40
   msr: 21000
  current = 0xc8a4a500
pid   = 0, comm = swapper
kernel BUG at mm/bootmem.c:351!
enter ? for help
[c8a61f70] c8472670 do_init_bootmem+0x1ac/0x218
[c8a61f90] c847025c setup_arch+0x1bc/0x234
[c8a61fb0] c846b62c start_kernel+0x98/0x358
[c8a61ff0] c8b4 _start+0xb4/0xf8

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: Handling spin table in kdump

2012-05-22 Thread McClintock Matthew-B29882
On Tue, May 22, 2012 at 7:42 AM, Suzuki K. Poulose  wrote:
> Hi
>
> I came across the following issue while testing Kdump on an SMP
> board(Currituck) running a non-SMP kernel. Even though the kernel is UP,
> the device-tree has the nodes for second CPU and the related details.
>
>
> The kexec tool adds the spin table area as a reserved section in the device
> tree for the dump capture kernel. This value is read from the
> 'cpu-release-addr'.
>
> But now, if the spin table is not located within the 'Reserved region' for
> the crash kernel, the dump capture kernel would fail to boot, hitting a BUG
> in mm/bootmem.c as in [1].
>
> This is because we try to reserve a region which is not available to the
> kernel.
>
> So I am wondering how is this handled really on an SMP board (Fsl_bookE).
>
> There are two possible solutions :
> 1) Do not reserve the regions for the spin-table, as we will use
> only the crashing CPU in the second kernel(maxcpus=1).
>
>
> 2) Add the spin-table region to the available memory regions passed
> to the kernel by kexec-tools.
>
> I have tested (1) and it works fine for me. Yet to test (2).
>
>
> Thoughts ?

I would think option 1 is acceptable. The crash kernel will never
attempt to use the memory outside of the crash kernel region therefore
it does not need to be reserved.

However, I thought we were able to boot SMP into the crash kernel on
our parts... not sure how that effects things (although the maxcpus=1
here is a perfectly acceptable and safer thing to do anyways)

-M


>
>
> Thanks
> Suzuki
>
>
>
> [1] Kernel Bug
> 
>
>
> Linux version 3.3.0-rc5 (r...@suzukikp.in.ibm.com) (gcc version 4.3.4
> [gcc-4_3-branch revision 152973] (GCC) ) #12 Tue May 22 18:03:01 IST2
> Found legacy serial port 0 for /plb/opb/serial@1000
>  mem=2001000, taddr=2001000, irq=0, clk=1851851, speed=115200
> [ cut here ]
> kernel BUG at mm/bootmem.c:351!
> Vector: 700 (Program Check) at [c8a61e90]
>    pc: c847f91c: mark_bootmem+0xa0/0x14c
>    lr: c8472670: do_init_bootmem+0x1ac/0x218
>    sp: c8a61f40
>   msr: 21000
>  current = 0xc8a4a500
>    pid   = 0, comm = swapper
> kernel BUG at mm/bootmem.c:351!
> enter ? for help
> [c8a61f70] c8472670 do_init_bootmem+0x1ac/0x218
> [c8a61f90] c847025c setup_arch+0x1bc/0x234
> [c8a61fb0] c846b62c start_kernel+0x98/0x358
> [c8a61ff0] c8b4 _start+0xb4/0xf8
>
> ___
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH] gianfar:don't add FCB length to hard_header_len

2012-05-22 Thread David Miller
From: Jiajun Wu 
Date: Tue, 22 May 2012 17:00:48 +0800

> FCB(Frame Control Block) isn't the part of netdev hard header.
> Add FCB to hard_header_len will make GRO fail at MAC comparision stage.
> 
> Signed-off-by: Jiajun Wu 

Applied, thanks.

Someone needs to go through this driver when net-next opens up
and fix all of the indentation in this driver.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3] of: Add prefix parameter to of_modalias_node().

2012-05-22 Thread David Daney

On 05/19/2012 11:08 PM, Grant Likely wrote:

On Sat, 19 May 2012 23:54:36 -0600, Grant Likely  
wrote:

On Fri, 11 May 2012 15:05:21 -0700, David Daney  wrote:

From: David Daney

When generating MODALIASes, it is convenient to add things like "spi:"
or "i2c:" to the front of the strings.  This allows the standard
modprobe to find the right driver when automatically populating bus
children from the device tree structure.

Add a prefix parameter, and adjust callers.  For
of_register_spi_devices() use the "spi:" prefix.

Signed-off-by: David Daney


Applied, thanks.  Some notes below...


Wait... why is this necessary?


Because in of_register_spi_devices() in of_spi.c, you do:

request_module(spi->modalias);

The string passed to request_module() must have the "spi:" prefix.



The module type prefix isn't stored in
the modalias value for any other bus type as far as I can see,


It is only useful with the prefix, so I though I would add it to the 
stored value.



and
with this series it appears that the "spi:" prefix may or may not be
present in the modalias.  That doesn't look right.


Perhaps, but the with the combination of patches 1/3 and 2/3 I tried to 
ensure that the prefix would always be present for SPI devices.




Why isn't prefixing spi: at uevent time sufficient?


Because udev may not be loading the driver.


IIUC, modprobe
depends on either UEVENT or the modalias attribute to know which
driver to probe.  It does look like the attribute is missing the spi:
prefix though.  Does the following change work instead of these two
patches?



No.


diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
index 3d8f662..da8aac7 100644
--- a/drivers/spi/spi.c
+++ b/drivers/spi/spi.c
@@ -51,7 +51,7 @@ modalias_show(struct device *dev, struct device_attribute *a, 
char *buf)
  {
 const struct spi_device *spi = to_spi_device(dev);

-   return sprintf(buf, "%s\n", spi->modalias);
+   return sprintf(buf, "%s%s\n", SPI_MODULE_PREFIX, spi->modalias);
  }

So, I've dropped this patch from my tree.  If the change above works
for you then I'll push it out.

g.



___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3] of: Add prefix parameter to of_modalias_node().

2012-05-22 Thread Grant Likely
On Tue, May 22, 2012 at 1:45 PM, David Daney  wrote:
> On 05/19/2012 11:08 PM, Grant Likely wrote:
>>
>> On Sat, 19 May 2012 23:54:36 -0600, Grant
>> Likely  wrote:
>>>
>>> On Fri, 11 May 2012 15:05:21 -0700, David Daney
>>>  wrote:

 From: David Daney

 When generating MODALIASes, it is convenient to add things like "spi:"
 or "i2c:" to the front of the strings.  This allows the standard
 modprobe to find the right driver when automatically populating bus
 children from the device tree structure.

 Add a prefix parameter, and adjust callers.  For
 of_register_spi_devices() use the "spi:" prefix.

 Signed-off-by: David Daney
>>>
>>>
>>> Applied, thanks.  Some notes below...
>>
>>
>> Wait... why is this necessary?
>
>
> Because in of_register_spi_devices() in of_spi.c, you do:
>
>        request_module(spi->modalias);
>
> The string passed to request_module() must have the "spi:" prefix.

How about modifying the call to request_module() to include the prefix
also?  I think that would be a simpler change overall.  Would that
work?

g.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3] of: Add prefix parameter to of_modalias_node().

2012-05-22 Thread David Daney

On 05/22/2012 01:09 PM, Grant Likely wrote:

On Tue, May 22, 2012 at 1:45 PM, David Daney  wrote:

On 05/19/2012 11:08 PM, Grant Likely wrote:


On Sat, 19 May 2012 23:54:36 -0600, Grant
Likelywrote:


On Fri, 11 May 2012 15:05:21 -0700, David Daney
  wrote:


From: David Daney

When generating MODALIASes, it is convenient to add things like "spi:"
or "i2c:" to the front of the strings.  This allows the standard
modprobe to find the right driver when automatically populating bus
children from the device tree structure.

Add a prefix parameter, and adjust callers.  For
of_register_spi_devices() use the "spi:" prefix.

Signed-off-by: David Daney



Applied, thanks.  Some notes below...



Wait... why is this necessary?



Because in of_register_spi_devices() in of_spi.c, you do:

request_module(spi->modalias);

The string passed to request_module() must have the "spi:" prefix.


How about modifying the call to request_module() to include the prefix
also?  I think that would be a simpler change overall.  Would that
work?


It seems to.  I just sent such a patch in a new thread.

David Daney
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


Re: [PATCH 1/3] of: Add prefix parameter to of_modalias_node().

2012-05-22 Thread Grant Likely
Cool, thanks.

g.

On Tue, May 22, 2012 at 4:49 PM, David Daney  wrote:
> On 05/22/2012 01:09 PM, Grant Likely wrote:
>>
>> On Tue, May 22, 2012 at 1:45 PM, David Daney
>>  wrote:
>>>
>>> On 05/19/2012 11:08 PM, Grant Likely wrote:


 On Sat, 19 May 2012 23:54:36 -0600, Grant
 Likely    wrote:
>
>
> On Fri, 11 May 2012 15:05:21 -0700, David Daney
>  wrote:
>>
>>
>> From: David Daney
>>
>> When generating MODALIASes, it is convenient to add things like "spi:"
>> or "i2c:" to the front of the strings.  This allows the standard
>> modprobe to find the right driver when automatically populating bus
>> children from the device tree structure.
>>
>> Add a prefix parameter, and adjust callers.  For
>> of_register_spi_devices() use the "spi:" prefix.
>>
>> Signed-off-by: David Daney
>
>
>
> Applied, thanks.  Some notes below...



 Wait... why is this necessary?
>>>
>>>
>>>
>>> Because in of_register_spi_devices() in of_spi.c, you do:
>>>
>>>        request_module(spi->modalias);
>>>
>>> The string passed to request_module() must have the "spi:" prefix.
>>
>>
>> How about modifying the call to request_module() to include the prefix
>> also?  I think that would be a simpler change overall.  Would that
>> work?
>
>
> It seems to.  I just sent such a patch in a new thread.
>
> David Daney



-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 0/2] Add pcibios_device_change_notifier

2012-05-22 Thread Hiroo Matsumoto
This patchset is for PCI hotplug.


pcibios_setup_bus_devices which sets DMA and IRQs of PCI device is called
only when boot. DMA setting in probe for PCI driver, like dma_set_mask,
does not work on powerpc platform. So it is need to set DMA and IRQs of
PCI device when hotplug.

1. Moving pcibios_setup_bus_devices code to pcibios_device_change_notifier
   which is registered to bus notifier in pcibios_init.
2. Removing caller and callee of pcibios_setup_bus_devices bus notifier
   works instead of pcibios_setup_bus_devices.
3. Using this bus notifier for microblaze because microblaze/PCI is similer
   with powerpc/PCI.

[PATCH v2 1/2] powerpc/PCI: Add pcibios_device_change_notifier for powerpc
[PATCH v2 2/2] microblaze/PCI: Add pcibios_device_change_notifier for microblaze


Regards.

Hiroo MATSUMOTO

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH v2 1/2] powerpc/PCI: Add pcibios_device_change_notifier for powerpc

2012-05-22 Thread Hiroo Matsumoto
pcibios_setup_bus_devices which sets DMA and IRQs of PCI device is called
only when boot, so DMA and IRQs of PCI device will not set when hotplug.
This patch adds pcibios_device_change_notifier which sets DMA and IRQs of
PCI device when PCI device adds, so DMA and IRQs of PCI device will be set
when boot and hotplug.

* Not patched pciehp message on powerpc platform
# echo 1 > /sys/bus/pci/slots/1/power

pcieport :02:01.0: PCI bridge to [bus 03-03]
pcieport :02:01.0:   bridge window [io  0xff7ee000-0xff7eefff]
pcieport :02:01.0:   bridge window [mem 0xa010-0xa01f]
pcieport :02:01.0: bridge window [mem 0xa020-0xa02f 64bit pref]
pci :03:00.0: no hotplug settings from platform
e1000e :03:00.0: Disabling ASPM  L1
e1000e :03:00.0: enabling device ( -> 0002)
e1000e :03:00.0: No usable DMA configuration, aborting
e1000e: probe of :03:00.0 failed with error -5

* Patched pciehp message on powerpc platform
# echo 1 > /sys/bus/pci/slots/1/power

pcieport :02:01.0: PCI bridge to [bus 03-03]
pcieport :02:01.0:   bridge window [io  0xff7ee000-0xff7eefff]
pcieport :02:01.0:   bridge window [mem 0xa010-0xa01f]
pcieport :02:01.0: bridge window [mem 0xa020-0xa02f 64bit pref]
pci :03:00.0: no hotplug settings from platform
e1000e :03:00.0: Disabling ASPM  L1
e1000e :03:00.0: enabling device ( -> 0002)
irq: irq 6 on host /soc@ffe0/msi@41600 mapped to virtual irq 27
e1000e :03:00.0: eth0: (PCI Express:2.5GT/s:Width x1) 00:15:17:bf:c0:c9
e1000e :03:00.0: eth0: Intel(R) PRO/1000 Network Connection
e1000e :03:00.0: eth0: MAC: 1, PHY: 4, PBA No: D50861-003

Signed-off-by: Hiroo MATSUMOTO 
---
 arch/powerpc/include/asm/pci.h |2 +-
 arch/powerpc/kernel/pci-common.c   |   87 ++--
 arch/powerpc/kernel/pci_32.c   |2 +
 arch/powerpc/kernel/pci_64.c   |2 +
 arch/powerpc/kernel/pci_of_scan.c  |1 -
 arch/powerpc/platforms/pseries/pci_dlpar.c |1 -
 drivers/pci/pci.c  |5 --
 drivers/pcmcia/cardbus.c   |3 +-
 include/linux/pci.h|3 -
 9 files changed, 49 insertions(+), 57 deletions(-)

diff --git a/arch/powerpc/include/asm/pci.h b/arch/powerpc/include/asm/pci.h
index f54b3d2..7b4ca5a 100644
--- a/arch/powerpc/include/asm/pci.h
+++ b/arch/powerpc/include/asm/pci.h
@@ -190,10 +190,10 @@ extern void pci_resource_to_user(const struct pci_dev 
*dev, int bar,
 const struct resource *rsrc,
 resource_size_t *start, resource_size_t *end);

-extern void pcibios_setup_bus_devices(struct pci_bus *bus);
 extern void pcibios_setup_bus_self(struct pci_bus *bus);
 extern void pcibios_setup_phb_io_space(struct pci_controller *hose);
 extern void pcibios_scan_phb(struct pci_controller *hose);
+extern void pcibios_setup_bus_notifier(void);

 #endif /* __KERNEL__ */
 #endif /* __ASM_POWERPC_PCI_H */
diff --git a/arch/powerpc/kernel/pci-common.c b/arch/powerpc/kernel/pci-common.c
index cce98d7..42a00b5 100644
--- a/arch/powerpc/kernel/pci-common.c
+++ b/arch/powerpc/kernel/pci-common.c
@@ -1097,40 +1097,6 @@ void __devinit pcibios_setup_bus_self(struct pci_bus 
*bus)
ppc_md.pci_dma_bus_setup(bus);
 }

-void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
-{
-   struct pci_dev *dev;
-
-   pr_debug("PCI: Fixup bus devices %d (%s)\n",
-bus->number, bus->self ? pci_name(bus->self) : "PHB");
-
-   list_for_each_entry(dev, &bus->devices, bus_list) {
-   /* Cardbus can call us to add new devices to a bus, so ignore
-* those who are already fully discovered
-*/
-   if (dev->is_added)
-   continue;
-
-   /* Fixup NUMA node as it may not be setup yet by the generic
-* code and is needed by the DMA init
-*/
-   set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
-
-   /* Hook up default DMA ops */
-   set_dma_ops(&dev->dev, pci_dma_ops);
-   set_dma_offset(&dev->dev, PCI_DRAM_OFFSET);
-
-   /* Additional platform DMA/iommu setup */
-   if (ppc_md.pci_dma_dev_setup)
-   ppc_md.pci_dma_dev_setup(dev);
-
-   /* Read default IRQs and fixup if necessary */
-   pci_read_irq_line(dev);
-   if (ppc_md.pci_irq_fixup)
-   ppc_md.pci_irq_fixup(dev);
-   }
-}
-
 void pcibios_set_master(struct pci_dev *dev)
 {
/* No special bus mastering setup handling */
@@ -1147,19 +1113,9 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)

/* Now fixup the bus bus */
pcibios_setup_bus_self(bus);
-
-   /* Now fixup devices on that bus */
-   pcibios_setup_bus_devices(bus);
 }
 EXPORT_SYMBOL(pcibio

[PATCH v2 2/2] microblaze/PCI: Add pcibios_device_change_notifier for microblaze

2012-05-22 Thread Hiroo Matsumoto
pcibios_setup_bus_devices which sets DMA and IRQs of PCI device is called
only when boot, so DMA and IRQs of PCI device will not set when hotplug.
This patch adds pcibios_device_change_notifier which sets DMA and IRQs of
PCI device when PCI device adds, so DMA and IRQs of PCI device will be set
when boot and hotplug.

Signed-off-by: Hiroo MATSUMOTO 
---
 arch/microblaze/include/asm/pci.h |2 +-
 arch/microblaze/pci/pci-common.c  |   67 +---
 2 files changed, 40 insertions(+), 29 deletions(-)

diff --git a/arch/microblaze/include/asm/pci.h 
b/arch/microblaze/include/asm/pci.h
index 0331376..8d11277 100644
--- a/arch/microblaze/include/asm/pci.h
+++ b/arch/microblaze/include/asm/pci.h
@@ -149,8 +149,8 @@ extern void pci_resource_to_user(const struct pci_dev *dev, 
int bar,
 const struct resource *rsrc,
 resource_size_t *start, resource_size_t *end);

-extern void pcibios_setup_bus_devices(struct pci_bus *bus);
 extern void pcibios_setup_bus_self(struct pci_bus *bus);
+extern void pcibios_setup_bus_notifier(void);

 /* This part of code was originally in xilinx-pci.h */
 #ifdef CONFIG_PCI_XILINX
diff --git a/arch/microblaze/pci/pci-common.c b/arch/microblaze/pci/pci-common.c
index 85f2ac1..bb28ede 100644
--- a/arch/microblaze/pci/pci-common.c
+++ b/arch/microblaze/pci/pci-common.c
@@ -1063,31 +1063,6 @@ void __devinit pcibios_setup_bus_self(struct pci_bus 
*bus)
pcibios_fixup_bridge(bus);
 }

-void __devinit pcibios_setup_bus_devices(struct pci_bus *bus)
-{
-   struct pci_dev *dev;
-
-   pr_debug("PCI: Fixup bus devices %d (%s)\n",
-bus->number, bus->self ? pci_name(bus->self) : "PHB");
-
-   list_for_each_entry(dev, &bus->devices, bus_list) {
-   /* Setup OF node pointer in archdata */
-   dev->dev.of_node = pci_device_to_OF_node(dev);
-
-   /* Fixup NUMA node as it may not be setup yet by the generic
-* code and is needed by the DMA init
-*/
-   set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
-
-   /* Hook up default DMA ops */
-   set_dma_ops(&dev->dev, pci_dma_ops);
-   dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET;
-
-   /* Read default IRQs and fixup if necessary */
-   pci_read_irq_line(dev);
-   }
-}
-
 void __devinit pcibios_fixup_bus(struct pci_bus *bus)
 {
/* When called from the generic PCI probe, read PCI<->PCI bridge
@@ -1099,9 +1074,6 @@ void __devinit pcibios_fixup_bus(struct pci_bus *bus)

/* Now fixup the bus bus */
pcibios_setup_bus_self(bus);
-
-   /* Now fixup devices on that bus */
-   pcibios_setup_bus_devices(bus);
 }
 EXPORT_SYMBOL(pcibios_fixup_bus);

@@ -1604,6 +1576,43 @@ static void __devinit pcibios_scan_phb(struct 
pci_controller *hose)
hose->last_busno = bus->subordinate;
 }

+static int pcibios_device_change_notifier(struct notifier_block *nb,
+ unsigned long action, void *data)
+{
+   struct pci_dev *dev = to_pci_dev(data);
+
+   switch (action) {
+   case BUS_NOTIFY_ADD_DEVICE:
+   /* Setup OF node pointer in archdata */
+   dev->dev.of_node = pci_device_to_OF_node(dev);
+
+   /* Fixup NUMA node as it may not be setup yet by the generic
+* code and is needed by the DMA init
+*/
+   set_dev_node(&dev->dev, pcibus_to_node(dev->bus));
+
+   /* Hook up default DMA ops */
+   set_dma_ops(&dev->dev, pci_dma_ops);
+   dev->dev.archdata.dma_data = (void *)PCI_DRAM_OFFSET;
+
+   /* Read default IRQs and fixup if necessary */
+   pci_read_irq_line(dev);
+
+   break;
+   }
+
+   return 0;
+}
+
+static struct notifier_block device_nb = {
+   .notifier_call = pcibios_device_change_notifier,
+};
+
+void __devinit pcibios_setup_bus_notifier(void)
+{
+   bus_register_notifier(&pci_bus_type, &device_nb);
+}
+
 static int __init pcibios_init(void)
 {
struct pci_controller *hose, *tmp;
@@ -1611,6 +1620,8 @@ static int __init pcibios_init(void)

printk(KERN_INFO "PCI: Probing PCI hardware\n");

+   pcibios_setup_bus_notifier();
+
/* Scan all of the recorded PCI controllers.  */
list_for_each_entry_safe(hose, tmp, &hose_list, list_node) {
hose->last_busno = 0xff;
-- 
1.7.3.4


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[git pull] Please pull powerpc.git next branch

2012-05-22 Thread Benjamin Herrenschmidt
Hi Linus !

Here are the powerpc goodies for 3.5. Main highlights are:

 - Support for the NX crypto engine in Power7+
 - A bunch of Anton goodness, including some micro optimization
   of our syscall entry on Power7
 - I converted a pile of our thermal control drivers to the
   new i2c APIs (essentially turning the old therm_pm72 into
   a proper set of windfarm drivers). That's one more step
   toward removing the deprecated i2c APIs, there's still a
   few drivers to fix, but we are getting close
 - kexec/kdump support for 47x embedded cores

The big missing thing here is no updates from Freescale. Not sure
what's up here, but with Kumar not working for them anymore things
are a bit in a state of flux in that area.

[Sent from my ozlabs address because gate.crashing.org appears to
have temporarily fallen off the face of the internet]

Cheers,
Ben.

The following changes since commit 7c0482e3d055e5de056d3c693b821e39205b99ae:

  powerpc/irq: Fix another case of lazy IRQ state getting out of sync 
(2012-05-12 09:40:41 +1000)

are available in the git repository at:

  git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc.git next

for you to fetch changes up to 2074b1d9d53ae696dd3f49482bad43254f40f01d:

  powerpc: Fix irq distribution (2012-05-22 14:38:26 +1000)


Andre Heider (3):
  powerpc/ps3: Add highmem repository read routines
  powerpc/ps3: Use highmem region from repository
  powerpc/ps3: Remove MEMORY_HOTPLUG requirement

Anshuman Khandual (1):
  powerpc: Fixing a cputhread code documentation

Anton Blanchard (15):
  powerpc: Hide some system call labels from profile tools
  powerpc: No need to save XER in a system call
  powerpc: No need to preserve count register across system call
  powerpc: Better scheduling of CR save code in system call path
  powerpc: Clean up lppaca->cede_latency_hint
  powerpc: Remove iseries specific fields in lppaca
  powerpc: Reformat lppaca.h
  powerpc: Remove empty giveup_altivec function on book3e CPUs
  powerpc: Optimise enable_kernel_altivec
  powerpc: Remove CONFIG_POWER4_ONLY
  powerpc: Require gcc 4.0 on 64-bit
  powerpc: Remove altivec fix for gcc versions before 4.0
  powerpc: Add 64-bit CPU targets for gcc
  powerpc: Use WARN instead of dump_stack when printing EEH error backtrace
  powerpc: Remove old powerpc specific ptrace getregs/setregs calls

Benjamin Herrenschmidt (20):
  Merge remote-tracking branch 'geoff/for-powerpc' into next
  i2c/powermac: Register i2c devices from device-tree
  powerpc/pmac: Convert therm_adt746x to new i2c probing
  powerpc/pmac: Convert windfarm_lm75 to new i2c probing
  powerpc/pmac: Convert windfarm_max6690 to new i2c probing
  powerpc/pmac: Convert windfarm_smu_sat to new i2c probing
  powerpc/windfarm: const'ify and add "priv" field to controls & sensors
  powerpc/windfarm: Remove spurrious sysfs_attr_init()
  powerpc/windfarm: Improve display of fan speeds in sysfs
  powerpc/windfarm: Add useful accessors
  powerpc/windfarm: Add ad7417 sensor
  powerpc/windfarm: Add lm87 sensor
  powerpc/windfarm: Updates to lm75 and max6690 sensors
  powerpc/windfarm: Add Fan Control Unit controls for G5s
  powerpc/powermac: New windfarm driver for PowerMac G5 (AGP) and Xserve G5
  Merge branch 'merge' into next
  powerpc/windfarm: Fix crash on SMU based machine after i2c conversion
  Merge remote-tracking branch 'jwb/next' into next
  Merge branch 'merge' into next
  Revert "powerpc/hw-breakpoint: Use generic hw-breakpoint interfaces for 
new PPC ptrace flags"

Geoff Levand (5):
  powerpc/ps3: Correct lv1 repository routine names
  powerpc/ps3: Add PS3 repository write support
  powerpc/ps3: Add highmem repository write routines
  powerpc/ps3: Minor Kconfig cleanup
  powerpc/ps3: Refresh ps3_defconfig

Hector Martin (1):
  powerpc/ps3: Add highmem region memory early

Josh Boyer (1):
  powerpc/40x: Use {upper,lower}_32_bits for msi_phys

K.Prasad (1):
  powerpc/hw-breakpoint: Use generic hw-breakpoint interfaces for new PPC 
ptrace flags

Kent Yoder (17):
  powerpc/pseries: Add new hvcall constants to support PFO
  powerpc/pseries: Add pseries update notifier for OFDT prop changes
  powerpc/pseries: Add PFO support to the VIO bus
  powerpc/pseries/hwrng: PFO-based hwrng driver
  powerpc/pseries: Enable the PFO-based RNG accelerator
  powerpc/crypto: nx driver code supporting nx encryption
  powerpc/crypto: AES-CBC mode routines for nx encryption
  powerpc/crypto: AES-CCM mode routines for nx encryption
  powerpc/crypto: AES-CTR mode routines for nx encryption
  powerpc/crypto: AES-ECB mode routines for nx encryption
  powerpc/crypto: AES-GCM mode routines for nx encryption
  powerpc/crypto: AES-XCBC mode routines for nx encryption
 

powerc tree maintainership status

2012-05-22 Thread Benjamin Herrenschmidt
Hi Folks !

I'm going to be getting some surgery next week. In the good case, I
should be officially back to work 2 weeks later, but I might end
up being unavailable for longer.

So while I'm away, Michael Ellerman and Paul Mackerras are going to take
care of the powerpc tree. I'll make sure Paul and I sign Michael's PGP
key before I leave.

Cheers,
Ben.


___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] powerpc: Enable jump label support

2012-05-22 Thread Anton Blanchard

When looking through some instruction traces I noticed our tracepoint
checks were inline. It turns out we don't have CONFIG_JUMP_LABEL
enabled.

By enabling CONFIG_JUMP_LABEL we replace a load/compare/branch with
a nop at every tracepoint call. For example in do_IRQ:

CONFIG_JUMP_LABEL disabled:
stdx 3,11,9
lwz 0,8(29)
cmpwi 7,0,0
bne- 7,.L124
bl .irq_enter

CONFIG_JUMP_LABEL enabled:
stdx 3,11,9 
nop
bl .irq_enter  

Signed-off-by: Anton Blanchard 
---

Index: linux-build/arch/powerpc/configs/ppc64_defconfig
===
--- linux-build.orig/arch/powerpc/configs/ppc64_defconfig   2012-04-05 
13:47:45.691857096 +1000
+++ linux-build/arch/powerpc/configs/ppc64_defconfig2012-05-23 
13:14:04.254270594 +1000
@@ -16,6 +16,7 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
+CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
Index: linux-build/arch/powerpc/configs/pseries_defconfig
===
--- linux-build.orig/arch/powerpc/configs/pseries_defconfig 2012-04-05 
13:47:45.691857096 +1000
+++ linux-build/arch/powerpc/configs/pseries_defconfig  2012-05-23 
13:14:59.783222304 +1000
@@ -24,6 +24,7 @@ CONFIG_BLK_DEV_INITRD=y
 CONFIG_PROFILING=y
 CONFIG_OPROFILE=y
 CONFIG_KPROBES=y
+CONFIG_JUMP_LABEL=y
 CONFIG_MODULES=y
 CONFIG_MODULE_UNLOAD=y
 CONFIG_MODVERSIONS=y
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[patch] sched, numa: Allocate node_queue on any node for offline nodes

2012-05-22 Thread David Rientjes
struct node_queue must be allocated with NUMA_NO_NODE for nodes that are 
not (yet) online, otherwise the page allocator has a bad zonelist and 
results in an early crash.

Tested-by: Stephen Rothwell 
Signed-off-by: David Rientjes 
---
 kernel/sched/numa.c |3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/kernel/sched/numa.c b/kernel/sched/numa.c
--- a/kernel/sched/numa.c
+++ b/kernel/sched/numa.c
@@ -885,7 +885,8 @@ static __init int numa_init(void)
 
for_each_node(node) {
struct node_queue *nq = kmalloc_node(sizeof(*nq),
-   GFP_KERNEL | __GFP_ZERO, node);
+   GFP_KERNEL | __GFP_ZERO,
+   node_online(node) ? node : NUMA_NO_NODE);
BUG_ON(!nq);
 
spin_lock_init(&nq->lock);
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev


[PATCH] powerpc: tracing: Avoid tracepoint duplication with DECLARE_EVENT_CLASS

2012-05-22 Thread Anton Blanchard

irq_entry, irq_exit, timer_interrupt_entry and timer_interrupt_exit
all do the same thing so use DECLARE_EVENT_CLASS to avoid duplicating
everything 4 times.

This saves quite a lot of space in both instruction text and data:

   textdata bss dec hex filename
   9265   19622  16   2890370e7 arch/powerpc/kernel/irq.o
   6817   19019  16   2585264fc arch/powerpc/kernel/irq.o

Signed-off-by: Anton Blanchard 
---

Index: linux-build/arch/powerpc/include/asm/trace.h
===
--- linux-build.orig/arch/powerpc/include/asm/trace.h   2012-05-23 
13:30:51.235534219 +1000
+++ linux-build/arch/powerpc/include/asm/trace.h2012-05-23 
14:10:44.406639628 +1000
@@ -8,7 +8,7 @@
 
 struct pt_regs;
 
-TRACE_EVENT(irq_entry,
+DECLARE_EVENT_CLASS(ppc64_interrupt_class,
 
TP_PROTO(struct pt_regs *regs),
 
@@ -25,55 +25,32 @@ TRACE_EVENT(irq_entry,
TP_printk("pt_regs=%p", __entry->regs)
 );
 
-TRACE_EVENT(irq_exit,
+DEFINE_EVENT(ppc64_interrupt_class, irq_entry,
 
TP_PROTO(struct pt_regs *regs),
 
-   TP_ARGS(regs),
-
-   TP_STRUCT__entry(
-   __field(struct pt_regs *, regs)
-   ),
-
-   TP_fast_assign(
-   __entry->regs = regs;
-   ),
-
-   TP_printk("pt_regs=%p", __entry->regs)
+   TP_ARGS(regs)
 );
 
-TRACE_EVENT(timer_interrupt_entry,
+DEFINE_EVENT(ppc64_interrupt_class, irq_exit,
 
TP_PROTO(struct pt_regs *regs),
 
-   TP_ARGS(regs),
-
-   TP_STRUCT__entry(
-   __field(struct pt_regs *, regs)
-   ),
-
-   TP_fast_assign(
-   __entry->regs = regs;
-   ),
-
-   TP_printk("pt_regs=%p", __entry->regs)
+   TP_ARGS(regs)
 );
 
-TRACE_EVENT(timer_interrupt_exit,
+DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_entry,
 
TP_PROTO(struct pt_regs *regs),
 
-   TP_ARGS(regs),
+   TP_ARGS(regs)
+);
 
-   TP_STRUCT__entry(
-   __field(struct pt_regs *, regs)
-   ),
+DEFINE_EVENT(ppc64_interrupt_class, timer_interrupt_exit,
 
-   TP_fast_assign(
-   __entry->regs = regs;
-   ),
+   TP_PROTO(struct pt_regs *regs),
 
-   TP_printk("pt_regs=%p", __entry->regs)
+   TP_ARGS(regs)
 );
 
 #ifdef CONFIG_PPC_PSERIES
___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev