linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: Jia Hongtao <hongtao.jia@freescale.com>
Cc: hongtao.jia@freescale.com, B07421@freescale.com,
	linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH 2/2] powerpc/85xx: workaround for chips with MSI hardware errata
Date: Fri, 29 Mar 2013 16:54:34 -0500	[thread overview]
Message-ID: <1364594074.13310.13@snotra> (raw)
In-Reply-To: <1364268527-32068-2-git-send-email-hongtao.jia@freescale.com> (from hongtao.jia@freescale.com on Mon Mar 25 22:28:47 2013)

On 03/25/2013 10:28:47 PM, Jia Hongtao wrote:
> The MPIC version 2.0 has a MSI errata (errata PIC1 of mpc8544), It =20
> causes
> that neither MSI nor MSI-X can work fine. This is a workaround to =20
> allow
> MSI-X to function properly.
>=20
> Signed-off-by: Liu Shuo <soniccat.liu@gmail.com>
> Signed-off-by: Li Yang <leoli@freescale.com>
> Signed-off-by: Jia Hongtao <hongtao.jia@freescale.com>
> ---
>  arch/powerpc/sysdev/fsl_msi.c | 47 =20
> ++++++++++++++++++++++++++++++++++++++++---
>  1 file changed, 44 insertions(+), 3 deletions(-)
>=20
> diff --git a/arch/powerpc/sysdev/fsl_msi.c =20
> b/arch/powerpc/sysdev/fsl_msi.c
> index 178c994..d2f8040 100644
> --- a/arch/powerpc/sysdev/fsl_msi.c
> +++ b/arch/powerpc/sysdev/fsl_msi.c
> @@ -28,6 +28,8 @@
>  #include "fsl_msi.h"
>  #include "fsl_pci.h"
>=20
> +#define MSI_HW_ERRATA_ENDIAN 0x00000010

This should probably be kept in the same place as the other =20
msi->features definitions (e.g. FSL_PIC_IP_*).

> +/* MPIC version 2.0 has erratum PIC1 */
> +static int mpic_has_errata(void)
> +{
> +	if (mpic_primary_get_version() =3D=3D 0x0200)
> +		return 1;
> +
> +	return 0;
> +}

mpic_has_erratum_pic1()

> +	if ((features->fsl_pic_ip & FSL_PIC_IP_MASK) =3D=3D =20
> FSL_PIC_IP_MPIC) {
> +		rc =3D mpic_has_errata();
> +		if (rc > 0) {
> +			msi->feature |=3D MSI_HW_ERRATA_ENDIAN;
> +		} else if (rc < 0) {
> +			err =3D rc;
> +			goto error_out;
> +		}

When would mpic_has_errata() ever return a negative value (maybe =20
mpic_primary_get_version could fail, but you don't allow for that in =20
the interface)?

If you're not going to add a way for errors to be returned back, just =20
do:

if (mpic_has_erratum_pic1())
	msi->feature |=3D MSI_HW_ERRATA_ENDIAN;

-Scott=

  reply	other threads:[~2013-03-29 21:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-26  3:28 [PATCH 1/2] powerpc/MPIC: Add get_version API both for internal and external use Jia Hongtao
2013-03-26  3:28 ` [PATCH 2/2] powerpc/85xx: workaround for chips with MSI hardware errata Jia Hongtao
2013-03-29 21:54   ` Scott Wood [this message]
2013-04-02  6:35     ` Jia Hongtao-B38951
2013-04-02 17:49       ` Scott Wood
2013-04-02 18:01         ` Kumar Gala
2013-03-26  4:14 ` [PATCH 1/2] powerpc/MPIC: Add get_version API both for internal and external use Michael Ellerman
2013-03-26  4:16   ` Jia Hongtao-B38951

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=1364594074.13310.13@snotra \
    --to=scottwood@freescale.com \
    --cc=B07421@freescale.com \
    --cc=hongtao.jia@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    /path/to/YOUR_REPLY

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

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).