* Re: [PATCH 4/4] powerpc: Remove CONFIG_POWER4_ONLY
From: Anton Blanchard @ 2012-04-18 6:51 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus
In-Reply-To: <1334731564.1159.2.camel@pasglop>
Hi Ben,
> So if I remember properly, this means you key off if both
> CPU_FTR_NOEXECUTE and CPU_FTR_NODISRALIGN are clear... is
> there a point ? You make the patch simpler by only keying
> on NO_EXECUTE which afaik is a power4 or later only feature no ?
Was going to do that, but noticed ARCH_V2 was used elsewhere:
arch/powerpc/kernel/sysfs.c: if (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
I'm ok either way, should I respin to use CPU_FTR_NO_EXECUTE?
Anton
^ permalink raw reply
* Re: [PATCH 4/4] powerpc: Remove CONFIG_POWER4_ONLY
From: Benjamin Herrenschmidt @ 2012-04-18 6:57 UTC (permalink / raw)
To: Anton Blanchard; +Cc: linuxppc-dev, paulus
In-Reply-To: <20120418165116.4bdcbbfe@kryten>
On Wed, 2012-04-18 at 16:51 +1000, Anton Blanchard wrote:
>
> arch/powerpc/kernel/sysfs.c: if
> (cpu_has_feature(CPU_FTR_PPCAS_ARCH_V2))
>
> I'm ok either way, should I respin to use CPU_FTR_NO_EXECUTE?
Yeah, that sysfs bit will be true if -either- of the two bits is true,
which is yet another different logic, better avoid it I think.
Cheers,
Ben.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Benjamin Herrenschmidt @ 2012-04-18 6:59 UTC (permalink / raw)
To: o jordan; +Cc: linuxppc-dev
In-Reply-To: <BAY163-W54EBB2437ED2068EF5AF5D03F0@phx.gbl>
On Tue, 2012-04-17 at 20:49 +0100, o jordan wrote:
> Hi list,
>
>
> Firstly let me say thanks for the great work you do!!!
>
>
> I've been trying to get Kernel Mode Setting working on my iBook with
> Ubuntu 12.04. I can only get it working by forcing PCI mode
> (agpmode=-1). Setting agpmode=1 or a higher number just results in
> freezing and a flashing screen. Does anybody know how to get it
> working fully with agp?
>
Note also that KMS doesn't afaik have the power management code that
radeonfb has for those old Mac chipsets, so suspend/resume won't work.
Cheers,
Ben.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Andreas Schwab @ 2012-04-18 7:42 UTC (permalink / raw)
To: Michel Dänzer; +Cc: o jordan, linuxppc-dev
In-Reply-To: <1334730915.5989.265.camel__41553.0639271767$1334731329$gmane$org@thor.local>
Michel Dänzer <michel@daenzer.net> writes:
> Not sure it's a good idea to set both of these =y: It will prevent the
> radeon driver from initializing at all by default if radeonfb is active.
You can say video=radeonfb:off.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Andreas Schwab @ 2012-04-18 7:46 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: o jordan, linuxppc-dev
In-Reply-To: <1334732346.1159.5.camel__22339.9641145535$1334732429$gmane$org@pasglop>
Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> Note also that KMS doesn't afaik have the power management code that
> radeonfb has for those old Mac chipsets, so suspend/resume won't work.
How hard would it be to add it?
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* RE: [PATCH v2 1/2] powerpc/mpc85xx: support the MTD for p1022ds flash
From: Huang Changming-R66093 @ 2012-04-18 7:46 UTC (permalink / raw)
To: Tabi Timur-B04825; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <CAOZdJXVBb-CHa=PPa5446aVdQ323aBdv-9UTXx1SbkY2ArT14Q@mail.gmail.com>
Yes, I tested with the latest Linux kernel, with my patch, the NOR and NAND=
MTD can work well.
Best Regards
Jerry Huang
> -----Original Message-----
> From: Tabi Timur-B04825
> Sent: Wednesday, April 18, 2012 2:10 AM
> To: Huang Changming-R66093
> Cc: linuxppc-dev@lists.ozlabs.org; Kumar Gala
> Subject: Re: [PATCH v2 1/2] powerpc/mpc85xx: support the MTD for p1022ds
> flash
>=20
> On Tue, Apr 17, 2012 at 4:15 AM, <Chang-Ming.Huang@freescale.com> wrote:
>=20
> > diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c
> > b/arch/powerpc/platforms/85xx/p1022_ds.c
> > index e74b7cd..0db3a7e 100644
> > --- a/arch/powerpc/platforms/85xx/p1022_ds.c
> > +++ b/arch/powerpc/platforms/85xx/p1022_ds.c
> > @@ -463,6 +463,7 @@ static void __init p1022_ds_setup_arch(void)
> > =A0static struct of_device_id __initdata p1022_ds_ids[] =3D {
> > =A0 =A0 =A0 =A0/* So that the DMA channel nodes can be probed individua=
lly: */
> > =A0 =A0 =A0 =A0{ .compatible =3D "fsl,eloplus-dma", },
> > + =A0 =A0 =A0 { .compatible =3D "fsl,p1022-elbc", },
> > =A0 =A0 =A0 =A0{},
> > =A0};
>=20
>=20
> Have you actually tested this with an upstream kernel? p1022_ds_ids[] is
> broken upstream, so adding a new line won't work.
>=20
> Take a look at http://patchwork.ozlabs.org/patch/128533/
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Michel Dänzer @ 2012-04-18 7:52 UTC (permalink / raw)
To: Andreas Schwab; +Cc: o jordan, linuxppc-dev
In-Reply-To: <m2ty0hbi4j.fsf@igel.home>
On Mit, 2012-04-18 at 09:42 +0200, Andreas Schwab wrote:=20
> Michel D=C3=A4nzer <michel@daenzer.net> writes:
>=20
> > Not sure it's a good idea to set both of these =3Dy: It will prevent th=
e
> > radeon driver from initializing at all by default if radeonfb is active=
.
>=20
> You can say video=3Dradeonfb:off.
I know, I'm referring to the default behaviour without any relevant
kernel command line options.
--=20
Earthling Michel D=C3=A4nzer | http://www.amd.c=
om
Libre software enthusiast | Debian, X and DRI developer
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Andreas Schwab @ 2012-04-18 7:54 UTC (permalink / raw)
To: Michel Dänzer; +Cc: o jordan, linuxppc-dev
In-Reply-To: <1334730915.5989.265.camel__41553.0639271767$1334731329$gmane$org@thor.local>
Michel Dänzer <michel@daenzer.net> writes:
> Probably not (AGP is flaky in general, but in particular with older
> UniNorth bridges), but it might be interesting to see some kernel output
> from booting without agpmode=-1. If you can't get it via ssh, maybe you
> can via netconsole or so.
While logging into KDE:
radeon 0000:00:10.0: GPU lockup CP stall for more than 10064msec
GPU lockup (waiting for 0x000003EE last fence id 0x000003ED)
radeon: wait for empty RBBM fifo failed ! Bad things might happen.
Failed to wait GUI idle while programming pipes. Bad things might happen.
radeon 0000:00:10.0: (r300_asic_reset:414) RBBM_STATUS=0x8802C137
radeon 0000:00:10.0: (r300_asic_reset:433) RBBM_STATUS=0x8802C137
radeon 0000:00:10.0: (r300_asic_reset:445) RBBM_STATUS=0x8802C137
radeon 0000:00:10.0: GPU reset succeed
radeon 0000:00:10.0: GPU reset succeed
radeon 0000:00:10.0: (r300_asic_reset:414) RBBM_STATUS=0x8802C137
radeon 0000:00:10.0: (r300_asic_reset:433) RBBM_STATUS=0x8802C137
radeon 0000:00:10.0: (r300_asic_reset:445) RBBM_STATUS=0x8802C137
radeon 0000:00:10.0: GPU reset succeed
radeon: wait for empty RBBM fifo failed ! Bad things might happen.
Failed to wait GUI idle while programming pipes. Bad things might happen.
After that is is dead. GPU lockup appears to be a common problem with
the radeon driver.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Michel Dänzer @ 2012-04-18 8:02 UTC (permalink / raw)
To: Andreas Schwab; +Cc: o jordan, linuxppc-dev
In-Reply-To: <m2liltbhkp.fsf@igel.home>
On Mit, 2012-04-18 at 09:54 +0200, Andreas Schwab wrote:=20
> Michel D=C3=A4nzer <michel@daenzer.net> writes:
>=20
> > Probably not (AGP is flaky in general, but in particular with older
> > UniNorth bridges), but it might be interesting to see some kernel outpu=
t
> > from booting without agpmode=3D-1. If you can't get it via ssh, maybe y=
ou
> > can via netconsole or so.
>=20
> While logging into KDE:
>=20
> radeon 0000:00:10.0: GPU lockup CP stall for more than 10064msec
> GPU lockup (waiting for 0x000003EE last fence id 0x000003ED)
> radeon: wait for empty RBBM fifo failed ! Bad things might happen.
> Failed to wait GUI idle while programming pipes. Bad things might happen.
> radeon 0000:00:10.0: (r300_asic_reset:414) RBBM_STATUS=3D0x8802C137
> radeon 0000:00:10.0: (r300_asic_reset:433) RBBM_STATUS=3D0x8802C137
> radeon 0000:00:10.0: (r300_asic_reset:445) RBBM_STATUS=3D0x8802C137
> radeon 0000:00:10.0: GPU reset succeed
> radeon 0000:00:10.0: GPU reset succeed
> radeon 0000:00:10.0: (r300_asic_reset:414) RBBM_STATUS=3D0x8802C137
> radeon 0000:00:10.0: (r300_asic_reset:433) RBBM_STATUS=3D0x8802C137
> radeon 0000:00:10.0: (r300_asic_reset:445) RBBM_STATUS=3D0x8802C137
> radeon 0000:00:10.0: GPU reset succeed
> radeon: wait for empty RBBM fifo failed ! Bad things might happen.
> Failed to wait GUI idle while programming pipes. Bad things might happen.
That's even with agpmode=3D1?
Note that I'm interested in seeing the full dmesg or at least all
agp/drm/radeon related messages.
> After that is is dead.
The whole machine? That's probably due to something going wrong (e.g. an
MCE) while trying to reset the GPU. I fixed one such problem recently,
but it's still not as reliable as on x86 unfortunately.
> GPU lockup appears to be a common problem with the radeon driver.
It's what happens when anything goes wrong with the GPU. If it doesn't
happen with agpmode=3D-1, it's probably an AGP related coherency issue.
--=20
Earthling Michel D=C3=A4nzer | http://www.amd.c=
om
Libre software enthusiast | Debian, X and DRI developer
^ permalink raw reply
* RE: [PATCH v2 1/2] powerpc/mpc85xx: support the MTD for p1022ds flash
From: Huang Changming-R66093 @ 2012-04-18 8:02 UTC (permalink / raw)
To: Huang Changming-R66093, Tabi Timur-B04825; +Cc: linuxppc-dev@lists.ozlabs.org
In-Reply-To: <110EED8CC96DFC488B7E717A2027A27C079D0B@039-SN1MPN1-002.039d.mgd.msft.net>
But, I observed the Call Trace, but the partition can be parsed correctly.
Maybe your patch can fix this Call Trace.
Best Regards
Jerry Huang
> -----Original Message-----
> From: linuxppc-dev-bounces+r66093=3Dfreescale.com@lists.ozlabs.org
> [mailto:linuxppc-dev-bounces+r66093=3Dfreescale.com@lists.ozlabs.org] On
> Behalf Of Huang Changming-R66093
> Sent: Wednesday, April 18, 2012 3:47 PM
> To: Tabi Timur-B04825
> Cc: linuxppc-dev@lists.ozlabs.org
> Subject: RE: [PATCH v2 1/2] powerpc/mpc85xx: support the MTD for p1022ds
> flash
>=20
> Yes, I tested with the latest Linux kernel, with my patch, the NOR and
> NAND MTD can work well.
>=20
> Best Regards
> Jerry Huang
>=20
>=20
> > -----Original Message-----
> > From: Tabi Timur-B04825
> > Sent: Wednesday, April 18, 2012 2:10 AM
> > To: Huang Changming-R66093
> > Cc: linuxppc-dev@lists.ozlabs.org; Kumar Gala
> > Subject: Re: [PATCH v2 1/2] powerpc/mpc85xx: support the MTD for
> > p1022ds flash
> >
> > On Tue, Apr 17, 2012 at 4:15 AM, <Chang-Ming.Huang@freescale.com>
> wrote:
> >
> > > diff --git a/arch/powerpc/platforms/85xx/p1022_ds.c
> > > b/arch/powerpc/platforms/85xx/p1022_ds.c
> > > index e74b7cd..0db3a7e 100644
> > > --- a/arch/powerpc/platforms/85xx/p1022_ds.c
> > > +++ b/arch/powerpc/platforms/85xx/p1022_ds.c
> > > @@ -463,6 +463,7 @@ static void __init p1022_ds_setup_arch(void)
> > > =A0static struct of_device_id __initdata p1022_ds_ids[] =3D {
> > > =A0 =A0 =A0 =A0/* So that the DMA channel nodes can be probed individ=
ually:
> > > */
> > > =A0 =A0 =A0 =A0{ .compatible =3D "fsl,eloplus-dma", },
> > > + =A0 =A0 =A0 { .compatible =3D "fsl,p1022-elbc", },
> > > =A0 =A0 =A0 =A0{},
> > > =A0};
> >
> >
> > Have you actually tested this with an upstream kernel? p1022_ds_ids[]
> > is broken upstream, so adding a new line won't work.
> >
> > Take a look at http://patchwork.ozlabs.org/patch/128533/
>=20
>=20
> _______________________________________________
> Linuxppc-dev mailing list
> Linuxppc-dev@lists.ozlabs.org
> https://lists.ozlabs.org/listinfo/linuxppc-dev
^ permalink raw reply
* [PATCH] Drivers: ps3: ps3av.c: fixed checkpatch warnings
From: Valentin Ilie @ 2012-04-18 9:33 UTC (permalink / raw)
To: geoff; +Cc: cbe-oss-dev, Valentin Ilie, linuxppc-dev, linux-kernel
Fixed some checkpatch warnings. (review)
Last patch didn't compile.
Signed-off-by: Valentin Ilie <valentin.ilie@gmail.com>
---
drivers/ps3/ps3av.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/drivers/ps3/ps3av.c b/drivers/ps3/ps3av.c
index a409fa0..636e618 100644
--- a/drivers/ps3/ps3av.c
+++ b/drivers/ps3/ps3av.c
@@ -338,7 +338,7 @@ int ps3av_do_pkt(u32 cid, u16 send_len, size_t usr_buf_size,
mutex_unlock(&ps3av->mutex);
return 0;
- err:
+err:
mutex_unlock(&ps3av->mutex);
printk(KERN_ERR "%s: failed cid:%x res:%d\n", __func__, cid, res);
return res;
@@ -477,7 +477,6 @@ int ps3av_set_audio_mode(u32 ch, u32 fs, u32 word_bits, u32 format, u32 source)
return 0;
}
-
EXPORT_SYMBOL_GPL(ps3av_set_audio_mode);
static int ps3av_set_videomode(void)
@@ -870,21 +869,18 @@ int ps3av_set_video_mode(int id)
return 0;
}
-
EXPORT_SYMBOL_GPL(ps3av_set_video_mode);
int ps3av_get_auto_mode(void)
{
return ps3av_auto_videomode(&ps3av->av_hw_conf);
}
-
EXPORT_SYMBOL_GPL(ps3av_get_auto_mode);
int ps3av_get_mode(void)
{
return ps3av ? ps3av->ps3av_mode : 0;
}
-
EXPORT_SYMBOL_GPL(ps3av_get_mode);
/* get resolution by video_mode */
@@ -902,7 +898,6 @@ int ps3av_video_mode2res(u32 id, u32 *xres, u32 *yres)
*yres = video_mode_table[id].y;
return 0;
}
-
EXPORT_SYMBOL_GPL(ps3av_video_mode2res);
/* mute */
@@ -911,7 +906,6 @@ int ps3av_video_mute(int mute)
return ps3av_set_av_video_mute(mute ? PS3AV_CMD_MUTE_ON
: PS3AV_CMD_MUTE_OFF);
}
-
EXPORT_SYMBOL_GPL(ps3av_video_mute);
/* mute analog output only */
@@ -935,7 +929,6 @@ int ps3av_audio_mute(int mute)
return ps3av_set_audio_mute(mute ? PS3AV_CMD_MUTE_ON
: PS3AV_CMD_MUTE_OFF);
}
-
EXPORT_SYMBOL_GPL(ps3av_audio_mute);
static int __devinit ps3av_probe(struct ps3_system_bus_device *dev)
--
1.7.9.5
^ permalink raw reply related
* Re: PowerPC radeon KMS - is it possible?
From: Benjamin Herrenschmidt @ 2012-04-18 10:20 UTC (permalink / raw)
To: Michel Dänzer; +Cc: linuxppc-dev, o jordan, Andreas Schwab
In-Reply-To: <1334736133.5989.278.camel@thor.local>
On Wed, 2012-04-18 at 10:02 +0200, Michel Dänzer wrote:
>
> > GPU lockup appears to be a common problem with the radeon driver.
>
> It's what happens when anything goes wrong with the GPU. If it doesn't
> happen with agpmode=-1, it's probably an AGP related coherency issue.
I had some success hacking the DRM to do an in_le32 from the ring head
after writing it. Just a gross hack but it seemed to help on a G5.
I suspect there's a fundamental design issue with apple bridge in that
the CPU to memory path isn't coherent at all with the GPU to memory path
ie. even vs. cache flush instructions (ie buffers in the memory
controllers can still be out of sync).
Darwin does some gross hacks to work around that, some of them visible
in the AGP drivers, some burried in the Apple driver, I don't know for
sure. It's possible that they end up mapping all AGP memory as cache
inhibited, but we can't do that because of our linear mapping.
Cheers,
Ben.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Michel Dänzer @ 2012-04-18 10:34 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, o jordan, Andreas Schwab
In-Reply-To: <1334744414.3143.2.camel@pasglop>
On Mit, 2012-04-18 at 20:20 +1000, Benjamin Herrenschmidt wrote:=20
> On Wed, 2012-04-18 at 10:02 +0200, Michel D=C3=A4nzer wrote:
> >=20
> > > GPU lockup appears to be a common problem with the radeon driver.
> >=20
> > It's what happens when anything goes wrong with the GPU. If it doesn't
> > happen with agpmode=3D-1, it's probably an AGP related coherency issue.=
=20
>=20
> I had some success hacking the DRM to do an in_le32 from the ring head
> after writing it. Just a gross hack but it seemed to help on a G5.
AFAICT radeon_ring_commit() does that already:
DRM_MEMORYBARRIER();
WREG32(ring->wptr_reg, (ring->wptr << ring->ptr_reg_shift) & ring->=
ptr_reg_mask);
(void)RREG32(ring->wptr_reg);
We added the readback about a decade ago. :)
> I suspect there's a fundamental design issue with apple bridge in that
> the CPU to memory path isn't coherent at all with the GPU to memory path
> ie. even vs. cache flush instructions (ie buffers in the memory
> controllers can still be out of sync).
>=20
> Darwin does some gross hacks to work around that, some of them visible
> in the AGP drivers, some burried in the Apple driver, I don't know for
> sure. It's possible that they end up mapping all AGP memory as cache
> inhibited, but we can't do that because of our linear mapping.
We are doing that though...
--=20
Earthling Michel D=C3=A4nzer | http://www.amd.c=
om
Libre software enthusiast | Debian, X and DRI developer
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Benjamin Herrenschmidt @ 2012-04-18 10:35 UTC (permalink / raw)
To: Andreas Schwab; +Cc: o jordan, linuxppc-dev
In-Reply-To: <m2pqb5bhyo.fsf@igel.home>
On Wed, 2012-04-18 at 09:46 +0200, Andreas Schwab wrote:
> Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
>
> > Note also that KMS doesn't afaik have the power management code that
> > radeonfb has for those old Mac chipsets, so suspend/resume won't work.
>
> How hard would it be to add it?
The code itself is relatively self contained, but the KMS power
management side is a bit ... messy :-) So the real deal is to figure out
how best to "hook it up" there.
There's some duplication
Cheers,
Ben.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Benjamin Herrenschmidt @ 2012-04-18 10:37 UTC (permalink / raw)
To: Andreas Schwab; +Cc: o jordan, linuxppc-dev
In-Reply-To: <1334745338.3143.3.camel@pasglop>
On Wed, 2012-04-18 at 20:35 +1000, Benjamin Herrenschmidt wrote:
> On Wed, 2012-04-18 at 09:46 +0200, Andreas Schwab wrote:
> > Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> >
> > > Note also that KMS doesn't afaik have the power management code that
> > > radeonfb has for those old Mac chipsets, so suspend/resume won't work.
> >
> > How hard would it be to add it?
>
> The code itself is relatively self contained, but the KMS power
> management side is a bit ... messy :-) So the real deal is to figure out
> how best to "hook it up" there.
>
> There's some duplication
Argh... bloody x220 touchpad...
So I was saying, there's also some duplication in the area of dynamic
clocks configuration. Some of this could be an issue as afaik, to work
reliably, the suspend/resume code really wants the stuff to be setup
exactly the way the code in radeon_pm does....
But it's definitely worth trying to port it over.
Cheers,
Ben.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Michel Dänzer @ 2012-04-18 10:44 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: Andreas Schwab, o jordan, linuxppc-dev
In-Reply-To: <1334745292.5989.291.camel@thor.local>
On Mit, 2012-04-18 at 12:34 +0200, Michel D=C3=A4nzer wrote:=20
> On Mit, 2012-04-18 at 20:20 +1000, Benjamin Herrenschmidt wrote:=20
> >=20
> > I suspect there's a fundamental design issue with apple bridge in that
> > the CPU to memory path isn't coherent at all with the GPU to memory pat=
h
> > ie. even vs. cache flush instructions (ie buffers in the memory
> > controllers can still be out of sync).
> >=20
> > Darwin does some gross hacks to work around that, some of them visible
> > in the AGP drivers, some burried in the Apple driver, I don't know for
> > sure. It's possible that they end up mapping all AGP memory as cache
> > inhibited, but we can't do that because of our linear mapping.
>=20
> We are doing that though...
This reminded me, I've been running with the patch below, but I'm not
sure it makes any difference. Maybe Andreas or Jordan can try it.
diff --git a/arch/powerpc/include/asm/agp.h b/arch/powerpc/include/asm/agp.=
h
index 416e12c..eb34fa5 100644
--- a/arch/powerpc/include/asm/agp.h
+++ b/arch/powerpc/include/asm/agp.h
@@ -2,9 +2,12 @@
#define _ASM_POWERPC_AGP_H
#ifdef __KERNEL__
=20
+#include <asm/cacheflush.h>
#include <asm/io.h>
=20
-#define map_page_into_agp(page)
+#define map_page_into_agp(page) \
+ flush_dcache_range((unsigned long)page_address(page), \
+ (unsigned long)page_address(page) + PAGE_SIZE)
#define unmap_page_from_agp(page)
#define flush_agp_cache() mb()
=20
--=20
Earthling Michel D=C3=A4nzer | http://www.amd.c=
om
Libre software enthusiast | Debian, X and DRI developer
^ permalink raw reply related
* Re: PowerPC radeon KMS - is it possible?
From: Michel Dänzer @ 2012-04-18 10:54 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, o jordan, Andreas Schwab
In-Reply-To: <1334745439.3143.5.camel@pasglop>
On Mit, 2012-04-18 at 20:37 +1000, Benjamin Herrenschmidt wrote:=20
> On Wed, 2012-04-18 at 20:35 +1000, Benjamin Herrenschmidt wrote:
> > On Wed, 2012-04-18 at 09:46 +0200, Andreas Schwab wrote:
> > > Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> > >=20
> > > > Note also that KMS doesn't afaik have the power management code tha=
t
> > > > radeonfb has for those old Mac chipsets, so suspend/resume won't wo=
rk.
> > >=20
> > > How hard would it be to add it?
> >=20
> > The code itself is relatively self contained, but the KMS power
> > management side is a bit ... messy :-)
That's an interesting way to put it, given the hacks to make it work
between radeonfb and uninorth_agp. :) (Which are complicating making at
least hibernation work with KMS on uninorth_agp)
In contrast, radeon KMS uses the standard Linux device suspend/resume
hooks.
> > So the real deal is to figure out how best to "hook it up" there.
> >=20
> > There's some duplication=20
>=20
> Argh... bloody x220 touchpad...
>=20
> So I was saying, there's also some duplication in the area of dynamic
> clocks configuration. Some of this could be an issue as afaik, to work
> reliably, the suspend/resume code really wants the stuff to be setup
> exactly the way the code in radeon_pm does....
Are you referring to radeon_pm in radeonfb or radeon KMS?
Most of the latter isn't used on PPC laptops because it relies on an x86
video BIOS.
--=20
Earthling Michel D=C3=A4nzer | http://www.amd.c=
om
Libre software enthusiast | Debian, X and DRI developer
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Benjamin Herrenschmidt @ 2012-04-18 11:17 UTC (permalink / raw)
To: Michel Dänzer; +Cc: linuxppc-dev, o jordan, Andreas Schwab
In-Reply-To: <1334745292.5989.291.camel@thor.local>
On Wed, 2012-04-18 at 12:34 +0200, Michel Dänzer wrote:
> On Mit, 2012-04-18 at 20:20 +1000, Benjamin Herrenschmidt wrote:
> > On Wed, 2012-04-18 at 10:02 +0200, Michel Dänzer wrote:
> > >
> > > > GPU lockup appears to be a common problem with the radeon driver.
> > >
> > > It's what happens when anything goes wrong with the GPU. If it doesn't
> > > happen with agpmode=-1, it's probably an AGP related coherency issue.
> >
> > I had some success hacking the DRM to do an in_le32 from the ring head
> > after writing it. Just a gross hack but it seemed to help on a G5.
>
> AFAICT radeon_ring_commit() does that already:
>
> DRM_MEMORYBARRIER();
> WREG32(ring->wptr_reg, (ring->wptr << ring->ptr_reg_shift) & ring->ptr_reg_mask);
> (void)RREG32(ring->wptr_reg);
>
> We added the readback about a decade ago. :)
Hrm, I have a different hack in that old tree I was playing with a while
back, let me see...
--- a/drivers/gpu/drm/radeon/radeon_cp.c
+++ b/drivers/gpu/drm/radeon/radeon_cp.c
@@ -2245,6 +2245,9 @@ void radeon_commit_ring(drm_radeon_private_t
*dev_priv)
DRM_MEMORYBARRIER();
GET_RING_HEAD( dev_priv );
+#ifdef CONFIG_PPC
+ in_be32(dev_priv->ring.start);
+#endif
if ((dev_priv->flags & RADEON_FAMILY_MASK) >= CHIP_R600) {
I think that my rational was to ensure that all previous stores to
AGP (indirect buffers etc...) were pushed out & ordered vs the ring
wptr update or something like that, bcs I think those path aren't well
ordered in HW. In fact I suspect we might even need a bigger hammer than
that in_be32().
Another hack I had around was removing the SBA reset from agp-uninorth
completely on binding new pages, it seemed to cause hangs.
> > I suspect there's a fundamental design issue with apple bridge in that
> > the CPU to memory path isn't coherent at all with the GPU to memory path
> > ie. even vs. cache flush instructions (ie buffers in the memory
> > controllers can still be out of sync).
> >
> > Darwin does some gross hacks to work around that, some of them visible
> > in the AGP drivers, some burried in the Apple driver, I don't know for
> > sure. It's possible that they end up mapping all AGP memory as cache
> > inhibited, but we can't do that because of our linear mapping.
>
> We are doing that though...
Are we really ? I thought we were taking existing cachable RAM objects
and mapping them into the AGP gart. Are we replacing both kernel & user
mappings for those objects with an equivalent cache inhibited mapping ?
I'm not -that- familiar with how ttm works here. In any case it can
cause bus checkstops because the same pages can be prefetched into the
cache via the linear mapping which is covered by BATs (unless you make
your graphic objects HIGHMEM only but good luck with that :-)
To make that work reliably we should disable the BAT mapping so the
linear mapping can then be controlled on a per-page basis (on 32-bit)
and this is complicated .... we have code that more/less relies on the
BAT mapping being there elsewhere. On 64-bit it's even nastier because
we use 16M pages for the linear mapping.
Cheers,
Ben.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Benjamin Herrenschmidt @ 2012-04-18 11:19 UTC (permalink / raw)
To: Michel Dänzer; +Cc: Andreas Schwab, o jordan, linuxppc-dev
In-Reply-To: <1334745854.5989.295.camel@thor.local>
On Wed, 2012-04-18 at 12:44 +0200, Michel Dänzer wrote:
> On Mit, 2012-04-18 at 12:34 +0200, Michel Dänzer wrote:
> > On Mit, 2012-04-18 at 20:20 +1000, Benjamin Herrenschmidt wrote:
> > >
> > > I suspect there's a fundamental design issue with apple bridge in that
> > > the CPU to memory path isn't coherent at all with the GPU to memory path
> > > ie. even vs. cache flush instructions (ie buffers in the memory
> > > controllers can still be out of sync).
> > >
> > > Darwin does some gross hacks to work around that, some of them visible
> > > in the AGP drivers, some burried in the Apple driver, I don't know for
> > > sure. It's possible that they end up mapping all AGP memory as cache
> > > inhibited, but we can't do that because of our linear mapping.
> >
> > We are doing that though...
>
> This reminded me, I've been running with the patch below, but I'm not
> sure it makes any difference. Maybe Andreas or Jordan can try it.
It certainly is something we need to do, provided we also know there
will be no subsequent access to that page via a cachable mapping until
it's removed from AGP.
Cheers,
Ben.
>
> diff --git a/arch/powerpc/include/asm/agp.h b/arch/powerpc/include/asm/agp.h
> index 416e12c..eb34fa5 100644
> --- a/arch/powerpc/include/asm/agp.h
> +++ b/arch/powerpc/include/asm/agp.h
> @@ -2,9 +2,12 @@
> #define _ASM_POWERPC_AGP_H
> #ifdef __KERNEL__
>
> +#include <asm/cacheflush.h>
> #include <asm/io.h>
>
> -#define map_page_into_agp(page)
> +#define map_page_into_agp(page) \
> + flush_dcache_range((unsigned long)page_address(page), \
> + (unsigned long)page_address(page) + PAGE_SIZE)
> #define unmap_page_from_agp(page)
> #define flush_agp_cache() mb()
>
>
>
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Benjamin Herrenschmidt @ 2012-04-18 11:23 UTC (permalink / raw)
To: Michel Dänzer; +Cc: linuxppc-dev, o jordan, Andreas Schwab
In-Reply-To: <1334746446.5989.300.camel@thor.local>
On Wed, 2012-04-18 at 12:54 +0200, Michel Dänzer wrote:
> On Mit, 2012-04-18 at 20:37 +1000, Benjamin Herrenschmidt wrote:
> > On Wed, 2012-04-18 at 20:35 +1000, Benjamin Herrenschmidt wrote:
> > > On Wed, 2012-04-18 at 09:46 +0200, Andreas Schwab wrote:
> > > > Benjamin Herrenschmidt <benh@kernel.crashing.org> writes:
> > > >
> > > > > Note also that KMS doesn't afaik have the power management code that
> > > > > radeonfb has for those old Mac chipsets, so suspend/resume won't work.
> > > >
> > > > How hard would it be to add it?
> > >
> > > The code itself is relatively self contained, but the KMS power
> > > management side is a bit ... messy :-)
>
> That's an interesting way to put it, given the hacks to make it work
> between radeonfb and uninorth_agp. :) (Which are complicating making at
> least hibernation work with KMS on uninorth_agp)
Oh, I forgot about the AGP hooks indeed... but even that, it's in arch
code so it's not necessarily a huge deal to move it over. IE. It's just
a function pointer to call at the right time that's exported by the
arch.
> In contrast, radeon KMS uses the standard Linux device suspend/resume
> hooks.
Well, as radeonfb does.
The hack with AGP is so that radeonfb gets to control when the AGP is
suspended/restored as it needs to be done in a specific order and the
device model doesn't provide the right ordering (they are sibling
devices).
There's also an early-wakeup hack but that's orthogonal, it's mostly
useful for debugging and doesn't necessarily need to be ported over.
> > Argh... bloody x220 touchpad...
> >
> > So I was saying, there's also some duplication in the area of dynamic
> > clocks configuration. Some of this could be an issue as afaik, to work
> > reliably, the suspend/resume code really wants the stuff to be setup
> > exactly the way the code in radeon_pm does....
>
> Are you referring to radeon_pm in radeonfb or radeon KMS?
radeonfb.
> Most of the latter isn't used on PPC laptops because it relies on an x86
> video BIOS.
Right, we might be able to easily port my old code over by simply making
it ppc specific. In radeonfb, it's also used for some thinkpads among
others but KMS does that with the BIOS on these no ? (ie. D2 state).
Cheers,
Ben.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Andreas Schwab @ 2012-04-18 11:25 UTC (permalink / raw)
To: Michel Dänzer; +Cc: o jordan, linuxppc-dev
In-Reply-To: <1334735555.5989.272.camel@thor.local>
Michel Dänzer <michel@daenzer.net> writes:
> On Mit, 2012-04-18 at 09:42 +0200, Andreas Schwab wrote:
>> Michel Dänzer <michel@daenzer.net> writes:
>>
>> > Not sure it's a good idea to set both of these =y: It will prevent the
>> > radeon driver from initializing at all by default if radeonfb is active.
>>
>> You can say video=radeonfb:off.
>
> I know, I'm referring to the default behaviour without any relevant
> kernel command line options.
Which is exactly the right behaviour for me.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Andreas Schwab @ 2012-04-18 11:30 UTC (permalink / raw)
To: Michel Dänzer; +Cc: o jordan, linuxppc-dev
In-Reply-To: <1334736133.5989.278.camel@thor.local>
Michel Dänzer <michel@daenzer.net> writes:
> On Mit, 2012-04-18 at 09:54 +0200, Andreas Schwab wrote:
>> Michel Dänzer <michel@daenzer.net> writes:
>>
>> > Probably not (AGP is flaky in general, but in particular with older
>> > UniNorth bridges), but it might be interesting to see some kernel output
>> > from booting without agpmode=-1. If you can't get it via ssh, maybe you
>> > can via netconsole or so.
>>
>> While logging into KDE:
>>
>> radeon 0000:00:10.0: GPU lockup CP stall for more than 10064msec
>> GPU lockup (waiting for 0x000003EE last fence id 0x000003ED)
>> radeon: wait for empty RBBM fifo failed ! Bad things might happen.
>> Failed to wait GUI idle while programming pipes. Bad things might happen.
>> radeon 0000:00:10.0: (r300_asic_reset:414) RBBM_STATUS=0x8802C137
>> radeon 0000:00:10.0: (r300_asic_reset:433) RBBM_STATUS=0x8802C137
>> radeon 0000:00:10.0: (r300_asic_reset:445) RBBM_STATUS=0x8802C137
>> radeon 0000:00:10.0: GPU reset succeed
>> radeon 0000:00:10.0: GPU reset succeed
>> radeon 0000:00:10.0: (r300_asic_reset:414) RBBM_STATUS=0x8802C137
>> radeon 0000:00:10.0: (r300_asic_reset:433) RBBM_STATUS=0x8802C137
>> radeon 0000:00:10.0: (r300_asic_reset:445) RBBM_STATUS=0x8802C137
>> radeon 0000:00:10.0: GPU reset succeed
>> radeon: wait for empty RBBM fifo failed ! Bad things might happen.
>> Failed to wait GUI idle while programming pipes. Bad things might happen.
>
> That's even with agpmode=1?
Yes. Note that I get pretty far into the login process until the lockup
happens.
> Note that I'm interested in seeing the full dmesg or at least all
> agp/drm/radeon related messages.
This was a test with agpmode=1:
Linux agpgart interface v0.103
agpgart-uninorth 0000:00:0b.0: Apple UniNorth 2 chipset
agpgart-uninorth 0000:00:0b.0: configuring for size idx: 64
agpgart-uninorth 0000:00:0b.0: AGP aperture is 256M @ 0x0
[drm] Initialized drm 1.1.0 20060810
[drm] radeon kernel modesetting enabled.
radeon 0000:00:10.0: enabling device (0006 -> 0007)
[drm] initializing kernel modesetting (RV350 0x1002:0x4E56 0x1002:0x4E56).
[drm] register mmio base: 0x90000000
[drm] register mmio size: 65536
radeon 0000:00:10.0: Invalid ROM contents
radeon 0000:00:10.0: Invalid ROM contents
[drm:radeon_get_bios] *ERROR* Unable to locate a BIOS ROM
[drm] Using device-tree clock info
[drm] AGP mode requested: 1
agpgart-uninorth 0000:00:0b.0: putting AGP V2 device into 1x mode
radeon 0000:00:10.0: putting AGP V2 device into 1x mode
radeon 0000:00:10.0: GTT: 256M 0x00000000 - 0x0FFFFFFF
[drm] Generation 2 PCI interface, using max accessible memory
radeon 0000:00:10.0: VRAM: 128M 0x0000000098000000 - 0x000000009FFFFFFF (32M used)
[drm] Supports vblank timestamp caching Rev 1 (10.10.2010).
[drm] Driver supports precise vblank timestamp query.
[drm] radeon: irq initialized.
[drm] Detected VRAM RAM=128M, BAR=128M
[drm] RAM width 64bits DDR
[TTM] Zone kernel: Available graphics memory: 384080 kiB
[TTM] Zone highmem: Available graphics memory: 515152 kiB
[TTM] Initializing pool allocator
[drm] radeon: 32M of VRAM memory ready
[drm] radeon: 256M of GTT memory ready.
[drm] radeon: ib pool ready.
[drm] radeon: 1 quad pipes, 1 Z pipes initialized.
radeon 0000:00:10.0: WB disabled
[drm] fence driver on ring 0 use gpu addr 0x00000000 and cpu addr 0xf1086000
[drm] Loading R300 Microcode
[drm] radeon: ring at 0x0000000000001000
[drm] ring test succeeded in 2 usecs
[drm] ib test succeeded in 0 usecs
[drm] Connector Table: 2 (ibook)
[drm] No panel info found in BIOS
[drm] Panel info derived from registers
[drm] Panel Size 1024x768
[drm] radeon legacy LVDS backlight initialized
[drm] No TV DAC info found in BIOS
>> After that is is dead.
> The whole machine?
No pings any more.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* [PATCH 4/4] powerpc: Remove CONFIG_POWER4_ONLY
From: Anton Blanchard @ 2012-04-18 12:21 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, paulus
In-Reply-To: <1334732224.1159.4.camel@pasglop>
Remove CONFIG_POWER4_ONLY, the option is badly named and only does two
things:
- It wraps the MMU segment table code. With feature fixups there is
little downside to compiling this in.
- It uses the newer mtocrf instruction in various assembly functions.
Instead of making this a compile option just do it at runtime via
a feature fixup.
Signed-off-by: Anton Blanchard <anton@samba.org>
---
v2: Use CPU_FTR_NOEXECUTE to select the newer mtocrf
Index: linux-build/arch/powerpc/configs/g5_defconfig
===================================================================
--- linux-build.orig/arch/powerpc/configs/g5_defconfig 2012-04-18 22:12:59.292790202 +1000
+++ linux-build/arch/powerpc/configs/g5_defconfig 2012-04-18 22:13:13.029035714 +1000
@@ -1,5 +1,4 @@
CONFIG_PPC64=y
-CONFIG_POWER4_ONLY=y
CONFIG_ALTIVEC=y
CONFIG_SMP=y
CONFIG_NR_CPUS=4
Index: linux-build/arch/powerpc/configs/maple_defconfig
===================================================================
--- linux-build.orig/arch/powerpc/configs/maple_defconfig 2012-04-18 22:12:59.264789702 +1000
+++ linux-build/arch/powerpc/configs/maple_defconfig 2012-04-18 22:13:13.029035714 +1000
@@ -1,5 +1,4 @@
CONFIG_PPC64=y
-CONFIG_POWER4_ONLY=y
CONFIG_SMP=y
CONFIG_NR_CPUS=4
CONFIG_EXPERIMENTAL=y
Index: linux-build/arch/powerpc/configs/pasemi_defconfig
===================================================================
--- linux-build.orig/arch/powerpc/configs/pasemi_defconfig 2012-04-18 22:12:59.280789988 +1000
+++ linux-build/arch/powerpc/configs/pasemi_defconfig 2012-04-18 22:13:13.029035714 +1000
@@ -1,5 +1,4 @@
CONFIG_PPC64=y
-CONFIG_POWER4_ONLY=y
CONFIG_ALTIVEC=y
# CONFIG_VIRT_CPU_ACCOUNTING is not set
CONFIG_SMP=y
Index: linux-build/arch/powerpc/kernel/exceptions-64s.S
===================================================================
--- linux-build.orig/arch/powerpc/kernel/exceptions-64s.S 2012-04-18 22:12:59.252789487 +1000
+++ linux-build/arch/powerpc/kernel/exceptions-64s.S 2012-04-18 22:13:13.029035714 +1000
@@ -94,12 +94,10 @@ machine_check_pSeries_1:
data_access_pSeries:
HMT_MEDIUM
SET_SCRATCH0(r13)
-#ifndef CONFIG_POWER4_ONLY
BEGIN_FTR_SECTION
b data_access_check_stab
data_access_not_stab:
END_MMU_FTR_SECTION_IFCLR(MMU_FTR_SLB)
-#endif
EXCEPTION_PROLOG_PSERIES(PACA_EXGEN, data_access_common, EXC_STD,
KVMTEST, 0x300)
@@ -301,7 +299,6 @@ machine_check_fwnmi:
EXC_STD, KVMTEST, 0x200)
KVM_HANDLER_SKIP(PACA_EXMC, EXC_STD, 0x200)
-#ifndef CONFIG_POWER4_ONLY
/* moved from 0x300 */
data_access_check_stab:
GET_PACA(r13)
@@ -328,7 +325,6 @@ do_stab_bolted_pSeries:
GET_SCRATCH0(r10)
std r10,PACA_EXSLB+EX_R13(r13)
EXCEPTION_PROLOG_PSERIES_1(.do_stab_bolted, EXC_STD)
-#endif /* CONFIG_POWER4_ONLY */
KVM_HANDLER_SKIP(PACA_EXGEN, EXC_STD, 0x300)
KVM_HANDLER_SKIP(PACA_EXSLB, EXC_STD, 0x380)
Index: linux-build/arch/powerpc/platforms/Kconfig.cputype
===================================================================
--- linux-build.orig/arch/powerpc/platforms/Kconfig.cputype 2012-04-18 22:12:59.312790560 +1000
+++ linux-build/arch/powerpc/platforms/Kconfig.cputype 2012-04-18 22:13:13.029035714 +1000
@@ -116,15 +116,6 @@ config PPC_BOOK3E
def_bool y
depends on PPC_BOOK3E_64
-config POWER4_ONLY
- bool "Optimize for POWER4"
- depends on PPC64 && PPC_BOOK3S
- default n
- ---help---
- Cause the compiler to optimize for POWER4/POWER5/PPC970 processors.
- The resulting binary will not work on POWER3 or RS64 processors
- when compiled with binutils 2.15 or later.
-
config 6xx
def_bool y
depends on PPC32 && PPC_BOOK3S
Index: linux-build/arch/powerpc/include/asm/asm-compat.h
===================================================================
--- linux-build.orig/arch/powerpc/include/asm/asm-compat.h 2012-04-18 22:12:59.236789201 +1000
+++ linux-build/arch/powerpc/include/asm/asm-compat.h 2012-04-18 22:13:13.033035785 +1000
@@ -29,18 +29,9 @@
#define PPC_LLARX(t, a, b, eh) PPC_LDARX(t, a, b, eh)
#define PPC_STLCX stringify_in_c(stdcx.)
#define PPC_CNTLZL stringify_in_c(cntlzd)
+#define PPC_MTOCRF(FXM, RS) MTOCRF((FXM), (RS))
#define PPC_LR_STKOFF 16
#define PPC_MIN_STKFRM 112
-
-/* Move to CR, single-entry optimized version. Only available
- * on POWER4 and later.
- */
-#ifdef CONFIG_POWER4_ONLY
-#define PPC_MTOCRF stringify_in_c(mtocrf)
-#else
-#define PPC_MTOCRF stringify_in_c(mtcrf)
-#endif
-
#else /* 32-bit */
/* operations for longs and pointers */
Index: linux-build/arch/powerpc/lib/copyuser_64.S
===================================================================
--- linux-build.orig/arch/powerpc/lib/copyuser_64.S 2012-04-18 22:12:59.180788200 +1000
+++ linux-build/arch/powerpc/lib/copyuser_64.S 2012-04-18 22:13:13.033035785 +1000
@@ -30,7 +30,7 @@ _GLOBAL(__copy_tofrom_user_base)
dcbt 0,r4
beq .Lcopy_page_4K
andi. r6,r6,7
- PPC_MTOCRF 0x01,r5
+ PPC_MTOCRF(0x01,r5)
blt cr1,.Lshort_copy
/* Below we want to nop out the bne if we're on a CPU that has the
* CPU_FTR_UNALIGNED_LD_STD bit set and the CPU_FTR_CP_USE_DCBTZ bit
@@ -186,7 +186,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_
blr
.Ldst_unaligned:
- PPC_MTOCRF 0x01,r6 /* put #bytes to 8B bdry into cr7 */
+ PPC_MTOCRF(0x01,r6) /* put #bytes to 8B bdry into cr7 */
subf r5,r6,r5
li r7,0
cmpldi cr1,r5,16
@@ -201,7 +201,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_
2: bf cr7*4+1,3f
37: lwzx r0,r7,r4
83: stwx r0,r7,r3
-3: PPC_MTOCRF 0x01,r5
+3: PPC_MTOCRF(0x01,r5)
add r4,r6,r4
add r3,r6,r3
b .Ldst_aligned
Index: linux-build/arch/powerpc/lib/memcpy_64.S
===================================================================
--- linux-build.orig/arch/powerpc/lib/memcpy_64.S 2012-04-18 22:12:59.208788700 +1000
+++ linux-build/arch/powerpc/lib/memcpy_64.S 2012-04-18 22:13:13.033035785 +1000
@@ -12,7 +12,7 @@
.align 7
_GLOBAL(memcpy)
std r3,48(r1) /* save destination pointer for return value */
- PPC_MTOCRF 0x01,r5
+ PPC_MTOCRF(0x01,r5)
cmpldi cr1,r5,16
neg r6,r3 # LS 3 bits = # bytes to 8-byte dest bdry
andi. r6,r6,7
@@ -154,7 +154,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_
blr
.Ldst_unaligned:
- PPC_MTOCRF 0x01,r6 # put #bytes to 8B bdry into cr7
+ PPC_MTOCRF(0x01,r6) # put #bytes to 8B bdry into cr7
subf r5,r6,r5
li r7,0
cmpldi cr1,r5,16
@@ -169,7 +169,7 @@ END_FTR_SECTION_IFCLR(CPU_FTR_UNALIGNED_
2: bf cr7*4+1,3f
lwzx r0,r7,r4
stwx r0,r7,r3
-3: PPC_MTOCRF 0x01,r5
+3: PPC_MTOCRF(0x01,r5)
add r4,r6,r4
add r3,r6,r3
b .Ldst_aligned
Index: linux-build/arch/powerpc/lib/mem_64.S
===================================================================
--- linux-build.orig/arch/powerpc/lib/mem_64.S 2012-04-18 22:12:59.192788415 +1000
+++ linux-build/arch/powerpc/lib/mem_64.S 2012-04-18 22:13:13.033035785 +1000
@@ -19,7 +19,7 @@ _GLOBAL(memset)
rlwimi r4,r4,16,0,15
cmplw cr1,r5,r0 /* do we get that far? */
rldimi r4,r4,32,0
- PPC_MTOCRF 1,r0
+ PPC_MTOCRF(1,r0)
mr r6,r3
blt cr1,8f
beq+ 3f /* if already 8-byte aligned */
@@ -49,7 +49,7 @@ _GLOBAL(memset)
bdnz 4b
5: srwi. r0,r5,3
clrlwi r5,r5,29
- PPC_MTOCRF 1,r0
+ PPC_MTOCRF(1,r0)
beq 8f
bf 29,6f
std r4,0(r6)
@@ -65,7 +65,7 @@ _GLOBAL(memset)
std r4,0(r6)
addi r6,r6,8
8: cmpwi r5,0
- PPC_MTOCRF 1,r5
+ PPC_MTOCRF(1,r5)
beqlr+
bf 29,9f
stw r4,0(r6)
Index: linux-build/arch/powerpc/include/asm/ppc_asm.h
===================================================================
--- linux-build.orig/arch/powerpc/include/asm/ppc_asm.h 2012-04-18 22:12:59.220788915 +1000
+++ linux-build/arch/powerpc/include/asm/ppc_asm.h 2012-04-18 22:13:13.033035785 +1000
@@ -369,7 +369,15 @@ BEGIN_FTR_SECTION \
END_FTR_SECTION_IFCLR(CPU_FTR_601)
#endif
-
+#ifdef CONFIG_PPC64
+#define MTOCRF(FXM, RS) \
+ BEGIN_FTR_SECTION_NESTED(848); \
+ mtcrf (FXM), (RS); \
+ FTR_SECTION_ELSE_NESTED(848); \
+ mtocrf (FXM), (RS); \
+ ALT_FTR_SECTION_END_NESTED_IFCLR(CPU_FTR_NOEXECUTE, 848)
+#endif
+
/*
* This instruction is not implemented on the PPC 603 or 601; however, on
* the 403GCX and 405GP tlbia IS defined and tlbie is not.
^ permalink raw reply
* Re: PowerPC radeon KMS - is it possible?
From: Andreas Schwab @ 2012-04-18 12:49 UTC (permalink / raw)
To: Michel Dänzer; +Cc: o jordan, linuxppc-dev
In-Reply-To: <1334745854.5989.295.camel@thor.local>
Michel Dänzer <michel@daenzer.net> writes:
> -#define map_page_into_agp(page)
> +#define map_page_into_agp(page) \
> + flush_dcache_range((unsigned long)page_address(page), \
> + (unsigned long)page_address(page) + PAGE_SIZE)
That didn't help.
Andreas.
--
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: [EDAC PATCH v13 4/7] edac: move nr_pages to dimm struct
From: Mauro Carvalho Chehab @ 2012-04-18 12:58 UTC (permalink / raw)
To: Borislav Petkov
Cc: Shaohui Xie, Jason Uhlenkott, Hitoshi Mitake, Mark Gross,
Dmitry Eremin-Solenikov, Ranganathan Desikan, Egor Martovetsky,
Niklas Söderlund, Tim Small, Arvind R., Chris Metcalf,
Olof Johansson, Doug Thompson, Linux Edac Mailing List,
Michal Marek, Jiri Kosina, Linux Kernel Mailing List, Joe Perches,
Andrew Morton, linuxppc-dev
In-Reply-To: <20120417214027.GB15397@aftab>
Em 17-04-2012 18:40, Borislav Petkov escreveu:
> On Tue, Apr 17, 2012 at 04:28:49PM -0300, Mauro Carvalho Chehab wrote:
>> Ok. well, we can either multiply nr_pages by channel_count or to let it
>> clear that this is per channel. I prefer the last option (see the enclosed
>> patch).
>>
>>>> @@ -2152,6 +2146,7 @@ static int init_csrows(struct mem_ctl_info *mci)
>>>> int i, j, empty = 1;
>>>> enum mem_type mtype;
>>>> enum edac_type edac_mode;
>>>> + int nr_pages;
>>>>
>>>> amd64_read_pci_cfg(pvt->F3, NBCFG, &val);
>>>>
>>>> @@ -2174,14 +2169,14 @@ static int init_csrows(struct mem_ctl_info *mci)
>>>> i, pvt->mc_node_id);
>>>>
>>>> empty = 0;
>>>> - csrow->nr_pages = amd64_csrow_nr_pages(pvt, 0, i);
>>>> + nr_pages = amd64_csrow_nr_pages(pvt, 0, i);
>>>> get_cs_base_and_mask(pvt, i, 0, &base, &mask);
>>>> /* 8 bytes of resolution */
>>>>
>>>> mtype = amd64_determine_memory_type(pvt, i);
>>>>
>>>> debugf1(" for MC node %d csrow %d:\n", pvt->mc_node_id, i);
>>>> - debugf1(" nr_pages: %u\n", csrow->nr_pages);
>>>> + debugf1(" nr_pages: %u\n", nr_pages);
>>>>
>>>> /*
>>>> * determine whether CHIPKILL or JUST ECC or NO ECC is operating
>>>> @@ -2195,6 +2190,7 @@ static int init_csrows(struct mem_ctl_info *mci)
>>>> for (j = 0; j < pvt->channel_count; j++) {
>>>> csrow->channels[j].dimm->mtype = mtype;
>>>> csrow->channels[j].dimm->edac_mode = edac_mode;
>>>> + csrow->channels[j].dimm->nr_pages = nr_pages;
>>>
>>> I'm guessing you want to accumulate the nr_pages for all channels here
>>> and dump it properly?
>>>
>>
>> As you've requested to not move the debugf0() to be after the loop, it is
>> easier to just multiply it at the printk. As an advantage, when the kernel
>> is compiled without debug, no code will be produced.
>>
>> IMO, the best way to solve it is with this small patch. If you're ok, I'll
>> fold it with this one and add your ack.
>>
>> Regards,
>> Mauro
>>
>> diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c
>> index 8804ac8..6d6ec68 100644
>> --- a/drivers/edac/amd64_edac.c
>> +++ b/drivers/edac/amd64_edac.c
>> @@ -2127,7 +2127,7 @@ static u32 amd64_csrow_nr_pages(struct amd64_pvt *pvt, u8 dct, int csrow_nr)
>> nr_pages = pvt->ops->dbam_to_cs(pvt, dct, cs_mode) << (20 - PAGE_SHIFT);
>>
>> debugf0(" (csrow=%d) DBAM map index= %d\n", csrow_nr, cs_mode);
>> - debugf0(" nr_pages= %u channel-count = %d\n",
>> + debugf0(" nr_pages/channel= %u channel-count = %d\n",
>> nr_pages, pvt->channel_count);
>>
>> return nr_pages;
>> @@ -2176,7 +2176,7 @@ static int init_csrows(struct mem_ctl_info *mci)
>> mtype = amd64_determine_memory_type(pvt, i);
>>
>> debugf1(" for MC node %d csrow %d:\n", pvt->mc_node_id, i);
>> - debugf1(" nr_pages: %u\n", nr_pages);
>> + debugf1(" nr_pages: %u\n", nr_pages * pvt->channel_count);
>>
>> /*
>> * determine whether CHIPKILL or JUST ECC or NO ECC is operating
>
> Yeah, this is basically what the code did anyway, so yes, please fold it
> in and you can add my ACK. I'll continue reviewing the rest tomorrow.
Thanks!
Mauro
>
> Thanks.
>
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox