All of lore.kernel.org
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb.de>
To: linuxppc-dev@ozlabs.org
Cc: norsk5@yahoo.com, bluesmoke-devel@lists.sourceforge.net
Subject: Re: [PATCH 2/2] powerpc: MPC85xx EDAC device driver
Date: Sun, 29 Jul 2007 16:06:21 +0200	[thread overview]
Message-ID: <200707291606.21612.arnd@arndb.de> (raw)
In-Reply-To: <20070726222225.GB10427@blade.az.mvista.com>

On Friday 27 July 2007, Dave Jiang wrote:
> +static struct of_device_id mpc85xx_pci_err_of_match[] =3D {
> +       {
> +        .type =3D "pci",
> +        .compatible =3D "fsl,mpc8540-pci",
> +        },
> +       {},
> +};
> +
> +static struct of_platform_driver mpc85xx_pci_err_driver =3D {
> +       .owner =3D THIS_MODULE,
> +       .name =3D "mpc85xx_pci_err",
> +       .match_table =3D mpc85xx_pci_err_of_match,
> +       .probe =3D mpc85xx_pci_err_probe,
> +       .remove =3D mpc85xx_pci_err_remove,
> +       .driver =3D {
> +                  .name =3D "mpc85xx_pci_err",
> +                  .owner =3D THIS_MODULE,
> +                  },
> +};

This is  a little problematic, if we want to make the PCI bus implementation
use the PCI code from arch/powerpc/kernel/of_platform.c in the future.
Right now this is not possible, because that code is still 64-bit only,
but that may change in the future. Since only one driver can bind
to the pci host bridge device, the mpc85xx_pci_err driver would conflict
with the PCI driver itself, which you probably don't intend.

I'd suggest either to integrate EDAC into the 85xx specific PCI code,
or to have an extra device in the device tree for this.

> +=A0=A0=A0=A0=A0=A0=A0res =3D of_register_platform_driver(&mpc85xx_mc_err=
_driver) ? : res;
> +
> +=A0=A0=A0=A0=A0=A0=A0res =3D of_register_platform_driver(&mpc85xx_l2_err=
_driver) ? : res;
> +
> +#ifdef CONFIG_PCI
> +=A0=A0=A0=A0=A0=A0=A0res =3D of_register_platform_driver(&mpc85xx_pci_er=
r_driver) ? : res;
> +#endif
> +
> +=A0=A0=A0=A0=A0=A0=A0/*
> +=A0=A0=A0=A0=A0=A0=A0 * need to clear HID1[RFXE] to disable machine chec=
k int
> +=A0=A0=A0=A0=A0=A0=A0 * so we can catch it
> +=A0=A0=A0=A0=A0=A0=A0 */
> +=A0=A0=A0=A0=A0=A0=A0if (edac_op_state =3D=3D EDAC_OPSTATE_INT) {
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0orig_hid1 =3D mfspr(SPRN_HI=
D1);
> +
> +=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0mtspr(SPRN_HID1, (orig_hid1=
 & ~0x20000));
> +=A0=A0=A0=A0=A0=A0=A0}
> +
> +=A0=A0=A0=A0=A0=A0=A0return res;
> +}

The error handling could use some improvement here. In particular, you shou=
ld
unregister the buses in the failure path, maybe you need to clean up other
parts as well.

	Arnd <><

  reply	other threads:[~2007-07-29 20:39 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-07-26 22:22 [PATCH 2/2] powerpc: MPC85xx EDAC device driver Dave Jiang
2007-07-29 14:06 ` Arnd Bergmann [this message]
2007-07-30 16:40   ` Dave Jiang
2007-07-30 17:28     ` Arnd Bergmann
2007-07-30 17:48       ` Dave Jiang
2007-07-30 18:46         ` Arnd Bergmann
2007-07-30 19:29           ` Dave Jiang
2007-07-30 19:58             ` Arnd Bergmann
2007-07-30 20:17               ` Dave Jiang
2007-07-30 21:44                 ` Linas Vepstas
2007-07-30 22:47                   ` Doug Thompson
2007-08-01 19:48                     ` EDAC & PCI error recovery (was Re: [PATCH 2/2] powerpc: MPC85xx EDAC device driver) Linas Vepstas
2007-08-01 19:48                       ` Linas Vepstas
2007-08-01 20:34                       ` [ofa-general] Re: EDAC stats " Doug Thompson
2007-08-01 20:34                         ` Doug Thompson
2007-07-30 22:58                   ` [PATCH 2/2] powerpc: MPC85xx EDAC device driver Dave Jiang
2007-07-31 20:49               ` Dave Jiang
2007-07-31 22:07                 ` Arnd Bergmann
2007-07-31 22:24                   ` Dave Jiang
2007-07-31 22:25                     ` Arnd Bergmann
2007-08-01  0:16                       ` Dave Jiang
2007-08-01  8:36                         ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200707291606.21612.arnd@arndb.de \
    --to=arnd@arndb.de \
    --cc=bluesmoke-devel@lists.sourceforge.net \
    --cc=linuxppc-dev@ozlabs.org \
    --cc=norsk5@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.