LinuxPPC-Dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Implement pci_set_dma_mask() in terms of the dma_ops
From: Michael Ellerman @ 2007-12-17  6:35 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: linuxppc-dev

Powerpc currently doesn't implement pci_set_dma_mask(), which means drivers
calling it will get the generic version in drivers/pci/pci.c.

The Powerpc dma mapping ops include a dma_set_mask() hook, which luckily is
not implemented by anyone - so there is no bug in the fact that the hook
is currently never called.

However in future we'll add implementation(s) of dma_set_mask(), and so we
need pci_set_dma_mask() to call the hook.

To save adding a hook to the dma mapping ops, pci-set_consistent_dma_mask()
simply calls the dma_set_mask() hook and then copies the new mask into
dev.coherenet_dma_mask.

Signed-off-by: Michael Ellerman <michael@ellerman.id.au>
---
 arch/powerpc/kernel/pci_64.c      |   16 ++++++++++++++++
 include/asm-powerpc/dma-mapping.h |    3 +++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/arch/powerpc/kernel/pci_64.c b/arch/powerpc/kernel/pci_64.c
index bf06926..f5c4628 100644
--- a/arch/powerpc/kernel/pci_64.c
+++ b/arch/powerpc/kernel/pci_64.c
@@ -69,6 +69,22 @@ struct dma_mapping_ops *get_pci_dma_ops(void)
 }
 EXPORT_SYMBOL(get_pci_dma_ops);
 
+
+int pci_set_dma_mask(struct pci_dev *dev, u64 mask)
+{
+	return dma_set_mask(&dev->dev, mask);
+}
+
+int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask)
+{
+	int rc;
+
+	rc = dma_set_mask(&dev->dev, mask);
+	dev->dev.coherent_dma_mask = dev->dma_mask;
+
+	return rc;
+}
+
 static void fixup_broken_pcnet32(struct pci_dev* dev)
 {
 	if ((dev->class>>8 == PCI_CLASS_NETWORK_ETHERNET)) {
diff --git a/include/asm-powerpc/dma-mapping.h b/include/asm-powerpc/dma-mapping.h
index ff52013..e974876 100644
--- a/include/asm-powerpc/dma-mapping.h
+++ b/include/asm-powerpc/dma-mapping.h
@@ -87,6 +87,9 @@ static inline int dma_supported(struct device *dev, u64 mask)
 	return dma_ops->dma_supported(dev, mask);
 }
 
+/* We have our own implementation of pci_set_dma_mask() */
+#define HAVE_ARCH_PCI_SET_DMA_MASK
+
 static inline int dma_set_mask(struct device *dev, u64 dma_mask)
 {
 	struct dma_mapping_ops *dma_ops = get_dma_ops(dev);
-- 
1.5.2.rc1.1884.g59b20

^ permalink raw reply related

* RE: USB configuration
From: Pedro Luis D. L. @ 2007-12-17  8:29 UTC (permalink / raw)
  To: Misbah khan, linuxppc-embedded
In-Reply-To: <14370084.post@talk.nabble.com>


MIsbah wrote:
> I have configured for mass storage device still i am not getting the debu=
g
> msg that the kernel has detected the pen drive (after i connect the pen
> drive ).
>=20
>   " Initializing USB Mass Storage driver...
>      usbcore: registered new driver usb-storage
>      USB Mass Storage support registered.=20
>   "

As long as you enabled the USB Mass storage and all usb-related modules, if=
 you don't get any output, maybe the usb hardware is not working properly. =
I don't work with that board, so I feel like I can not help further more, s=
orry.
Hope you find a solution!

Regards,

Pedro L.

> ----misbah=20
>=20
>=20
> Pedro Luis D. L. wrote:
>>=20
>>=20
>>> From: misbah_khan@engineer.com
>>> To: linuxppc-embedded@ozlabs.org
>>> Subject: RE: USB configuration
>>>=20
>>>=20
>>> I have inserted a USB card reader, and the following dmesg it shows ...=
..
>>>=20
>>> -----------------------------------------------------------------------=
--------
>>> mpc8272ads: Init
>>> PCI: Probing PCI hardware
>>> PCI: Cannot allocate resource region 0 of device 0000:00:00.0
>>> PCI: Cannot allocate resource region 1 of device 0000:00:00.0
>>> SCSI subsystem initialized
>>> Linux Kernel Card Services
>>>   options:  [pci] [cardbus]
>>> usbcore: registered new driver usbfs
>>> usbcore: registered new driver hub
>>> Serial: CPM driver $Revision: 0.01 $
>>> ttyCPM0 at MMIO 0xf0011a00 (irq =3D 40) is a CPM UART
>>> ttyCPM1 at MMIO 0xf0011a60 (irq =3D 43) is a CPM UART
>>> io scheduler noop registered
>>> io scheduler anticipatory registered
>>> io scheduler deadline registered
>>> io scheduler cfq registered
>>> loop: loaded (max 8 devices)
>>> fs_enet.c:v1.0 (Aug 8, 2005)
>>> fs_enet: eth0 Phy @ 0x0, type DM9161 (0x0181b881)
>>> fs_enet: eth1 Phy @ 0x3, type DM9161 (0x0181b881)
>>> Uniform Multi-Platform E-IDE driver Revision: 7.00alpha2
>>> ide: Assuming 33MHz system bus speed for PIO modes; override with
>>> idebus=3Dxx
>>> st: Version 20041025, fixed bufsize 32768, s/g segs 256
>>> osst :I: Tape driver with OnStream support version 0.99.1
>>> osst :I: $Id: osst.c,v 1.70 2003/12/23 14:22:12 wriede Exp $
>>> ohci_hcd: 2004 Nov 08 USB 1.1 'Open' Host Controller (OHCI) Driver (PCI=
)
>>> ohci_hcd: block sizes: ed 64 td 64
>>> drivers/usb/serial/usb-serial.c: USB Serial support registered for
>>> Generic
>>> usbcore: registered new driver usbserial_generic
>>> usbcore: registered new driver usbserial
>>> drivers/usb/serial/usb-serial.c: USB Serial Driver core v2.0
>>> NET: Registered protocol family 2
>>> IP: routing cache hash table of 512 buckets, 4Kbytes
>>> TCP: Hash tables configured (established 4096 bind 8192)
>>> NET: Registered protocol family 1
>>> NET: Registered protocol family 17
>>> IP-Config: Complete:
>>>       device=3Deth1, addr=3D192.168.33.136, mask=3D255.255.248.0,
>>> gw=3D192.168.32.47,
>>>      host=3Dcashel, domain=3D, nis-domain=3D(none),
>>>      bootserver=3D192.168.33.96, rootserver=3D192.168.33.96, rootpath=
=3D
>>> Looking up port of RPC 100003/2 on 192.168.33.96
>>> Looking up port of RPC 100005/1 on 192.168.33.96
>>> VFS: Mounted root (nfs filesystem).
>>> Freeing unused kernel memory: 104k init
>>> -----------------------------------------------------------------------=
---------------
>>>=20
>>=20
>> It looks like it is well configured, because the usbfs and hub are loade=
d.
>> You could check in your kernel configuration that you enabled USB Mass
>> storage driver and attached a pen drive as I suggested before.
>> Another possibility is to insert a card in the USB card reader. Then you
>> should be able to see with dmesg if it is recognized.
>>=20
>> Pedro.
>>=20
>>> This doesent gives me the clear explaination of whether USB is working
>>> properly....
>>>=20
>>> I would appreciate if you could share with me the basic steps to be
>>> followed
>>> to confirm that the USB support that i had configured is being tested i=
n
>>> all
>>> aspects.
>>>=20
>>> Misbah
>>>=20
>>> Pedro Luis D. L. wrote:
>>>>=20
>>>>=20
>>>>=20
>>>>> Date: Thu, 6 Dec 2007 05:27:14 -0800
>>>>> From: misbah_khan@engineer.com
>>>>> To: linuxppc-embedded@ozlabs.org
>>>>> Subject: USB configuration
>>>>>=20
>>>>>=20
>>>>> HI all ...
>>>>=20
>>>> Hi,
>>>>=20
>>>>> I have configured the Montavista Kernel for USB support and for
>>>>> PPC8272-ADS
>>>>> board I need to know that how could i test that my USB is working ???=
?
>>>>>=20
>>>>=20
>>>> Try to attach an USB device, like a pendrive,  to an USB port. Then
>>>> type:=20
>>>> dmesg | tail
>>>>=20
>>>> If the USB support is working properly, you should see some output
>>>> saying
>>>> which device have you attached and where is it mapped.
>>>> If you plug a memory stick, you can try to mount it and check that the
>>>> filesystem is correct.
>>>>=20
>>>> Pedro.
>>>>=20
>>>>> Its creating the directory :- /proc/bus/usb/ but doesent contain any
>>>>> file
>>>>> under it ????
>>>>>=20
>>>>>=20
>>>>> its also creating the directory :- /sys/bus/usb/   but doesent contai=
n
>>>>> any
>>>>> file under it ????
>>>>>=20
>>>>>=20
>>>>> Please let me know the procedure to test whether my USB configuration
>>>>> is
>>>>> all
>>>>> right ????
>>>>>=20
>>>>> Thank u=20
>>>>> Misbah <><
>>>>> --=20
>>>>> View this message in context:
>>>>> http://www.nabble.com/USB-configuration-tf4956061.html#a14192347
>>>>> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>>>>>=20
>>>>> _______________________________________________
>>>>> Linuxppc-embedded mailing list
>>>>> Linuxppc-embedded@ozlabs.org
>>>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>>>=20
>>>> _________________________________________________________________
>>>> Tecnolog=EDa, moda, motor, viajes,=85suscr=EDbete a nuestros boletines=
 para
>>>> estar a la =FAltima
>>>> http://newsletters.msn.com/hm/maintenanceeses.asp?L=3DES&C=3DES&P=3DWC=
Maintenance&Brand=3DWL&RU=3Dhttp%3a%2f%2fmail.live.com
>>>> _______________________________________________
>>>> Linuxppc-embedded mailing list
>>>> Linuxppc-embedded@ozlabs.org
>>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>>>=20
>>>>=20
>>>=20
>>> --=20
>>> View this message in context:
>>> http://www.nabble.com/USB-configuration-tf4956061.html#a14206951
>>> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>>>=20
>>> _______________________________________________
>>> Linuxppc-embedded mailing list
>>> Linuxppc-embedded@ozlabs.org
>>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>=20
>> _________________________________________________________________
>> MSN Video.=20
>> http://video.msn.com/?mkt=3Des-es
>> _______________________________________________
>> Linuxppc-embedded mailing list
>> Linuxppc-embedded@ozlabs.org
>> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
>>=20
>>=20
>=20
> --=20
> View this message in context: http://www.nabble.com/USB-configuration-tp1=
4192347p14370084.html
> Sent from the linuxppc-embedded mailing list archive at Nabble.com.
>=20
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded

_________________________________________________________________
MSN Video.=20
http://video.msn.com/?mkt=3Des-es=

^ permalink raw reply

* Re: [PATCH] OProfile: remove dependency on spufs module
From: Jeremy Kerr @ 2007-12-17  9:23 UTC (permalink / raw)
  To: Arnd Bergmann; +Cc: linuxppc-dev, Paul Mackerras, David Woodhouse, Bob Nelson
In-Reply-To: <200712141527.31893.arnd@arndb.de>


> Jeremy, please ack the spufs changes if you are ok with the patch.

Yep, fine by me.

Acked-by: Jeremy Kerr <jk@ozlabs.org>

Cheers,


Jeremy

^ permalink raw reply

* Re: [PATCH] Implement pci_set_dma_mask() in terms of the dma_ops
From: Christoph Hellwig @ 2007-12-17 10:02 UTC (permalink / raw)
  To: Michael Ellerman; +Cc: linuxppc-dev, Paul Mackerras
In-Reply-To: <a3b033f72681dd15badb0218b505512ce1c3a9c8.1197873226.git.michael@ellerman.id.au>

On Mon, Dec 17, 2007 at 05:35:53PM +1100, Michael Ellerman wrote:
> To save adding a hook to the dma mapping ops, pci-set_consistent_dma_mask()
> simply calls the dma_set_mask() hook and then copies the new mask into
> dev.coherenet_dma_mask.

How is this supposed to work?  There are various devices around that
want different mask for coherent vs streaming dma mappings, and we need
to tell the iommu that we're setting it for either the former or the
latter.

^ permalink raw reply

* [PATCH] [NET][POWERPC] ucc_geth: really fix section mismatch
From: Anton Vorontsov @ 2007-12-17 11:54 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: netdev, Li Yang, linuxppc-dev

Commit ed7e63a51d46e835422d89c687b8a3e419a4212a has tried to fix
section mismatch:

WARNING: vmlinux.o(.init.text+0x17278): Section mismatch: reference to
.exit.text:uec_mdio_exit (between 'ucc_geth_init' and 'uec_mdio_init')

But that mismatch still happens.

This patch actually fixing section mismatch by removing __exit from
the header file.

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
---
 drivers/net/ucc_geth_mii.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/net/ucc_geth_mii.h b/drivers/net/ucc_geth_mii.h
index d834370..1e45b20 100644
--- a/drivers/net/ucc_geth_mii.h
+++ b/drivers/net/ucc_geth_mii.h
@@ -96,5 +96,5 @@ enum enet_tbi_mii_reg {
 int uec_mdio_read(struct mii_bus *bus, int mii_id, int regnum);
 int uec_mdio_write(struct mii_bus *bus, int mii_id, int regnum, u16 value);
 int __init uec_mdio_init(void);
-void __exit uec_mdio_exit(void);
+void uec_mdio_exit(void);
 #endif				/* __UEC_MII_H */
-- 
1.5.2.2

^ permalink raw reply related

* Re: [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of.
From: Peter Korsgaard @ 2007-12-17 11:57 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, simekm2
In-Reply-To: <fa686aa40712162030q6f0e6d87j5e6e5379cbd0d54e@mail.gmail.com>

>>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:

Hi,

 >> > 3) Uartlite requires a port-number property for the console to work.
 >> 
 >> Why?  In general we try to avoid magical sequence numbers - cell-index
 >> should *only* be used when it's needed to index or program some shared
 >> register.

 Grant> Aliases is probably the correct construct for this.
 Grant> port-number was a bad idea and I never should have gone that
 Grant> direction.

Perhaps it would make more sense to add a _find_match_or_unused(port)
like 8250.c and make the initialization order define the index instead
of explicitly setting it?

Now we're at it - Why isn't the uartlite of glue handled by of_serial.c?

-- 
Bye, Peter Korsgaard

^ permalink raw reply

* Re: [PATCH] [POWERPC] 4xx: Add aliases node to 4xx dts files
From: Jon Loeliger @ 2007-12-17 13:46 UTC (permalink / raw)
  To: David Gibson; +Cc: linuxppc-dev, Stefan Roese
In-Reply-To: <20071216223342.GD26307@localhost.localdomain>

So, like, the other day David Gibson mumbled:
> On Sun, Dec 16, 2007 at 07:10:02PM +0100, Segher Boessenkool wrote:
> > 
> > Hopefully some version that stores path strings in the properties
> > in /aliases, and not phandles.

Yes.

> > Or does that current version of DTC
> > do that correctly already, and just has an inconvenient source
> > syntax?

Feh.  If there is an "inconvenient source syntax", or any other
annoying irregularity, please, by all means, suggest improvements
and offer patches!

> I don't think anyone's actually gone and generated phandles in
> /aliases, although it was suggested early on.  The syntax is
> 	foo = < &bar >;
> to generate a phandle and
> 	foo = &bar;
> to generate a path.
> 
> I was a bit worried about confusion between these forms, but at least
> Kumar and myself came up with this syntax independently, which
> suggests it's not too surprising to most people, and no-one had any
> other suggestions.

To be a bit more complete, Kumar and I discussed this as well.

jdl

^ permalink raw reply

* Various DTC Patches Applied
From: Jon Loeliger @ 2007-12-17 13:53 UTC (permalink / raw)
  To: linuxppc-dev


Folks,

Tese patches have all been applied to the DTC repo and pushed out:

*  [master] dtc: Don't build tests as part of "all"
*  [master^] libfdt: Add more documentation (patch the seventh)
*  [master~2] libfdt: Add more documentation (patch the sixth)
*  [master~3] dtc: Fix silly typo in dtc-checkfails.sh
*  [master~4] dtc: Allow gcc format warnings for check_msg()
*  [master~5] dtc: Make dtc-checfails.sh script catch deaths-by-signal
*  [master~6] dtc: Reinstate full old-style reference-to-path for v0 dts files
*  [master~7] dtc: Convert check for obsolete /chosen property
*  [master~8] dtc: Convert #address-cells and #size-cells related checks

Thanks,
jdl

^ permalink raw reply

* Re: [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of.
From: Grant Likely @ 2007-12-17 15:19 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev, David Gibson, simekm2
In-Reply-To: <20071213234151.D0B3DE80061@mail20-sin.bigfish.com>

On 12/13/07, Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> wrote:
> This now better describes what the UBoot device tree generator actually does.  In particular:
>
> 1) Nodes have a label derived from the device name, and a node name
> derived from the device type.
> 2) Usage of compound nodes (representing more than one device in the same IP) which actually works.  This requires having a valid compatible node, and all the other things that a bus normally has.  I've chosen 'xlnx,compound' as the bus name to describe these compound nodes.
> 3) Uartlite requires a port-number property for the console to work.
>
> In addition, I've clarified some of the language relating to how mhs
> nodes should be represent in the device tree.

Thanks for the updates.  Comments below.

> ---
>  Documentation/powerpc/booting-without-of.txt |   61 +++++++++++++++-----------
>  1 files changed, 36 insertions(+), 25 deletions(-)
>
> diff --git a/Documentation/powerpc/booting-without-of.txt b/Documentation/powerpc/booting-without-of.txt
> index e9a3cb1..5e2b85a 100644
> --- a/Documentation/powerpc/booting-without-of.txt
> +++ b/Documentation/powerpc/booting-without-of.txt
> @@ -2276,7 +2276,7 @@ platforms are moved over to use the flattened-device-tree model.
>     properties of the device node.  In general, device nodes for IP-cores
>     will take the following form:
>
> -       (name)@(base-address) {
> +       (name): (ip-core-name)@(base-address) {

(name): (generic-name)@(base-address) {

>                 compatible = "xlnx,(ip-core-name)-(HW_VER)"
>                              [, (list of compatible devices), ...];
>                 reg = <(baseaddr) (size)>;
> @@ -2294,9 +2294,9 @@ platforms are moved over to use the flattened-device-tree model.
>                         dropped from the parameter name, the name is converted
>                         to lowercase and all underscore '_' characters are
>                         converted to dashes '-'.
> -       (baseaddr):     the C_BASEADDR parameter.
> +       (baseaddr):     the baseaddr parameter value (often named C_BASEADDR).
>         (HW_VER):       from the HW_VER parameter.
> -       (size):         equals C_HIGHADDR - C_BASEADDR + 1
> +       (size):         the address range size (often C_HIGHADDR - C_BASEADDR + 1).

Ah, yes.  Good clarification.

>
>     Typically, the compatible list will include the exact IP core version
>     followed by an older IP core version which implements the same
> @@ -2326,12 +2326,13 @@ platforms are moved over to use the flattened-device-tree model.
>
>     becomes the following device tree node:
>
> -       opb-uartlite-0@ec100000 {
> +       opb_uartlite_0: serial@ec100000 {
>                 device_type = "serial";
>                 compatible = "xlnx,opb-uartlite-1.00.b";
>                 reg = <ec100000 10000>;
> -               interrupt-parent = <&opb-intc>;
> +               interrupt-parent = <&opb_intc_0>;
>                 interrupts = <1 0>; // got this from the opb_intc parameters
> +               port-number = <0>;
>                 current-speed = <d#115200>;     // standard serial device prop
>                 clock-frequency = <d#50000000>; // standard serial device prop
>                 xlnx,data-bits = <8>;
> @@ -2339,16 +2340,19 @@ platforms are moved over to use the flattened-device-tree model.
>                 xlnx,use-parity = <0>;
>         };
>
> -   Some IP cores actually implement 2 or more logical devices.  In this case,
> -   the device should still describe the whole IP core with a single node
> -   and add a child node for each logical device.  The ranges property can
> -   be used to translate from parent IP-core to the registers of each device.
> -   (Note: this makes the assumption that both logical devices have the same
> -   bus binding.  If this is not true, then separate nodes should be used for
> -   each logical device).  The 'cell-index' property can be used to enumerate
> -   logical devices within an IP core.  For example, the following is the
> -   system.mhs entry for the dual ps2 controller found on the ml403 reference
> -   design.
> +   Some IP cores actually implement 2 or more logical devices.  In
> +   this case, the device should still describe the whole IP core with
> +   a single node and add a child node for each logical device.  The
> +   ranges property can be used to translate from parent IP-core to the
> +   registers of each device.  In addition, the parent node should be
> +   compatible with the bus type 'xlnx,compound', and should contain
> +   #address-cells and #size-cells, as with any other bus.  (Note: this
> +   makes the assumption that both logical devices have the same bus
> +   binding.  If this is not true, then separate nodes should be used
> +   for each logical device).  The 'cell-index' property can be used to
> +   enumerate logical devices within an IP core.  For example, the
> +   following is the system.mhs entry for the dual ps2 controller found
> +   on the ml403 reference design.
>
>         BEGIN opb_ps2_dual_ref
>                 PARAMETER INSTANCE = opb_ps2_dual_ref_0
> @@ -2370,21 +2374,24 @@ platforms are moved over to use the flattened-device-tree model.
>
>     It would result in the following device tree nodes:
>
> -       opb_ps2_dual_ref_0@a9000000 {
> +       opb_ps2_dual_ref_0: opb-ps2-dual-ref@a9000000 {
> +               #address-cells = <1>;
> +               #size-cells = <1>;
> +               compatible = "xlnx,compound";
>                 ranges = <0 a9000000 2000>;
>                 // If this device had extra parameters, then they would
>                 // go here.
> -               ps2@0 {
> +               opb-ps2-dual-ref@0 {

According to the generic names recommendation, this should be either
"keyboard@0" or "mouse@0", but of course the two interfaces are
identical and EDK doesn't have any information about how they are
used.  Perhaps the node name should be: "ps2@0".  David, thoughts?

>                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
>                         reg = <0 40>;
> -                       interrupt-parent = <&opb-intc>;
> +                       interrupt-parent = <&opb_intc_0>;
>                         interrupts = <3 0>;
>                         cell-index = <0>;
>                 };
> -               ps2@1000 {
> +               opb-ps2-dual-ref@1000 {
>                         compatible = "xlnx,opb-ps2-dual-ref-1.00.a";
>                         reg = <1000 40>;
> -                       interrupt-parent = <&opb-intc>;
> +                       interrupt-parent = <&opb_intc_0>;
>                         interrupts = <3 0>;
>                         cell-index = <0>;
>                 };
> @@ -2447,17 +2454,18 @@ platforms are moved over to use the flattened-device-tree model.
>
>     Gives this device tree (some properties removed for clarity):
>
> -       plb-v34-0 {
> +       plb_v34 {

Steve, when I wrote this I was lazy and I didn't add the bus address.
However, if we don't have the base address I think we'll end up with
name collisions (especially in the MPMC case).  So, based on generic
names convention, this should probably simply be "plb@<baseaddr>".

>                 #address-cells = <1>;
>                 #size-cells = <1>;
> +               compatible = "xlnx,plb-v34-1.02.a";
>                 device_type = "ibm,plb";
>                 ranges; // 1:1 translation
>
> -               plb-bram-if-cntrl-0@ffff0000 {
> +               plb_bram_if_cntrl_0: plb-bram-if-cntrl@ffff0000 {

Node name should probably just be "bram@ffff0000" here.

>                         reg = <ffff0000 10000>;
>                 }
>
> -               opb-v20-0 {
> +               opb_v20 {

opb@<baseaddr>

>                         #address-cells = <1>;
>                         #size-cells = <1>;
>                         ranges = <20000000 20000000 20000000
> @@ -2465,11 +2473,11 @@ platforms are moved over to use the flattened-device-tree model.
>                                   80000000 80000000 40000000
>                                   c0000000 c0000000 20000000>;
>
> -                       opb-uart16550-0@a0000000 {
> +                       opb_uart16550_0: opb-uart16550@a0000000 {

serial@a0000000

>                                 reg = <a00000000 2000>;
>                         };
>
> -                       opb-intc-0@d1000fc0 {
> +                       opb_intc_0: opb-intc@d1000fc0 {

interrupt-controller@d1000fc0

>                                 reg = <d1000fc0 20>;
>                         };
>                 };
> @@ -2513,6 +2521,9 @@ platforms are moved over to use the flattened-device-tree model.
>
>        Requred properties:
>         - current-speed : Baud rate of uartlite
> +               Optional properties:
> +       - port-number : unique ordinal index of the device. This
> +         property is required for a console on uartlite.

And has already been discussed, drop the port-number property.  I'll
rework the uartlite driver to use aliases instead.

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* Re: [PATCH v2 2/3] mpc82xx: Embedded Planet EP8248E support
From: Scott Wood @ 2007-12-17 15:18 UTC (permalink / raw)
  To: Scott Wood, galak, linuxppc-dev
In-Reply-To: <20071217035912.GB3262@localhost.localdomain>

David Gibson wrote:
> As I think I said about another tree, this mdio-under-bcsr arrangement
> is pretty strange.  What's going on here.

As I answered then, it's just the way the hardware is.  I didn't design 
it. :-P

>> +	soc@f0000000 {
>> +		#address-cells = <1>;
>> +		#size-cells = <1>;
>> +		device_type = "soc";
> 
> Ditch the device_type.

No, it's used by the bootwrapper.  I'll get rid of it if you want to 
write a find_node_by_compatible() function. :-)

-Scott

^ permalink raw reply

* Re: USB configuration
From: Scott Wood @ 2007-12-17 15:21 UTC (permalink / raw)
  To: Misbah khan; +Cc: linuxppc-embedded
In-Reply-To: <14370084.post@talk.nabble.com>

Misbah khan wrote:
> I have configured for mass storage device still i am not getting the debug
> msg that the kernel has detected the pen drive (after i connect the pen
> drive ).
> 
>   " Initializing USB Mass Storage driver...
>      usbcore: registered new driver usb-storage
>      USB Mass Storage support registered. 
>   "

Did you get any output indicating that the USB controller was found and 
initialized?  This *is* a PCI-based OHCI controller you're trying to 
use, and not the CPM USB, right?  Do other PCI devices work?

-Scott

^ permalink raw reply

* Re: [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of.
From: Grant Likely @ 2007-12-17 15:27 UTC (permalink / raw)
  To: Peter Korsgaard; +Cc: linuxppc-dev, simekm2
In-Reply-To: <87d4t5a5zj.fsf@macbook.be.48ers.dk>

On 12/17/07, Peter Korsgaard <jacmet@sunsite.dk> wrote:
> >>>>> "Grant" == Grant Likely <grant.likely@secretlab.ca> writes:
>
> Hi,
>
>  >> > 3) Uartlite requires a port-number property for the console to work.
>  >>
>  >> Why?  In general we try to avoid magical sequence numbers - cell-index
>  >> should *only* be used when it's needed to index or program some shared
>  >> register.
>
>  Grant> Aliases is probably the correct construct for this.
>  Grant> port-number was a bad idea and I never should have gone that
>  Grant> direction.
>
> Perhaps it would make more sense to add a _find_match_or_unused(port)
> like 8250.c and make the initialization order define the index instead
> of explicitly setting it?

aliases I think is the better approach as it is an already established
convention.

enumeration based on init order is fragile and there is no guarantee
that order will not change in the future.

>
> Now we're at it - Why isn't the uartlite of glue handled by of_serial.c?

The of_serial.c glue is IMHO too complex for the uartlite case.  I saw
no advantage provided by the added complexity.  (ulite_of_probe() is
all of 12 lines of code).

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* [RFC] ehea: kdump support - rework
From: Thomas Klein @ 2007-12-17 15:52 UTC (permalink / raw)
  To: Paul Mackerras
  Cc: Michael Neuling, Jan-Bernd Themann, netdev, linux-kernel,
	linux-ppc, Christoph Raisch, Marcus Eder, Stefan Roscher

This patch adds kdump support using the new PPC crash shutdown hook to the
ehea driver.
The reworked implementation follows the feedback I got. The crash handler
now just iterates over two simple arrays instead of handling linked lists.

Further feedback will be appreciated.

ehea kdump support RFC #1:
  http://lkml.org/lkml/2007/12/12/241


Signed-off-by: Thomas Klein <tklein@de.ibm.com>

---
diff -Nurp -X dontdiff linux-2.6.24-rc5/drivers/net/ehea/ehea.h patched_kernel/drivers/net/ehea/ehea.h
--- linux-2.6.24-rc5/drivers/net/ehea/ehea.h	2007-12-11 04:48:43.000000000 +0100
+++ patched_kernel/drivers/net/ehea/ehea.h	2007-12-17 16:18:49.000000000 +0100
@@ -40,7 +40,7 @@
 #include <asm/io.h>
 
 #define DRV_NAME	"ehea"
-#define DRV_VERSION	"EHEA_0083"
+#define DRV_VERSION	"EHEA_0085"
 
 /* eHEA capability flags */
 #define DLPAR_PORT_ADD_REM 1
@@ -386,6 +386,13 @@ struct ehea_port_res {
 
 
 #define EHEA_MAX_PORTS 16
+
+#define EHEA_NUM_PORTRES_FW_HANDLES    6  /* QP handle, SendCQ handle,
+					     RecvCQ handle, EQ handle,
+					     SendMR handle, RecvMR handle */
+#define EHEA_NUM_PORT_FW_HANDLES       1  /* EQ handle */
+#define EHEA_NUM_ADAPTER_FW_HANDLES    2  /* MR handle, NEQ handle */
+
 struct ehea_adapter {
 	u64 handle;
 	struct of_device *ofdev;
@@ -405,6 +412,31 @@ struct ehea_mc_list {
 	u64 macaddr;
 };
 
+/* kdump support */
+struct ehea_fw_handle_entry {
+	u64 adh;               /* Adapter Handle */
+	u64 fwh;               /* Firmware Handle */
+};
+
+struct ehea_fw_handle_array {
+	struct ehea_fw_handle_entry *arr;
+	int num_entries;
+	struct semaphore lock;
+};
+
+struct ehea_bcmc_reg_entry {
+	u64 adh;               /* Adapter Handle */
+	u32 port_id;           /* Logical Port Id */
+	u8 reg_type;           /* Registration Type */
+	u64 macaddr;
+};
+
+struct ehea_bcmc_reg_array {
+	struct ehea_bcmc_reg_entry *arr;
+	int num_entries;
+	struct semaphore lock;
+};
+
 #define EHEA_PORT_UP 1
 #define EHEA_PORT_DOWN 0
 #define EHEA_PHY_LINK_UP 1
diff -Nurp -X dontdiff linux-2.6.24-rc5/drivers/net/ehea/ehea_main.c patched_kernel/drivers/net/ehea/ehea_main.c
--- linux-2.6.24-rc5/drivers/net/ehea/ehea_main.c	2007-12-11 04:48:43.000000000 +0100
+++ patched_kernel/drivers/net/ehea/ehea_main.c	2007-12-17 16:18:49.000000000 +0100
@@ -35,6 +35,7 @@
 #include <linux/if_ether.h>
 #include <linux/notifier.h>
 #include <linux/reboot.h>
+#include <asm/kexec.h>
 
 #include <net/ip.h>
 
@@ -98,8 +99,10 @@ static int port_name_cnt = 0;
 static LIST_HEAD(adapter_list);
 u64 ehea_driver_flags = 0;
 struct work_struct ehea_rereg_mr_task;
-
 struct semaphore dlpar_mem_lock;
+struct ehea_fw_handle_array ehea_fw_handles;
+struct ehea_bcmc_reg_array ehea_bcmc_regs;
+
 
 static int __devinit ehea_probe_adapter(struct of_device *dev,
 					const struct of_device_id *id);
@@ -131,6 +134,160 @@ void ehea_dump(void *adr, int len, char 
 	}
 }
 
+static void ehea_update_firmware_handles(void)
+{
+	struct ehea_fw_handle_entry *arr = NULL;
+	struct ehea_adapter *adapter;
+	int num_adapters = 0;
+	int num_ports = 0;
+	int num_portres = 0;
+	int i = 0;
+	int num_fw_handles, k, l;
+
+	/* Determine number of handles */
+	list_for_each_entry(adapter, &adapter_list, list) {
+		num_adapters++;
+
+		for (k = 0; k < EHEA_MAX_PORTS; k++) {
+			struct ehea_port *port = adapter->port[k];
+
+			if (!port || (port->state != EHEA_PORT_UP))
+				continue;
+
+			num_ports++;
+			num_portres += port->num_def_qps + port->num_add_tx_qps;
+		}
+	}
+
+	num_fw_handles = num_adapters * EHEA_NUM_ADAPTER_FW_HANDLES +
+			 num_ports * EHEA_NUM_PORT_FW_HANDLES +
+			 num_portres * EHEA_NUM_PORTRES_FW_HANDLES;
+
+	if (num_fw_handles) {
+		arr = kzalloc(num_fw_handles * sizeof(*arr), GFP_KERNEL);
+		if (!arr)
+			return;  /* Keep the existing array */
+	} else
+		goto out_update;
+
+	list_for_each_entry(adapter, &adapter_list, list) {
+		for (k = 0; k < EHEA_MAX_PORTS; k++) {
+			struct ehea_port *port = adapter->port[k];
+
+			if (!port || (port->state != EHEA_PORT_UP))
+				continue;
+
+			for (l = 0;
+			     l < port->num_def_qps + port->num_add_tx_qps;
+			     l++) {
+				struct ehea_port_res *pr = &port->port_res[l];
+
+				arr[i].adh = adapter->handle;
+				arr[i++].fwh = pr->qp->fw_handle;
+				arr[i].adh = adapter->handle;
+				arr[i++].fwh = pr->send_cq->fw_handle;
+				arr[i].adh = adapter->handle;
+				arr[i++].fwh = pr->recv_cq->fw_handle;
+				arr[i].adh = adapter->handle;
+				arr[i++].fwh = pr->eq->fw_handle;
+				arr[i].adh = adapter->handle;
+				arr[i++].fwh = pr->send_mr.handle;
+				arr[i].adh = adapter->handle;
+				arr[i++].fwh = pr->recv_mr.handle;
+			}
+			arr[i].adh = adapter->handle;
+			arr[i++].fwh = port->qp_eq->fw_handle;
+		}
+
+		arr[i].adh = adapter->handle;
+		arr[i++].fwh = adapter->neq->fw_handle;
+
+		if (adapter->mr.handle) {
+			arr[i].adh = adapter->handle;
+			arr[i++].fwh = adapter->mr.handle;
+		}
+	}
+
+out_update:
+	kfree(ehea_fw_handles.arr);
+	ehea_fw_handles.arr = arr;
+	ehea_fw_handles.num_entries = i;
+}
+
+static void ehea_update_bcmc_registrations(void)
+{
+	struct ehea_bcmc_reg_entry *arr = NULL;
+	struct ehea_adapter *adapter;
+	struct ehea_mc_list *mc_entry;
+	int num_registrations = 0;
+	int i = 0;
+	int k;
+
+	/* Determine number of registrations */
+	list_for_each_entry(adapter, &adapter_list, list)
+		for (k = 0; k < EHEA_MAX_PORTS; k++) {
+			struct ehea_port *port = adapter->port[k];
+
+			if (!port || (port->state != EHEA_PORT_UP))
+				continue;
+
+			num_registrations += 2;	/* Broadcast registrations */
+
+			list_for_each_entry(mc_entry, &port->mc_list->list,list)
+				num_registrations += 2;
+		}
+
+	if (num_registrations) {
+		arr = kzalloc(num_registrations * sizeof(*arr), GFP_KERNEL);
+		if (!arr)
+			return;  /* Keep the existing array */
+	} else
+		goto out_update;
+
+	list_for_each_entry(adapter, &adapter_list, list) {
+		for (k = 0; k < EHEA_MAX_PORTS; k++) {
+			struct ehea_port *port = adapter->port[k];
+
+			if (!port || (port->state != EHEA_PORT_UP))
+				continue;
+
+			arr[i].adh = adapter->handle;
+			arr[i].port_id = port->logical_port_id;
+			arr[i].reg_type = EHEA_BCMC_BROADCAST |
+					  EHEA_BCMC_UNTAGGED;
+			arr[i++].macaddr = port->mac_addr;
+
+			arr[i].adh = adapter->handle;
+			arr[i].port_id = port->logical_port_id;
+			arr[i].reg_type = EHEA_BCMC_BROADCAST |
+					  EHEA_BCMC_VLANID_ALL;
+			arr[i++].macaddr = port->mac_addr;
+
+			list_for_each_entry(mc_entry,
+					    &port->mc_list->list, list) {
+				arr[i].adh = adapter->handle;
+				arr[i].port_id = port->logical_port_id;
+				arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
+						  EHEA_BCMC_MULTICAST |
+						  EHEA_BCMC_UNTAGGED;
+				arr[i++].macaddr = mc_entry->macaddr;
+
+				arr[i].adh = adapter->handle;
+				arr[i].port_id = port->logical_port_id;
+				arr[i].reg_type = EHEA_BCMC_SCOPE_ALL |
+						  EHEA_BCMC_MULTICAST |
+						  EHEA_BCMC_VLANID_ALL;
+				arr[i++].macaddr = mc_entry->macaddr;
+			}
+		}
+	}
+
+out_update:
+	kfree(ehea_bcmc_regs.arr);
+	ehea_bcmc_regs.arr = arr;
+	ehea_bcmc_regs.num_entries = i;
+}
+
 static struct net_device_stats *ehea_get_stats(struct net_device *dev)
 {
 	struct ehea_port *port = netdev_priv(dev);
@@ -1595,19 +1752,25 @@ static int ehea_set_mac_addr(struct net_
 
 	memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);
 
+	down(&ehea_bcmc_regs.lock);
+
 	/* Deregister old MAC in pHYP */
 	ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
 	if (ret)
-		goto out_free;
+		goto out_upregs;
 
 	port->mac_addr = cb0->port_mac_addr << 16;
 
 	/* Register new MAC in pHYP */
 	ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
 	if (ret)
-		goto out_free;
+		goto out_upregs;
 
 	ret = 0;
+
+out_upregs:
+	ehea_update_bcmc_registrations();
+	up(&ehea_bcmc_regs.lock);
 out_free:
 	kfree(cb0);
 out:
@@ -1769,9 +1932,11 @@ static void ehea_set_multicast_list(stru
 	}
 	ehea_promiscuous(dev, 0);
 
+	down(&ehea_bcmc_regs.lock);
+
 	if (dev->flags & IFF_ALLMULTI) {
 		ehea_allmulti(dev, 1);
-		return;
+		goto out;
 	}
 	ehea_allmulti(dev, 0);
 
@@ -1798,6 +1963,8 @@ static void ehea_set_multicast_list(stru
 		}
 	}
 out:
+	ehea_update_bcmc_registrations();
+	up(&ehea_bcmc_regs.lock);
 	return;
 }
 
@@ -2280,6 +2447,8 @@ static int ehea_up(struct net_device *de
 	if (port->state == EHEA_PORT_UP)
 		return 0;
 
+	down(&ehea_fw_handles.lock);
+
 	ret = ehea_port_res_setup(port, port->num_def_qps,
 				  port->num_add_tx_qps);
 	if (ret) {
@@ -2316,8 +2485,17 @@ static int ehea_up(struct net_device *de
 		}
 	}
 
-	ret = 0;
+	down(&ehea_bcmc_regs.lock);
+
+	ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
+	if (ret) {
+		ret = -EIO;
+		goto out_free_irqs;
+	}
+
 	port->state = EHEA_PORT_UP;
+
+	ret = 0;
 	goto out;
 
 out_free_irqs:
@@ -2329,6 +2507,12 @@ out:
 	if (ret)
 		ehea_info("Failed starting %s. ret=%i", dev->name, ret);
 
+	ehea_update_bcmc_registrations();
+	up(&ehea_bcmc_regs.lock);
+
+	ehea_update_firmware_handles();
+	up(&ehea_fw_handles.lock);
+
 	return ret;
 }
 
@@ -2377,16 +2561,27 @@ static int ehea_down(struct net_device *
 	if (port->state == EHEA_PORT_DOWN)
 		return 0;
 
+	down(&ehea_bcmc_regs.lock);
 	ehea_drop_multicast_list(dev);
+	ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
+
 	ehea_free_interrupts(dev);
 
+	down(&ehea_fw_handles.lock);
+
 	port->state = EHEA_PORT_DOWN;
 
+	ehea_update_bcmc_registrations();
+	up(&ehea_bcmc_regs.lock);
+
 	ret = ehea_clean_all_portres(port);
 	if (ret)
 		ehea_info("Failed freeing resources for %s. ret=%i",
 			  dev->name, ret);
 
+	ehea_update_firmware_handles();
+	up(&ehea_fw_handles.lock);
+
 	return ret;
 }
 
@@ -2952,19 +3147,12 @@ struct ehea_port *ehea_setup_single_port
 	dev->watchdog_timeo = EHEA_WATCH_DOG_TIMEOUT;
 
 	INIT_WORK(&port->reset_task, ehea_reset_port);
-
-	ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
-	if (ret) {
-		ret = -EIO;
-		goto out_unreg_port;
-	}
-
 	ehea_set_ethtool_ops(dev);
 
 	ret = register_netdev(dev);
 	if (ret) {
 		ehea_error("register_netdev failed. ret=%d", ret);
-		goto out_dereg_bc;
+		goto out_unreg_port;
 	}
 
 	port->lro_max_aggr = lro_max_aggr;
@@ -2981,9 +3169,6 @@ struct ehea_port *ehea_setup_single_port
 
 	return port;
 
-out_dereg_bc:
-	ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
-
 out_unreg_port:
 	ehea_unregister_port(port);
 
@@ -3003,7 +3188,6 @@ static void ehea_shutdown_single_port(st
 {
 	unregister_netdev(port->netdev);
 	ehea_unregister_port(port);
-	ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
 	kfree(port->mc_list);
 	free_netdev(port->netdev);
 	port->adapter->active_ports--;
@@ -3046,7 +3230,6 @@ static int ehea_setup_ports(struct ehea_
 
 		i++;
 	};
-
 	return 0;
 }
 
@@ -3191,6 +3374,7 @@ static int __devinit ehea_probe_adapter(
 		ehea_error("Invalid ibmebus device probed");
 		return -EINVAL;
 	}
+	down(&ehea_fw_handles.lock);
 
 	adapter = kzalloc(sizeof(*adapter), GFP_KERNEL);
 	if (!adapter) {
@@ -3271,7 +3455,10 @@ out_kill_eq:
 
 out_free_ad:
 	kfree(adapter);
+
 out:
+	ehea_update_firmware_handles();
+	up(&ehea_fw_handles.lock);
 	return ret;
 }
 
@@ -3290,18 +3477,41 @@ static int __devexit ehea_remove(struct 
 
 	flush_scheduled_work();
 
+	down(&ehea_fw_handles.lock);
+
 	ibmebus_free_irq(adapter->neq->attr.ist1, adapter);
 	tasklet_kill(&adapter->neq_tasklet);
 
 	ehea_destroy_eq(adapter->neq);
 	ehea_remove_adapter_mr(adapter);
 	list_del(&adapter->list);
-
 	kfree(adapter);
 
+	ehea_update_firmware_handles();
+	up(&ehea_fw_handles.lock);
+
 	return 0;
 }
 
+void ehea_crash_handler(void)
+{
+	int i;
+
+	if (ehea_fw_handles.arr)
+		for (i = 0; i < ehea_fw_handles.num_entries; i++)
+			ehea_h_free_resource(ehea_fw_handles.arr[i].adh,
+					     ehea_fw_handles.arr[i].fwh,
+					     FORCE_FREE);
+
+	if (ehea_bcmc_regs.arr)
+		for (i = 0; i < ehea_bcmc_regs.num_entries; i++)
+			ehea_h_reg_dereg_bcmc(ehea_bcmc_regs.arr[i].adh,
+					      ehea_bcmc_regs.arr[i].port_id,
+					      ehea_bcmc_regs.arr[i].reg_type,
+					      ehea_bcmc_regs.arr[i].macaddr,
+					      0, H_DEREG_BCMC);
+}
+
 static int ehea_reboot_notifier(struct notifier_block *nb,
 				unsigned long action, void *unused)
 {
@@ -3362,7 +3572,12 @@ int __init ehea_module_init(void)
 
 
 	INIT_WORK(&ehea_rereg_mr_task, ehea_rereg_mrs);
+	memset(&ehea_fw_handles, 0, sizeof(ehea_fw_handles));
+	memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));
+
 	sema_init(&dlpar_mem_lock, 1);
+	sema_init(&ehea_fw_handles.lock, 1);
+	sema_init(&ehea_bcmc_regs.lock, 1);
 
 	ret = check_module_parm();
 	if (ret)
@@ -3373,6 +3588,9 @@ int __init ehea_module_init(void)
 		goto out;
 
 	register_reboot_notifier(&ehea_reboot_nb);
+	ret = crash_shutdown_register(&ehea_crash_handler);
+	if (ret)
+		ehea_info("failed registering crash handler");
 
 	ret = ibmebus_register_driver(&ehea_driver);
 	if (ret) {
@@ -3386,6 +3604,7 @@ int __init ehea_module_init(void)
 		ehea_error("failed to register capabilities attribute, ret=%d",
 			   ret);
 		unregister_reboot_notifier(&ehea_reboot_nb);
+		crash_shutdown_unregister(&ehea_crash_handler);
 		ibmebus_unregister_driver(&ehea_driver);
 		goto out;
 	}
@@ -3396,10 +3615,17 @@ out:
 
 static void __exit ehea_module_exit(void)
 {
+	int ret;
+
 	flush_scheduled_work();
 	driver_remove_file(&ehea_driver.driver, &driver_attr_capabilities);
 	ibmebus_unregister_driver(&ehea_driver);
 	unregister_reboot_notifier(&ehea_reboot_nb);
+	ret = crash_shutdown_unregister(&ehea_crash_handler);
+	if (ret)
+		ehea_info("failed unregistering crash handler");
+	kfree(ehea_fw_handles.arr);
+	kfree(ehea_bcmc_regs.arr);
 	ehea_destroy_busmap();
 }

^ permalink raw reply

* Re: [PATCH v2 1/3] 8xx: Analogue & Micro Adder875 board support.
From: Scott Wood @ 2007-12-17 15:15 UTC (permalink / raw)
  To: Scott Wood, galak, linuxppc-dev
In-Reply-To: <20071217035706.GA3262@localhost.localdomain>

David Gibson wrote:
> On Wed, Dec 12, 2007 at 04:54:27PM -0600, Scott Wood wrote:
>> Signed-off-by: Scott Wood <scottwood@freescale.com>
> [snip]
>> diff --git a/arch/powerpc/boot/dts/adder875-redboot.dts b/arch/powerpc/boot/dts/adder875-redboot.dts
>> new file mode 100644
>> index 0000000..4d28220
>> --- /dev/null
>> +++ b/arch/powerpc/boot/dts/adder875-redboot.dts
> [snip]
>> diff --git a/arch/powerpc/boot/dts/adder875-uboot.dts b/arch/powerpc/boot/dts/adder875-uboot.dts
>> new file mode 100644
>> index 0000000..33d198c
>> --- /dev/null
>> +++ b/arch/powerpc/boot/dts/adder875-uboot.dts
> 
> Having two different device trees for the different firmwares is
> pretty yucky, and could be a pain in the bum for synchronization of
> fixes.

Yes, that's why we need some sort of macro/template facility in dtc. :-)

> Can't you have a common tree, and just poke the places that
> are differently configured by the two firmwares from the bootwrapper.

Enh.  That can get icky as well, and the bootwrapper isn't necessarily 
even used for u-boot, and I'd rather not require it be used just for this.

-Scott

^ permalink raw reply

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Scott Wood @ 2007-12-17 17:03 UTC (permalink / raw)
  To: Anton Vorontsov, Kumar Gala, Stephen Rothwell, linuxppc-dev,
	Kim Phillips
In-Reply-To: <20071217051403.GB3477@localhost.localdomain>

On Mon, Dec 17, 2007 at 04:14:03PM +1100, David Gibson wrote:
> > +		crypto@30000 {
> > +			device_type = "crypto";
> > +			model = "SEC2";
> > +			compatible = "talitos";
> 
> This device_type/compatible/model stuff is also crap, although I
> suspect it needs to be fixed in the driver, as gianfar (finally) was.

The driver doesn't seem to be in-tree... Kim, what do(es) the external
driver(s) look like?  Do they use OF at all yet?

> > +		ranges = <0 0xe0100000 0x00100000>;
> > +		reg = <0xe0100000 0x480>;
> > +		/* filled by u-boot */
> > +		brg-frequency = <0>;
> > +		bus-frequency = <0>;
> 
> This should probably be clock-frequency, not bus-frequency.  After
> all, it's a bus node, what other sort of frequency would it be.

Actually, it should probably be dropped altogether.

> > +		muram@10000 {
> > +			device_type = "muram";
> 
> And this device_type needs to go, too.

Yes, replace it with compatible = "fsl,cpm-muram".

> > +			ranges = <0 0x00010000 0x0000c000>;
> > +
> > +			data-only@0 {
> > +				reg = <0 0xc000>;

compatible = "fsl,cpm-muram-data".

> > +			phy1: ethernet-phy@1 {
> > +				reg = <1>;
> > +				device_type = "ethernet-phy";
> > +			};
> 
> These phy nodes have basically no information in them.  PHY nodes are
> optional -

If they are truly optional, then several Linux drivers (including ucc_geth,
which this board uses) are broken, as they'll error out if there's no
phy-handle (gianfar is even worse -- it looks like the fsl_soc code will
crash in that case).  But what do you propose they do in the absence of a
phy-handle?  Hope that probing only finds one phy?

> only include them if they actually have something useful to say (which
> would mean at least a compatible property).

They *do* have useful information -- reg and phandle.  The type of phy can
be probed, but which phy corresponds to which ethernet can't.

-Scott

^ permalink raw reply

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Kim Phillips @ 2007-12-17 17:10 UTC (permalink / raw)
  To: Scott Wood; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20071217170303.GA4303@loki.buserror.net>

On Mon, 17 Dec 2007 11:03:04 -0600
Scott Wood <scottwood@freescale.com> wrote:

> On Mon, Dec 17, 2007 at 04:14:03PM +1100, David Gibson wrote:
> > > +		crypto@30000 {
> > > +			device_type = "crypto";
> > > +			model = "SEC2";
> > > +			compatible = "talitos";
> > 
> > This device_type/compatible/model stuff is also crap, although I
> > suspect it needs to be fixed in the driver, as gianfar (finally) was.
> 
> The driver doesn't seem to be in-tree... Kim, what do(es) the external
> driver(s) look like?  Do they use OF at all yet?

yes, it uses OF ifdef CONFIG_PPC_MERGE.

Kim

^ permalink raw reply

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Scott Wood @ 2007-12-17 17:20 UTC (permalink / raw)
  To: Kim Phillips; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20071217111004.506f3563.kim.phillips@freescale.com>

Kim Phillips wrote:
> On Mon, 17 Dec 2007 11:03:04 -0600
> Scott Wood <scottwood@freescale.com> wrote:
>> The driver doesn't seem to be in-tree... Kim, what do(es) the external
>> driver(s) look like?  Do they use OF at all yet?
> 
> yes, it uses OF ifdef CONFIG_PPC_MERGE.

Can we change it to look for something like a compatible of 
"fsl,sec2-crypto", with a fallback match on talitos for old device trees?

-Scott

^ permalink raw reply

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Kim Phillips @ 2007-12-17 17:42 UTC (permalink / raw)
  To: Scott Wood; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <4766AFEE.1040701@freescale.com>

On Mon, 17 Dec 2007 11:20:46 -0600
Scott Wood <scottwood@freescale.com> wrote:

> Kim Phillips wrote:
> > On Mon, 17 Dec 2007 11:03:04 -0600
> > Scott Wood <scottwood@freescale.com> wrote:
> >> The driver doesn't seem to be in-tree... Kim, what do(es) the external
> >> driver(s) look like?  Do they use OF at all yet?
> > 
> > yes, it uses OF ifdef CONFIG_PPC_MERGE.
> 
> Can we change it to look for something like a compatible of 
> "fsl,sec2-crypto", with a fallback match on talitos for old device trees?

yep, that looks good, I'll update the driver according to these changes.

Kim

^ permalink raw reply

* RE: [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of.
From: Stephen Neuendorffer @ 2007-12-17 18:24 UTC (permalink / raw)
  To: Grant Likely; +Cc: linuxppc-dev, David Gibson, simekm2
In-Reply-To: <fa686aa40712170719o29da3caew43d65225feea9ba@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1882 bytes --]

When the driver no longer requires the port number, it's easy to drop.  Until then, I'll keep it in.
 
Also, I'm not so sure that moving to completely generic names is really worth the effort...  All the 'semantically' interesting' information is already in the device tree somewhere else.  In the limit, the node name could just be a randomly generated string.  So now we have a matter of taste: what is the right amount of detail to put in so that someone who looks at the tree can easily understand what's going on, but not be overwhelmed?  The xilinx ip name seems to usually do that almost as well as a 'generic name'.  Anyway, you proved me wrong last time after a bunch of mulling it over, so maybe I'll just take your word for it and do it that way. :)
 
In other news, my computer seems to have died this morning, so productivity may be low. :)
 
Steve

________________________________

From: glikely@secretlab.ca on behalf of Grant Likely
Sent: Mon 12/17/2007 7:19 AM
To: Stephen Neuendorffer
Cc: simekm2@fel.cvut.cz; jwilliams@itee.uq.edu.au; linuxppc-dev@ozlabs.org; David Gibson
Subject: Re: [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of.

>                                 reg = <d1000fc0 20>;
>                         };
>                 };
> @@ -2513,6 +2521,9 @@ platforms are moved over to use the flattened-device-tree model.
>
>        Requred properties:
>         - current-speed : Baud rate of uartlite
> +               Optional properties:
> +       - port-number : unique ordinal index of the device. This
> +         property is required for a console on uartlite.

And has already been discussed, drop the port-number property.  I'll
rework the uartlite driver to use aliases instead.

Cheers,
g.

--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195



[-- Attachment #2: Type: text/html, Size: 3445 bytes --]

^ permalink raw reply

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Vitaly Bordug @ 2007-12-17 18:26 UTC (permalink / raw)
  To: Scott Wood; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20071217170303.GA4303@loki.buserror.net>

On Mon, 17 Dec 2007 11:03:04 -0600
Scott Wood wrote:

> > > +			phy1: ethernet-phy@1 {
> > > +				reg = <1>;
> > > +				device_type = "ethernet-phy";
> > > +			};  
> > 
> > These phy nodes have basically no information in them.  PHY nodes
> > are optional -  
> 
> If they are truly optional, then several Linux drivers (including
> ucc_geth, which this board uses) are broken, as they'll error out if
> there's no phy-handle (gianfar is even worse -- it looks like the
> fsl_soc code will crash in that case).  But what do you propose they
> do in the absence of a phy-handle?  Hope that probing only finds one
> phy?

up-to-date fixed phy patch solves it in gianfar and fs_enet case. it is implied, that either there *are* phy nodes (and the
code will look up their reg and phandle) or there should be fixed-link property in NIC node, that describes to what link stuff
is really connected.

As a recap, we can kill this, but powerpc will live without SoC network stuff then (modulo 4xx). IOW, if we have to change bits around here, that should happen for all the boards, using current notation, or it will soon become maintenance hell.
-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: USB configuration
From: Vitaly Bordug @ 2007-12-17 18:33 UTC (permalink / raw)
  To: Misbah khan; +Cc: Vitaly Bordug, linuxppc-embedded
In-Reply-To: <14192347.post@talk.nabble.com>

On Thu, 6 Dec 2007 05:27:14 -0800 (PST)
Misbah khan wrote:

> 
> HI all ...
> I have configured the Montavista Kernel for USB support and for
> PPC8272-ADS board I need to know that how could i test that my USB is
> working ????
> 

I'm not sure what MV version you are trying to use, but there is no support for USB host(I am about 8272ads).
MV supports USB gadget though...
> Its creating the directory :- /proc/bus/usb/ but doesent contain any
> file under it ????
> 
you enabled generic usb support. But no HW/driver picking it up
> 
> its also creating the directory :- /sys/bus/usb/   but doesent
> contain any file under it ????
> 
same reason
> 
> Please let me know the procedure to test whether my USB configuration
> is all right ????
> 
First, if you want to use USB host, you'll have to develop the driver first or assist someone doing that (there yet another such attempt recently initiated - see linuxppc-dev logs)

> Thank u 
> Misbah <><


-- 
Sincerely, Vitaly

^ permalink raw reply

* Re: [PATCH 7/7] [POWERPC] Xilinx: Update booting-without-of.
From: Grant Likely @ 2007-12-17 18:40 UTC (permalink / raw)
  To: Stephen Neuendorffer; +Cc: linuxppc-dev, David Gibson, simekm2
In-Reply-To: <20071217182459.7972AAE804F@mail50-dub.bigfish.com>

On 12/17/07, Stephen Neuendorffer <stephen.neuendorffer@xilinx.com> wrote:
>
> When the driver no longer requires the port number, it's easy to drop.
> Until then, I'll keep it in.
>
> Also, I'm not so sure that moving to completely generic names is really
> worth the effort...  All the 'semantically' interesting' information is
> already in the device tree somewhere else.  In the limit, the node name
> could just be a randomly generated string.  So now we have a matter of
> taste: what is the right amount of detail to put in so that someone who
> looks at the tree can easily understand what's going on, but not be
> overwhelmed?

True, but part of 'taste' is following the established OF conventions
such as the generic names  ( http://playground.sun.com/1275/practice/
).  Those conventions come directly from the lessons learned by real
open firmware over the years.  It's okay to break convention; but only
if you've got a *damn* *good* reason for doing so.  :-)

>  The xilinx ip name seems to usually do that almost as well as
> a 'generic name'.  Anyway, you proved me wrong last time after a bunch of
> mulling it over, so maybe I'll just take your word for it and do it that
> way. :)

heh,   And a big reason I'm arguing it is David, Segher and others
took me to task for making the same mistakes.  :-)

> In other news, my computer seems to have died this morning, so productivity
> may be low. :)

Fun.  :-(

Cheers,
g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
grant.likely@secretlab.ca
(403) 399-0195

^ permalink raw reply

* 1st version of azfs
From: Maxim Shchetynin @ 2007-12-17 18:45 UTC (permalink / raw)
  To: linuxppc-dev, linux-mm, linux-kernel, arnd


Hello,

please, have a look at the following patch. This is a first version of =
a
non-buffered filesystem to be used on "ioremapped" devices.
Thank you in advance for your comments.

Subject: azfs: initial submit of azfs, a non-buffered filesystem

From: Maxim Shchetynin <maxim@de.ibm.com>

Non-buffered filesystem for block devices with a gendisk and
with direct_access() method in gendisk->fops.
AZFS does not buffer outgoing traffic and is doing no read ahead.
AZFS uses block-size and sector-size provided by block device
and gendisk's queue. Though mmap() method is available only if
block-size equals to or is greater than system page size.

Signed-off-by: Maxim Shchetynin <maxim@de.ibm.com>

diff -Nuar linux-2.6.24-rc4/arch/powerpc/configs/cell_defconfig
linux-2.6.24-rc4-azfs/arch/powerpc/configs/cell_defconfig
--- linux-2.6.24-rc4/arch/powerpc/configs/cell_defconfig
2007-12-14 11:44:09.000000000 +0100
+++ linux-2.6.24-rc4-azfs/arch/powerpc/configs/cell_defconfig
2007-12-07 17:47:35.000000000 +0100
@@ -206,6 +206,7 @@
 #
 # CONFIG_CPM2 is not set
 CONFIG_AXON_RAM=3Dm
+CONFIG_AZ_FS=3Dm
 # CONFIG_FSL_ULI1575 is not set

 #
diff -Nuar linux-2.6.24-rc4/fs/Kconfig linux-2.6.24-rc4-azfs/fs/Kconfig=

--- linux-2.6.24-rc4/fs/Kconfig            2007-12-14 11:44:23.00000000=
0
+0100
+++ linux-2.6.24-rc4-azfs/fs/Kconfig             2007-12-07
17:47:35.000000000 +0100
@@ -359,6 +359,17 @@
               If you are not using a security module that requires usi=
ng
               extended attributes for file security labels, say N.

+config AZ_FS
+            tristate "AZFS filesystem support"
+            default m
+            help
+              Non-buffered filesystem for block devices with a gendisk=
 and
+              with direct_access() method in gendisk->fops.
+              AZFS does not buffer outgoing traffic and is doing no re=
ad
ahead.
+              AZFS uses block-size and sector-size provided by block
device
+              and gendisk's queue. Though mmap() method is available o=
nly
if
+              block-size equals to or is greater than system page size=
.
+
 config JFS_FS
             tristate "JFS filesystem support"
             select NLS
diff -Nuar linux-2.6.24-rc4/fs/Makefile linux-2.6.24-rc4-azfs/fs/Makefi=
le
--- linux-2.6.24-rc4/fs/Makefile           2007-12-14 11:44:42.00000000=
0
+0100
+++ linux-2.6.24-rc4-azfs/fs/Makefile            2007-12-14
11:48:47.000000000 +0100
@@ -118,3 +118,4 @@
 obj-$(CONFIG_DEBUG_FS)                    +=3D debugfs/
 obj-$(CONFIG_OCFS2_FS)                    +=3D ocfs2/
 obj-$(CONFIG_GFS2_FS)           +=3D gfs2/
+obj-$(CONFIG_AZ_FS)                       +=3D azfs.o
diff -Nuar linux-2.6.24-rc4/fs/azfs.c linux-2.6.24-rc4-azfs/fs/azfs.c
--- linux-2.6.24-rc4/fs/azfs.c             1970-01-01 01:00:00.00000000=
0
+0100
+++ linux-2.6.24-rc4-azfs/fs/azfs.c        2007-12-11 16:26:36.00000000=
0
+0100
@@ -0,0 +1,1083 @@
+/*
+ * (C) Copyright IBM Deutschland Entwicklung GmbH 2007
+ *
+ * Author: Maxim Shchetynin <maxim@de.ibm.com>
+ *
+ * Non-buffered filesystem driver.
+ * It registers a filesystem which may be used for all kind of block
devices
+ * which have a direct_access() method in block_device_operations.
+ *
+ * This program is free software; you can redistribute it and/or modif=
y
+ * it under the terms of the GNU General Public License as published b=
y
+ * the Free Software Foundation; either version 2, or (at your option)=

+ * any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+#include <linux/backing-dev.h>
+#include <linux/blkdev.h>
+#include <linux/cache.h>
+#include <linux/dcache.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/fs.h>
+#include <linux/genhd.h>
+#include <linux/kernel.h>
+#include <linux/limits.h>
+#include <linux/list.h>
+#include <linux/module.h>
+#include <linux/mount.h>
+#include <linux/mm.h>
+#include <linux/mm_types.h>
+#include <linux/mutex.h>
+#include <linux/namei.h>
+#include <linux/pagemap.h>
+#include <linux/slab.h>
+#include <linux/spinlock.h>
+#include <linux/stat.h>
+#include <linux/statfs.h>
+#include <linux/time.h>
+#include <linux/types.h>
+#include <linux/aio.h>
+#include <linux/uio.h>
+#include <asm/bug.h>
+#include <asm/page.h>
+#include <asm/pgtable.h>
+#include <asm/string.h>
+
+#define AZFS_FILESYSTEM_NAME                    "azfs"
+#define AZFS_FILESYSTEM_FLAGS                         FS_REQUIRES_DEV
+
+#define AZFS_SUPERBLOCK_MAGIC                         0xABBA1972
+#define AZFS_SUPERBLOCK_FLAGS                         MS_NOEXEC | \
+                                                            MS_SYNCHRO=
NOUS
| \
+                                                            MS_DIRSYNC=
 | \
+                                                            MS_ACTIVE
+
+#define AZFS_BDI_CAPABILITIES
BDI_CAP_NO_ACCT_DIRTY | \
+
BDI_CAP_NO_WRITEBACK | \
+
BDI_CAP_MAP_COPY | \
+
BDI_CAP_MAP_DIRECT | \
+
BDI_CAP_VMFLAGS
+
+#define AZFS_CACHE_FLAGS                        SLAB_HWCACHE_ALIGN | \=

+
SLAB_RECLAIM_ACCOUNT | \
+
SLAB_MEM_SPREAD
+
+enum azfs_direction {
+            AZFS_MMAP,
+            AZFS_READ,
+            AZFS_WRITE
+};
+
+struct azfs_super {
+            struct list_head                    list;
+            unsigned long                                   media_size=
;
+            unsigned long                                   block_size=
;
+            unsigned short                                  block_shif=
t;
+            unsigned long                                   sector_siz=
e;
+            unsigned short                                  sector_shi=
ft;
+            unsigned long                                   ph_addr;
+            unsigned long                                   io_addr;
+            struct block_device                       *blkdev;
+            struct dentry                                   *root;
+            struct list_head                    block_list;
+            rwlock_t                                  lock;
+};
+
+struct azfs_super_list {
+            struct list_head                    head;
+            spinlock_t                                lock;
+};
+
+struct azfs_block {
+            struct list_head                    list;
+            unsigned long                                   id;
+            unsigned long                                   count;
+};
+
+struct azfs_znode {
+            struct list_head                    block_list;
+            rwlock_t                                  lock;
+            loff_t                                                size=
;
+            struct inode                                    vfs_inode;=

+};
+
+static struct azfs_super_list                         super_list;
+static struct kmem_cache                        *azfs_znode_cache
__read_mostly =3D NULL;
+static struct kmem_cache                        *azfs_block_cache
__read_mostly =3D NULL;
+
+#define I2Z(inode) \
+            container_of(inode, struct azfs_znode, vfs_inode)
+
+#define for_each_block(block, block_list) \
+            list_for_each_entry(block, block_list, list)
+#define for_each_block_reverse(block, block_list) \
+            list_for_each_entry_reverse(block, block_list, list)
+#define for_each_block_safe(block, ding, block_list) \
+            list_for_each_entry_safe(block, ding, block_list, list)
+#define for_each_block_safe_reverse(block, ding, block_list) \
+            list_for_each_entry_safe_reverse(block, ding, block_list,
list)
+
+/**
+ * azfs_block_init - create and initialise a new block in a list
+ * @block_list: destination list
+ * @id: block id
+ * @count: size of a block
+ */
+static inline struct azfs_block*
+azfs_block_init(struct list_head *block_list,
+                        unsigned long id, unsigned long count)
+{
+            struct azfs_block *block;
+
+            block =3D kmem_cache_alloc(azfs_block_cache, GFP_KERNEL);
+            if (!block)
+                        return NULL;
+
+            block->id =3D id;
+            block->count =3D count;
+
+            INIT_LIST_HEAD(&block->list);
+            list_add_tail(&block->list, block_list);
+
+            return block;
+}
+
+/**
+ * azfs_block_free - remove block from a list and free it back in cach=
e
+ * @block: block to be removed
+ */
+static inline void
+azfs_block_free(struct azfs_block *block)
+{
+            list_del(&block->list);
+            kmem_cache_free(azfs_block_cache, block);
+}
+
+/**
+ * azfs_block_move - move block to another list
+ * @block: block to be moved
+ * @block_list: destination list
+ */
+static inline void
+azfs_block_move(struct azfs_block *block, struct list_head *block_list=
)
+{
+            list_move_tail(&block->list, block_list);
+}
+
+/**
+ * azfs_recherche - get real address of a part of a file
+ * @inode: inode
+ * @direction: data direction
+ * @from: offset for read/write operation
+ * @size: pointer to a value of the amount of data to be read/written
+ */
+static unsigned long
+azfs_recherche(struct inode *inode, enum azfs_direction direction,
+                   unsigned long from, unsigned long *size)
+{
+            struct azfs_super *super;
+            struct azfs_znode *znode;
+            struct azfs_block *block;
+            unsigned long block_id, west, east;
+
+            super =3D inode->i_sb->s_fs_info;
+            znode =3D I2Z(inode);
+
+            if (from + *size > znode->size) {
+                        i_size_write(inode, from + *size);
+                        inode->i_op->truncate(inode);
+            }
+
+            read_lock(&znode->lock);
+
+            if (list_empty(&znode->block_list)) {
+                        read_unlock(&znode->lock);
+                        return 0;
+            }
+
+            block_id =3D from >> super->block_shift;
+
+            for_each_block(block, &znode->block_list) {
+                        if (block->count > block_id)
+                                    break;
+                        block_id -=3D block->count;
+            }
+
+            west =3D from % super->block_size;
+            east =3D ((block->count - block_id) << super->block_shift)=
 -
west;
+
+            if (*size > east)
+                        *size =3D east;
+
+            block_id =3D ((block->id + block_id) << super->block_shift=
) +
west;
+
+            read_unlock(&znode->lock);
+
+            block_id +=3D direction =3D=3D AZFS_MMAP ? super->ph_addr =
:
super->io_addr;
+
+            return block_id;
+}
+
+static struct inode*
+azfs_new_inode(struct super_block *, struct inode *, int, dev_t);
+
+/**
+ * azfs_mknod - mknod() method for inode_operations
+ * @dir, @dentry, @mode, @dev: see inode_operations methods
+ */
+static int
+azfs_mknod(struct inode *dir, struct dentry *dentry, int mode, dev_t d=
ev)
+{
+            struct inode *inode;
+
+            inode =3D azfs_new_inode(dir->i_sb, dir, mode, dev);
+            if (!inode)
+                        return -ENOSPC;
+
+            if (S_ISREG(mode))
+                        I2Z(inode)->size =3D 0;
+
+            dget(dentry);
+            d_instantiate(dentry, inode);
+
+            return 0;
+}
+
+/**
+ * azfs_create - create() method for inode_operations
+ * @dir, @dentry, @mode, @nd: see inode_operations methods
+ */
+static int
+azfs_create(struct inode *dir, struct dentry *dentry, int mode,
+                struct nameidata *nd)
+{
+            return azfs_mknod(dir, dentry, mode | S_IFREG, 0);
+}
+
+/**
+ * azfs_mkdir - mkdir() method for inode_operations
+ * @dir, @dentry, @mode: see inode_operations methods
+ */
+static int
+azfs_mkdir(struct inode *dir, struct dentry *dentry, int mode)
+{
+            int rc;
+
+            rc =3D azfs_mknod(dir, dentry, mode | S_IFDIR, 0);
+            if (rc =3D=3D 0)
+                        inc_nlink(dir);
+
+            return rc;
+}
+
+/**
+ * azfs_symlink - symlink() method for inode_operations
+ * @dir, @dentry, @name: see inode_operations methods
+ */
+static int
+azfs_symlink(struct inode *dir, struct dentry *dentry, const char *nam=
e)
+{
+            struct inode *inode;
+            int rc;
+
+            inode =3D azfs_new_inode(dir->i_sb, dir, S_IFLNK | S_IRWXU=
GO,
0);
+            if (!inode)
+                        return -ENOSPC;
+
+            rc =3D page_symlink(inode, name, strlen(name) + 1);
+            if (rc) {
+                        iput(inode);
+                        return rc;
+            }
+
+            dget(dentry);
+            d_instantiate(dentry, inode);
+
+            return 0;
+}
+
+/**
+ * azfs_aio_read - aio_read() method for file_operations
+ * @iocb, @iov, @nr_segs, @pos: see file_operations methods
+ */
+static ssize_t
+azfs_aio_read(struct kiocb *iocb, const struct iovec *iov,
+                  unsigned long nr_segs, loff_t pos)
+{
+            struct inode *inode;
+            void *ziel;
+            unsigned long pin;
+            unsigned long size, todo, step;
+            ssize_t rc;
+
+            inode =3D iocb->ki_filp->f_mapping->host;
+
+            mutex_lock(&inode->i_mutex);
+
+            if (pos >=3D i_size_read(inode)) {
+                        rc =3D 0;
+                        goto out;
+            }
+
+            ziel =3D iov->iov_base;
+            todo =3D min((loff_t) iov->iov_len, i_size_read(inode) - p=
os);
+
+            for (step =3D todo; step; step -=3D size) {
+                        size =3D step;
+                        pin =3D azfs_recherche(inode, AZFS_READ, pos,
&size);
+                        if (!pin) {
+                                    rc =3D -ENOSPC;
+                                    goto out;
+                        }
+                        if (copy_to_user(ziel, (void*) pin, size)) {
+                                    rc =3D -EFAULT;
+                                    goto out;
+                        }
+
+                        iocb->ki_pos +=3D size;
+                        pos +=3D size;
+                        ziel +=3D size;
+            }
+
+            rc =3D todo;
+
+out:
+            mutex_unlock(&inode->i_mutex);
+
+            return rc;
+}
+
+/**
+ * azfs_aio_write - aio_write() method for file_operations
+ * @iocb, @iov, @nr_segs, @pos: see file_operations methods
+ */
+static ssize_t
+azfs_aio_write(struct kiocb *iocb, const struct iovec *iov,
+                   unsigned long nr_segs, loff_t pos)
+{
+            struct inode *inode;
+            void *quell;
+            unsigned long pin;
+            unsigned long size, todo, step;
+            ssize_t rc;
+
+            inode =3D iocb->ki_filp->f_mapping->host;
+
+            quell =3D iov->iov_base;
+            todo =3D iov->iov_len;
+
+            mutex_lock(&inode->i_mutex);
+
+            for (step =3D todo; step; step -=3D size) {
+                        size =3D step;
+                        pin =3D azfs_recherche(inode, AZFS_WRITE, pos,=

&size);
+                        if (!pin) {
+                                    rc =3D -ENOSPC;
+                                    goto out;
+                        }
+                        if (copy_from_user((void*) pin, quell, size)) =
{
+                                    rc =3D -EFAULT;
+                                    goto out;
+                        }
+
+                        iocb->ki_pos +=3D size;
+                        pos +=3D size;
+                        quell +=3D size;
+            }
+
+            rc =3D todo;
+
+out:
+            mutex_unlock(&inode->i_mutex);
+
+            return rc;
+}
+
+/**
+ * azfs_open - open() method for file_operations
+ * @inode, @file: see file_operations methods
+ */
+static int
+azfs_open(struct inode *inode, struct file *file)
+{
+            file->private_data =3D inode;
+
+            if (file->f_flags & O_TRUNC) {
+                        i_size_write(inode, 0);
+                        inode->i_op->truncate(inode);
+            }
+            if (file->f_flags & O_APPEND)
+                        inode->i_fop->llseek(file, 0, SEEK_END);
+
+            return 0;
+}
+
+/**
+ * azfs_mmap - mmap() method for file_operations
+ * @file, @vm: see file_operations methods
+ */
+static int
+azfs_mmap(struct file *file, struct vm_area_struct *vma)
+{
+            struct azfs_super *super;
+            struct azfs_znode *znode;
+            struct inode *inode;
+            unsigned long cursor, pin;
+            unsigned long todo, size, vm_start;
+            pgprot_t page_prot;
+
+            inode =3D file->private_data;
+            znode =3D I2Z(inode);
+            super =3D inode->i_sb->s_fs_info;
+
+            if (super->block_size < PAGE_SIZE)
+                        return -EINVAL;
+
+            cursor =3D vma->vm_pgoff << super->block_shift;
+            todo =3D vma->vm_end - vma->vm_start;
+
+            if (cursor + todo > i_size_read(inode))
+                        return -EINVAL;
+
+            page_prot =3D pgprot_val(vma->vm_page_prot);
+            page_prot |=3D (_PAGE_NO_CACHE | _PAGE_RW);
+            page_prot &=3D ~_PAGE_GUARDED;
+            vma->vm_page_prot =3D __pgprot(page_prot);
+
+            vm_start =3D vma->vm_start;
+            for (size =3D todo; todo; todo -=3D size, size =3D todo) {=

+                        pin =3D azfs_recherche(inode, AZFS_MMAP, curso=
r,
&size);
+                        if (!pin)
+                                    return -EAGAIN;
+                        pin >>=3D PAGE_SHIFT;
+                        if (remap_pfn_range(vma, vm_start, pin, size,
vma->vm_page_prot))
+                                    return -EAGAIN;
+
+                        vm_start +=3D size;
+                        cursor +=3D size;
+            }
+
+            return 0;
+}
+
+/**
+ * azfs_truncate - truncate() method for inode_operations
+ * @inode: see inode_operations methods
+ */
+static void
+azfs_truncate(struct inode *inode)
+{
+            struct azfs_super *super;
+            struct azfs_znode *znode;
+            struct azfs_block *block, *ding, *knoten, *west, *east;
+            unsigned long id, count;
+            signed long delta;
+
+            super =3D inode->i_sb->s_fs_info;
+            znode =3D I2Z(inode);
+
+            delta =3D i_size_read(inode) + (super->block_size - 1);
+            delta >>=3D super->block_shift;
+            delta -=3D inode->i_blocks;
+
+            if (delta =3D=3D 0) {
+                        znode->size =3D i_size_read(inode);
+                        return;
+            }
+
+            write_lock(&znode->lock);
+
+            while (delta > 0) {
+                        west =3D east =3D NULL;
+
+                        write_lock(&super->lock);
+
+                        if (list_empty(&super->block_list)) {
+                                    write_unlock(&super->lock);
+                                    break;
+                        }
+
+                        for (count =3D delta; count; count--) {
+                                    for_each_block(block,
&super->block_list)
+                                                if (block->count >=3D =
count)
{
+                                                            east =3D b=
lock;
+                                                            break;
+                                                }
+                                    if (east)
+                                                break;
+                        }
+
+                        for_each_block_reverse(block, &znode->block_li=
st)
{
+                                    if (block->id + block->count =3D=3D=

east->id)
+                                                west =3D block;
+                                    break;
+                        }
+
+                        if (east->count =3D=3D count) {
+                                    if (west) {
+                                                west->count +=3D
east->count;
+                                                azfs_block_free(east);=

+                                    } else {
+                                                azfs_block_move(east,
&znode->block_list);
+                                    }
+                        } else {
+                                    if (west) {
+                                                west->count +=3D count=
;
+                                    } else {
+                                                if
(!azfs_block_init(&znode->block_list,
+
east->id, count)) {
+
write_unlock(&super->lock);
+                                                            break;
+                                                }
+                                    }
+
+                                    east->id +=3D count;
+                                    east->count -=3D count;
+                        }
+
+                        write_unlock(&super->lock);
+
+                        inode->i_blocks +=3D count;
+
+                        delta -=3D count;
+            }
+
+            while (delta < 0) {
+                        for_each_block_safe_reverse(block, knoten,
&znode->block_list) {
+                                    id =3D block->id;
+                                    count =3D block->count;
+                                    if ((signed long) count + delta > =
0) {
+                                                block->count +=3D delt=
a;
+                                                id +=3D block->count;
+                                                count -=3D block->coun=
t;
+                                                block =3D NULL;
+                                    }
+
+                                    west =3D east =3D NULL;
+
+                                    write_lock(&super->lock);
+
+                                    for_each_block(ding,
&super->block_list) {
+                                                if (!west && (ding->id=
 +
ding->count =3D=3D id))
+                                                            west =3D d=
ing;
+                                                else if (!east && (id =
+
count =3D=3D ding->id))
+                                                            east =3D d=
ing;
+                                                if (west && east)
+                                                            break;
+                                    }
+
+                                    if (west && east) {
+                                                west->count +=3D count=
 +
east->count;
+                                                azfs_block_free(east);=

+                                                if (block)
+
azfs_block_free(block);
+                                    } else if (west) {
+                                                west->count +=3D count=
;
+                                                if (block)
+
azfs_block_free(block);
+                                    } else if (east) {
+                                                east->id -=3D count;
+                                                east->count +=3D count=
;
+                                                if (block)
+
azfs_block_free(block);
+                                    } else {
+                                                if (!block) {
+                                                            if
(!azfs_block_init(&super->block_list,
+
       id, count)) {
+
write_unlock(&super->lock);
+
break;
+                                                            }
+                                                } else {
+
azfs_block_move(block, &super->block_list);
+                                                }
+                                    }
+
+                                    write_unlock(&super->lock);
+
+                                    inode->i_blocks -=3D count;
+
+                                    delta +=3D count;
+
+                                    break;
+                        }
+            }
+
+            write_unlock(&znode->lock);
+
+            znode->size =3D min(i_size_read(inode),
+                                    (loff_t) inode->i_blocks <<
super->block_shift);
+}
+
+/**
+ * azfs_getattr - getattr() method for inode_operations
+ * @mnt, @dentry, @stat: see inode_operations methods
+ */
+static int
+azfs_getattr(struct vfsmount *mnt, struct dentry *dentry, struct kstat=

*stat)
+{
+            struct azfs_super *super;
+            struct inode *inode;
+            unsigned short shift;
+
+            inode =3D dentry->d_inode;
+            super =3D inode->i_sb->s_fs_info;
+
+            generic_fillattr(inode, stat);
+            stat->blocks =3D inode->i_blocks;
+            shift =3D super->block_shift - super->sector_shift;
+            if (shift)
+                        stat->blocks <<=3D shift;
+
+            return 0;
+}
+
+static const struct address_space_operations azfs_aops =3D {
+            .write_begin            =3D simple_write_begin,
+            .write_end        =3D simple_write_end
+};
+
+static struct backing_dev_info azfs_bdi =3D {
+            .ra_pages         =3D 0,
+            .capabilities           =3D AZFS_BDI_CAPABILITIES
+};
+
+static struct inode_operations azfs_dir_iops =3D {
+            .create                       =3D azfs_create,
+            .lookup                       =3D simple_lookup,
+            .link                         =3D simple_link,
+            .unlink                       =3D simple_unlink,
+            .symlink          =3D azfs_symlink,
+            .mkdir                        =3D azfs_mkdir,
+            .rmdir                        =3D simple_rmdir,
+            .mknod                        =3D azfs_mknod,
+            .rename                       =3D simple_rename
+};
+
+static const struct file_operations azfs_reg_fops =3D {
+            .llseek                       =3D generic_file_llseek,
+            .aio_read         =3D azfs_aio_read,
+            .aio_write        =3D azfs_aio_write,
+            .open                         =3D azfs_open,
+            .mmap                         =3D azfs_mmap,
+            .fsync                        =3D simple_sync_file,
+};
+
+static struct inode_operations azfs_reg_iops =3D {
+            .truncate         =3D azfs_truncate,
+            .getattr          =3D azfs_getattr
+};
+
+/**
+ * azfs_new_inode - cook a new inode
+ * @sb: super-block
+ * @dir: parent directory
+ * @mode: file mode
+ * @dev: to be forwarded to init_special_inode()
+ */
+static struct inode*
+azfs_new_inode(struct super_block *sb, struct inode *dir, int mode, de=
v_t
dev)
+{
+            struct inode *inode;
+
+            inode =3D new_inode(sb);
+            if (!inode)
+                        return NULL;
+
+            inode->i_atime =3D inode->i_mtime =3D inode->i_ctime =3D
CURRENT_TIME;
+
+            inode->i_mode =3D mode;
+            if (dir) {
+                        dir->i_mtime =3D dir->i_ctime =3D inode->i_mti=
me;
+                        inode->i_uid =3D current->fsuid;
+                        if (dir->i_mode & S_ISGID) {
+                                    if (S_ISDIR(mode))
+                                                inode->i_mode |=3D S_I=
SGID;
+                                    inode->i_gid =3D dir->i_gid;
+                        } else {
+                                    inode->i_gid =3D current->fsgid;
+                        }
+            } else {
+                        inode->i_uid =3D 0;
+                        inode->i_gid =3D 0;
+            }
+
+            inode->i_blocks =3D 0;
+            inode->i_mapping->a_ops =3D &azfs_aops;
+            inode->i_mapping->backing_dev_info =3D &azfs_bdi;
+
+            switch (mode & S_IFMT) {
+            case S_IFDIR:
+                        inode->i_op =3D &azfs_dir_iops;
+                        inode->i_fop =3D &simple_dir_operations;
+                        inc_nlink(inode);
+                        break;
+
+            case S_IFREG:
+                        inode->i_op =3D &azfs_reg_iops;
+                        inode->i_fop =3D &azfs_reg_fops;
+                        break;
+
+            case S_IFLNK:
+                        inode->i_op =3D &page_symlink_inode_operations=
;
+                        break;
+
+            default:
+                        init_special_inode(inode, mode, dev);
+                        break;
+            }
+
+            return inode;
+}
+
+/**
+ * azfs_alloc_inode - alloc_inode() method for super_operations
+ * @sb: see super_operations methods
+ */
+static struct inode*
+azfs_alloc_inode(struct super_block *sb)
+{
+            struct azfs_znode *znode;
+
+            znode =3D kmem_cache_alloc(azfs_znode_cache, GFP_KERNEL);
+
+            INIT_LIST_HEAD(&znode->block_list);
+            rwlock_init(&znode->lock);
+
+            inode_init_once(&znode->vfs_inode);
+
+            return znode ? &znode->vfs_inode : NULL;
+}
+
+/**
+ * azfs_destroy_inode - destroy_inode() method for super_operations
+ * @inode: see super_operations methods
+ */
+static void
+azfs_destroy_inode(struct inode *inode)
+{
+            kmem_cache_free(azfs_znode_cache, I2Z(inode));
+}
+
+/**
+ * azfs_delete_inode - delete_inode() method for super_operations
+ * @inode: see super_operations methods
+ */
+static void
+azfs_delete_inode(struct inode *inode)
+{
+            if (S_ISREG(inode->i_mode)) {
+                        i_size_write(inode, 0);
+                        azfs_truncate(inode);
+            }
+            truncate_inode_pages(&inode->i_data, 0);
+            clear_inode(inode);
+}
+
+/**
+ * azfs_statfs - statfs() method for super_operations
+ * @dentry, @stat: see super_operations methods
+ */
+static int
+azfs_statfs(struct dentry *dentry, struct kstatfs *stat)
+{
+            struct super_block *sb;
+            struct azfs_super *super;
+            struct inode *inode;
+            unsigned long inodes, blocks;
+
+            sb =3D dentry->d_sb;
+            super =3D sb->s_fs_info;
+
+            inodes =3D blocks =3D 0;
+            mutex_lock(&sb->s_lock);
+            list_for_each_entry(inode, &sb->s_inodes, i_sb_list) {
+                        inodes++;
+                        blocks +=3D inode->i_blocks;
+            }
+            mutex_unlock(&sb->s_lock);
+
+            stat->f_type =3D AZFS_SUPERBLOCK_MAGIC;
+            stat->f_bsize =3D super->block_size;
+            stat->f_blocks =3D super->media_size >> super->block_shift=
;
+            stat->f_bfree =3D stat->f_blocks - blocks;
+            stat->f_bavail =3D stat->f_blocks - blocks;
+            stat->f_files =3D inodes + blocks;
+            stat->f_ffree =3D blocks + 1;
+            stat->f_namelen =3D NAME_MAX;
+
+            return 0;
+}
+
+static struct super_operations azfs_ops =3D {
+            .alloc_inode            =3D azfs_alloc_inode,
+            .destroy_inode          =3D azfs_destroy_inode,
+            .drop_inode             =3D generic_delete_inode,
+            .delete_inode           =3D azfs_delete_inode,
+            .statfs                       =3D azfs_statfs
+};
+
+/**
+ * azfs_fill_super - fill_super routine for get_sb
+ * @sb, @data, @silent: see file_system_type methods
+ */
+static int
+azfs_fill_super(struct super_block *sb, void *data, int silent)
+{
+            struct gendisk *disk;
+            struct azfs_super *super =3D NULL, *knoten;
+            struct azfs_block *block =3D NULL;
+            struct inode *inode =3D NULL;
+            int rc;
+
+            BUG_ON(!sb->s_bdev);
+
+            disk =3D sb->s_bdev->bd_disk;
+
+            if (!disk || !disk->queue) {
+                        printk(KERN_ERR "%s needs a block device which=
 has
a gendisk "
+                                                "with a queue\n",
+                                                AZFS_FILESYSTEM_NAME);=
=

+                        return -ENOSYS;
+            }
+
+            if (!disk->fops->direct_access) {
+                        printk(KERN_ERR "%s needs a block device with =
a "
+                                                "direct_access()
method\n",
+                                                AZFS_FILESYSTEM_NAME);=

+                        return -ENOSYS;
+            }
+
+            if (!get_device(disk->driverfs_dev)) {
+                        printk(KERN_ERR "%s cannot get reference to de=
vice
driver\n",
+                                                AZFS_FILESYSTEM_NAME);=

+                        return -EFAULT;
+            }
+
+            sb->s_magic =3D AZFS_SUPERBLOCK_MAGIC;
+            sb->s_flags =3D AZFS_SUPERBLOCK_FLAGS;
+            sb->s_op =3D &azfs_ops;
+            sb->s_maxbytes =3D get_capacity(disk) *
disk->queue->hardsect_size;
+            sb->s_time_gran =3D 1;
+
+            spin_lock(&super_list.lock);
+            list_for_each_entry(knoten, &super_list.head, list)
+                        if (knoten->blkdev =3D=3D sb->s_bdev) {
+                                    super =3D knoten;
+                                    break;
+                        }
+            spin_unlock(&super_list.lock);
+
+            if (!super) {
+                        super =3D kzalloc(sizeof(struct azfs_super),
GFP_KERNEL);
+                        if (!super) {
+                                    rc =3D -ENOMEM;
+                                    goto failed;
+                        }
+
+                        inode =3D azfs_new_inode(sb, NULL, S_IFDIR |
S_IRWXUGO, 0);
+                        if (!inode) {
+                                    rc =3D -ENOMEM;
+                                    goto failed;
+                        }
+
+                        super->root =3D d_alloc_root(inode);
+                        if (!super->root) {
+                                    rc =3D -ENOMEM;
+                                    goto failed;
+                        }
+                        dget(super->root);
+
+                        INIT_LIST_HEAD(&super->list);
+                        INIT_LIST_HEAD(&super->block_list);
+                        rwlock_init(&super->lock);
+
+                        super->media_size =3D sb->s_maxbytes;
+                        super->block_size =3D sb->s_blocksize;
+                        super->block_shift =3D sb->s_blocksize_bits;
+                        super->sector_size =3D disk->queue->hardsect_s=
ize;
+                        super->sector_shift =3D
blksize_bits(disk->queue->hardsect_size);
+                        super->blkdev =3D sb->s_bdev;
+
+                        block =3D azfs_block_init(&super->block_list,
+                                                0, super->media_size >=
>
super->block_shift);
+                        if (!block) {
+                                    rc =3D -ENOMEM;
+                                    goto failed;
+                        }
+
+                        rc =3D disk->fops->direct_access(super->blkdev=
, 0,
&super->ph_addr);
+                        if (rc < 0) {
+                                    rc =3D -EFAULT;
+                                    goto failed;
+                        }
+
+                        super->io_addr =3D (unsigned long) ioremap_fla=
gs(
+                                                super->ph_addr,
super->media_size, _PAGE_NO_CACHE);
+                        if (!super->io_addr) {
+                                    rc =3D -EFAULT;
+                                    goto failed;
+                        }
+
+                        spin_lock(&super_list.lock);
+                        list_add(&super->list, &super_list.head);
+                        spin_unlock(&super_list.lock);
+            }
+
+            sb->s_root =3D super->root;
+            sb->s_fs_info =3D super;
+            disk->driverfs_dev->driver_data =3D super;
+            disk->driverfs_dev->platform_data =3D sb;
+
+            if (super->block_size < PAGE_SIZE)
+                        printk(KERN_INFO "Block size on %s is smaller =
then
system "
+                                                "page size: mmap() wou=
ld
not be supported\n",
+                                                disk->disk_name);
+
+            return 0;
+
+failed:
+            if (super) {
+                        sb->s_root =3D NULL;
+                        sb->s_fs_info =3D NULL;
+                        if (block)
+                                    azfs_block_free(block);
+                        if (super->root)
+                                    dput(super->root);
+                        if (inode)
+                                    iput(inode);
+                        disk->driverfs_dev->driver_data =3D NULL;
+                        kfree(super);
+                        disk->driverfs_dev->platform_data =3D NULL;
+                        put_device(disk->driverfs_dev);
+            }
+
+            return rc;
+}
+
+/**
+ * azfs_get_sb - get_sb() method for file_system_type
+ * @fs_type, @flags, @dev_name, @data, @mount: see file_system_type
methods
+ */
+static int
+azfs_get_sb(struct file_system_type *fs_type, int flags,
+                const char *dev_name, void *data, struct vfsmount *mou=
nt)
+{
+            return get_sb_bdev(fs_type, flags,
+                                    dev_name, data, azfs_fill_super,
mount);
+}
+
+/**
+ * azfs_kill_sb - kill_sb() method for file_system_type
+ * @sb: see file_system_type methods
+ */
+static void
+azfs_kill_sb(struct super_block *sb)
+{
+            sb->s_root =3D NULL;
+            kill_block_super(sb);
+}
+
+static struct file_system_type azfs_fs =3D {
+            .owner                        =3D THIS_MODULE,
+            .name                         =3D AZFS_FILESYSTEM_NAME,
+            .get_sb                       =3D azfs_get_sb,
+            .kill_sb          =3D azfs_kill_sb,
+            .fs_flags         =3D AZFS_FILESYSTEM_FLAGS
+};
+
+/**
+ * azfs_init
+ */
+static int __init
+azfs_init(void)
+{
+            int rc;
+
+            INIT_LIST_HEAD(&super_list.head);
+            spin_lock_init(&super_list.lock);
+
+            azfs_znode_cache =3D kmem_cache_create("azfs_znode_cache",=

+                                    sizeof(struct azfs_znode), 0,
AZFS_CACHE_FLAGS, NULL);
+            if (!azfs_znode_cache) {
+                        printk(KERN_ERR "Could not allocate inode cach=
e
for %s\n",
+                                                AZFS_FILESYSTEM_NAME);=

+                        rc =3D -ENOMEM;
+                        goto failed;
+            }
+
+            azfs_block_cache =3D kmem_cache_create("azfs_block_cache",=

+                                    sizeof(struct azfs_block), 0,
AZFS_CACHE_FLAGS, NULL);
+            if (!azfs_block_cache) {
+                        printk(KERN_ERR "Could not allocate block cach=
e
for %s\n",
+                                                AZFS_FILESYSTEM_NAME);=

+                        rc =3D -ENOMEM;
+                        goto failed;
+            }
+
+            rc =3D register_filesystem(&azfs_fs);
+            if (rc !=3D 0) {
+                        printk(KERN_ERR "Could not register %s\n",
+                                                AZFS_FILESYSTEM_NAME);=

+                        goto failed;
+            }
+
+            return 0;
+
+failed:
+            if (azfs_block_cache)
+                        kmem_cache_destroy(azfs_block_cache);
+
+            if (azfs_znode_cache)
+                        kmem_cache_destroy(azfs_znode_cache);
+
+            return rc;
+}
+
+/**
+ * azfs_exit
+ */
+static void __exit
+azfs_exit(void)
+{
+            struct azfs_super *super, *PILZE;
+            struct azfs_block *block, *knoten;
+            struct gendisk *disk;
+
+            spin_lock(&super_list.lock);
+            list_for_each_entry_safe(super, PILZE, &super_list.head, l=
ist)
{
+                        disk =3D super->blkdev->bd_disk;
+                        list_del(&super->list);
+                        iounmap((void*) super->io_addr);
+                        write_lock(&super->lock);
+                        for_each_block_safe(block, knoten,
&super->block_list)
+                                    azfs_block_free(block);
+                        write_unlock(&super->lock);
+                        disk->driverfs_dev->driver_data =3D NULL;
+                        disk->driverfs_dev->platform_data =3D NULL;
+                        kfree(super);
+                        put_device(disk->driverfs_dev);
+            }
+            spin_unlock(&super_list.lock);
+
+            unregister_filesystem(&azfs_fs);
+
+            kmem_cache_destroy(azfs_block_cache);
+            kmem_cache_destroy(azfs_znode_cache);
+}
+
+module_init(azfs_init);
+module_exit(azfs_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Maxim Shchetynin <maxim@de.ibm.com>");
+MODULE_DESCRIPTION("Non-buffered file system for IO devices");

Mit freundlichen Gr=FC=DFen / met vriendelijke groeten / avec regards

    Maxim V. Shchetynin
    Linux Kernel Entwicklung
    IBM Deutschland Entwicklung GmbH
    Linux f=FCr Cell, Abteilung 3250
    Sch=F6naicher Stra=DFe 220
    71032 B=F6blingen

Vorsitzender des Aufsichtsrats: Johann Weihen
Gesch=E4ftsf=FChrung: Herbert Kircher
Sitz der Gesellschaft: B=F6blingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294

Fahr nur so schnell wie dein Schutzengel fliegen kann!=

^ permalink raw reply

* 1st version of azfs
From: Maxim Shchetynin @ 2007-12-17 18:45 UTC (permalink / raw)
  To: linuxppc-dev, linux-mm, linux-kernel, arnd

[-- Attachment #1: Type: text/plain, Size: 590 bytes --]



...and here once more the same patch as attachment...

(See attached file: linux-2.6.24-rc4-azfs.diff.gz)

Mit freundlichen Grüßen / met vriendelijke groeten / avec regards

    Maxim V. Shchetynin
    Linux Kernel Entwicklung
    IBM Deutschland Entwicklung GmbH
    Linux für Cell, Abteilung 3250
    Schönaicher Straße 220
    71032 Böblingen

Vorsitzender des Aufsichtsrats: Johann Weihen
Geschäftsführung: Herbert Kircher
Sitz der Gesellschaft: Böblingen
Registriergericht: Amtsgericht Stuttgart, HRB 243294

Fahr nur so schnell wie dein Schutzengel fliegen kann!

[-- Attachment #2: linux-2.6.24-rc4-azfs.diff.gz --]
[-- Type: application/octet-stream, Size: 7196 bytes --]

^ permalink raw reply

* Re: [PATCH] [POWERPC][RFC] MPC8360E-RDK: Device tree and board file
From: Scott Wood @ 2007-12-17 18:48 UTC (permalink / raw)
  To: Vitaly Bordug; +Cc: Stephen Rothwell, linuxppc-dev
In-Reply-To: <20071217212654.2cf39355@kernel.crashing.org>

Vitaly Bordug wrote:
> On Mon, 17 Dec 2007 11:03:04 -0600 Scott Wood wrote:
>>> These phy nodes have basically no information in them.  PHY nodes
>>>  are optional -
>> If they are truly optional, then several Linux drivers (including 
>> ucc_geth, which this board uses) are broken, as they'll error out
>> if there's no phy-handle (gianfar is even worse -- it looks like
>> the fsl_soc code will crash in that case).  But what do you propose
>> they do in the absence of a phy-handle?  Hope that probing only
>> finds one phy?
> 
> up-to-date fixed phy patch solves it in gianfar and fs_enet case. it
> is implied, that either there *are* phy nodes (and the code will look
> up their reg and phandle) or there should be fixed-link property in
> NIC node, that describes to what link stuff is really connected.

There's a difference between the phy *node* being optional and phy 
*usage* being optional. :-)

-Scott

^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox