* RE: [PATCH/2.6.17-rc4 3/10] Powerpc: Add tsi108 common function
From: Zang Roy-r61911 @ 2006-05-25 4:20 UTC (permalink / raw)
To: Kumar Gala, Benjamin Herrenschmidt
Cc: linuxppc-dev list, Yang Xin-Xin-r48390, Paul Mackerras,
Alexandre.Bounine
> Can the PCI use indirect like used on most other PPC platforms.
Now , I was confirmed that we cannot switch to it.
Reason for that is our need for the machine check exception handling for PCI Config reads.
Tsi108/109 does not have HW mechanism to ignore Master Abort during Config read and return all ones.
We have to provide our routine with .fixup section to be able process failed PCI Config reads (Master Abort on PCI).
The indirect method relies on the HW mechanism.
Another question that appeared around machine check handling was calling of tsi108_clear_pci_cfg_error() function.
We have it to clean errors reported during PCI bus probe. We may skip it (and PCI block still be operational) but
this will block error reporting mechanism because the PCI block only records the first detected error.
So we decided it may be better to keep error reporting active by cleaning errors that we expect during PCI enumeration.
I do not see any harm here because I will provide our own machine check handler in my board support file according to
Ben's suggestion.
Roy
>
> > +int
> > +tsi108_direct_write_config(struct pci_bus *bus, unsigned
> int devfunc,
> > + int offset, int len, u32 val)
> > +{
> > + volatile unsigned char *cfg_addr;
> > +
> > + cfg_addr = (unsigned char *)(tsi_mk_config_addr(bus->number,
> > +
> devfunc, offset) |
> > + (offset & 0x03));
> > +
> > +#ifdef TSI108_PCI_DEBUG
> > + printk("PCI CFG write : ");
> > + printk("%d:0x%x:0x%x ", bus->number, devfunc, offset);
> > + printk("%d ADDR=0x%08x ", len, (uint) cfg_addr);
> > + printk("data = 0x%08x\n", val);
> > +#endif
> > +
> > + switch (len) {
> > + case 1:
> > + out_8((u8 *) cfg_addr, val);
> > + break;
> > + case 2:
> > + out_le16((u16 *) cfg_addr, val);
> > + break;
> > + default:
> > + out_le32((u32 *) cfg_addr, val);
> > + break;
> > + }
> > +
> > + return PCIBIOS_SUCCESSFUL;
> > +}
> > +
^ permalink raw reply
* Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
From: Andrew Morton @ 2006-05-25 4:59 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, Johannes Berg, Alan Stern, cpufreq
In-Reply-To: <1148531830.13249.237.camel@localhost.localdomain>
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
> -------- Forwarded Message --------
> From: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> To: Johannes Berg <johannes@sipsolutions.net>
> Cc: linuxppc-dev list <linuxppc-dev@ozlabs.org>, Michael Hanselmann
> <linux-kernel@hansmi.ch>, cpufreq@lists.linux.org.uk
> Subject: Re: via-pmu runs device_power_down in atomic context
> Date: Thu, 25 May 2006 12:28:15 +1000
>
> On Wed, 2006-05-24 at 10:01 +0200, Johannes Berg wrote:
> > Hey,
> >
> > Everytime I suspend my powerbook, I see the following trace:
> >
> > [10655.887546] BUG: sleeping function called from invalid context at include/linux/rwsem.h:43
> > [10655.887558] in_atomic():0, irqs_disabled():1
> > [10655.887562] Call Trace:
> > [10655.887565] [C581BD20] [C00081E8] show_stack+0x50/0x190 (unreliable)
> > [10655.887582] [C581BD50] [C0023BB0] __might_sleep+0xcc/0xe8
> > [10655.887592] [C581BD60] [C0038290] blocking_notifier_call_chain+0x2c/0xc0
> > [10655.887606] [C581BD80] [C01E90C0] cpufreq_suspend+0x130/0x148
> > [10655.887616] [C581BDB0] [C019D9E8] sysdev_suspend+0x10c/0x300
> > [10655.887627] [C581BDF0] [C01A3888] device_power_down+0x74/0xac
> > [10655.887636] [C581BE10] [C01B1264] pmac_suspend_devices+0x98/0x188
> > [10655.887643] [C581BE30] [C01B18F0] pmu_ioctl+0x59c/0xbc0
> > [10655.887649] [C581BED0] [C008E898] do_ioctl+0x80/0x84
> > [10655.887660] [C581BEE0] [C008E928] vfs_ioctl+0x8c/0x48c
> > [10655.887666] [C581BF10] [C008ED68] sys_ioctl+0x40/0x74
> > [10655.887673] [C581BF40] [C000F3A4] ret_from_syscall+0x0/0x38
> >
> > The might_sleep() comes from down_read() and this happens because
> > blocking_notifier_call_chain calls it, it is also commented to run in
> > process context so this is all proper.
>
> device_power_down should be called with interrupts off, thus the PMU
> driver is fine. It's a misnamed function, it calls the sysdev's suspend
> and those should be called with irq off. I think the problem is more due
> to some cpufreq or notifier change that somebody done to recent kernels
> and that added some might_sleep.... I wonder why.
>
> Andrew, what's up there ? What is this new
> "blocking_notifier_call_chain" thing ? notifiers use to not use
> semaphores and not be blocking... at least powermac implementation of
> cpufreq relies on that.
notifiers used to be racy too - we just waddled across them without any
locking.
Alan made a best-effort conversion of callers, and there have been a few
problems.
Here, pmac has gone and unilaterally decided that device_power_down() is
atomic, even though device_power_down() _already_ calls suspend_device(),
which does down(). So I'd say you've gone and found a via-pmu bug here.
A way of shutting up the warning would be to use an atomic notifier, but
it'll still be buggy. Better would be to teach pmac_suspend_devices() not
to assume things which aren't true ;)
^ permalink raw reply
* Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
From: Benjamin Herrenschmidt @ 2006-05-25 5:19 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, Johannes Berg, Alan Stern, cpufreq
In-Reply-To: <20060524215917.230af218.akpm@osdl.org>
> Here, pmac has gone and unilaterally decided that device_power_down() is
> atomic, even though device_power_down() _already_ calls suspend_device(),
> which does down(). So I'd say you've gone and found a via-pmu bug here.
No. Look at the implementation (and the comment) in device_power_down().
It's designed to be called with irqs off... Of course, somebody changed
the locking in there and it's indeed ending up calling suspend_device()
for devices on the irq_off list which calls down ... bad bad... that's
another bug in the drivers/power/* to add to an already long list.
Fortunately, very few (if any) devics rely on this irq_off list. But
sysdev's do.
> A way of shutting up the warning would be to use an atomic notifier, but
> it'll still be buggy. Better would be to teach pmac_suspend_devices() not
> to assume things which aren't true ;)
No. If we call device_power_down with interrupts enabled, very bad
things will happen. This powermac code is very carefully crafted to do
things in a strict order and it's along those lines that the callbacks
in the device model were initially defined. Now, people who don't
understand shit about how to make power management reliable may have
broken things around, but the powermac implementation is right there.
Ben.
^ permalink raw reply
* Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
From: Andrew Morton @ 2006-05-25 5:36 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev, johannes, stern, cpufreq
In-Reply-To: <1148534398.13249.246.camel@localhost.localdomain>
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
>
>
> > Here, pmac has gone and unilaterally decided that device_power_down() is
> > atomic, even though device_power_down() _already_ calls suspend_device(),
> > which does down(). So I'd say you've gone and found a via-pmu bug here.
>
> No. Look at the implementation (and the comment) in device_power_down().
> It's designed to be called with irqs off... Of course, somebody changed
> the locking in there and it's indeed ending up calling suspend_device()
> for devices on the irq_off list which calls down ... bad bad... that's
> another bug in the drivers/power/* to add to an already long list.
> Fortunately, very few (if any) devics rely on this irq_off list. But
> sysdev's do.
uh-huh.
> > A way of shutting up the warning would be to use an atomic notifier, but
> > it'll still be buggy. Better would be to teach pmac_suspend_devices() not
> > to assume things which aren't true ;)
>
> No. If we call device_power_down with interrupts enabled, very bad
> things will happen. This powermac code is very carefully crafted to do
> things in a strict order and it's along those lines that the callbacks
> in the device model were initially defined. Now, people who don't
> understand shit about how to make power management reliable may have
> broken things around, but the powermac implementation is right there.
>
This requirement to keep interrupts off in there breaks things again and
again and again and again. And this time: again.
It looks like we (again) have to live with it in which case conversion to
an atomic notifier is probably needed. That may break other things though.
Alan would know.
^ permalink raw reply
* Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
From: Benjamin Herrenschmidt @ 2006-05-25 5:44 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, Johannes Berg, Alan Stern, cpufreq
In-Reply-To: <1148534398.13249.246.camel@localhost.localdomain>
> No. If we call device_power_down with interrupts enabled, very bad
> things will happen. This powermac code is very carefully crafted to do
> things in a strict order and it's along those lines that the callbacks
> in the device model were initially defined. Now, people who don't
> understand shit about how to make power management reliable may have
> broken things around, but the powermac implementation is right there.
To be more precise, sysdev suspend is supposed to happen with irq offs
(it's specifically designed to handle legacy things, interrupt
controllers, ec...). Thus cpufreq suspend/resume need to assume that
it's being called in that context or be made something else than a
sysdev...
Regarding the possible down() if we walk through the irq_off device
list, well, that's indeed annoying, we probably need to pass a "no_lock"
argument. Never hit that one since as I told you, there are really few
if not no drivers using this facility of deferring suspend to after
interrupts are disabled. Also, the down there is harmless as in no
normal circumstances should it ever turn into a schedule() (there should
be no contention possible that late in the suspend process).
Ben.
^ permalink raw reply
* Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
From: Benjamin Herrenschmidt @ 2006-05-25 5:46 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, johannes, stern, cpufreq
In-Reply-To: <20060524223658.6fc797f5.akpm@osdl.org>
> This requirement to keep interrupts off in there breaks things again and
> again and again and again. And this time: again.
Where else ?
If you look at this function it's _designed_ for interrupts off ! the
driver suspend have the option of deferring their suspend() callback
until after irqs have been turned off (needed for legacy stuff afaik but
rarely used) and the sysdev's are very low level things whose suspend
and resume callbacks should be called after that point as well.
Ben.
^ permalink raw reply
* Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
From: Benjamin Herrenschmidt @ 2006-05-25 5:53 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev, johannes, stern, cpufreq
In-Reply-To: <1148535984.13249.253.camel@localhost.localdomain>
On Thu, 2006-05-25 at 15:46 +1000, Benjamin Herrenschmidt wrote:
> > This requirement to keep interrupts off in there breaks things again and
> > again and again and again. And this time: again.
>
> Where else ?
>
> If you look at this function it's _designed_ for interrupts off ! the
> driver suspend have the option of deferring their suspend() callback
> until after irqs have been turned off (needed for legacy stuff afaik but
> rarely used) and the sysdev's are very low level things whose suspend
> and resume callbacks should be called after that point as well.
BTW. The root of the problem with cpufreq is it's upside down design :)
Well, not all of it, but the fact that it registers a sysdev. It's not
the "midlayer" (ugh) business to register devices and hook things like
PM events to pass them down to actual drivers. It should be the cpufreq
drivers themselves that attach to the device model in a way or another
and "instanciate" the ability to control the cpu frequency, passing
along their struct device.
The driver itself should pick the right type of "device" to attach to
(sysdev's are just weird beast and were a bad idea in the first place
since they aren't even struct device).
But then, iirc, that's because we also did the cpu stuff in sysfs upside
down too ... :)
Now, wether the cpufreq notifier might end up calling things that will
sleep or not ... hrm... that's an interesting issue. Part of the problem
is that because cpufreq is a sysdev, it will be called so late in the
suspend process, pretty much everything else is asleep. So I'm quite
confident that things attaching to the cpufreq notifiers other than bits
of cpufreq itself are likely to break anyway. Is it documented anywhere
that registering a cpufreq notifier might cause it to be called in
atomic context or very later in the suspend process (possibly after the
interrupt controller hs been put down) ?
Yes it's messy, no I don't have a miracle solution, but I think here the
proper way to fix it in the long run is for cpufreq not to be a sysdev
or anything like that and to stop trying to do the suspend/resume thing
for the drivers. Drivers are in charge, they get to create the device of
whatever type it is and get the suspend/resume events whenever they are
sent. cpufreq can then provide maybe "helpers" to help work out what to
do at suspend and/or resume time but with the knowledge that for some
drivers maybe, this will happen in atomic context.
Ben.
^ permalink raw reply
* Re: RE: delay programming
From: hangtoo @ 2006-05-25 7:10 UTC (permalink / raw)
To: li yang-r58472; +Cc: linuxppc-embedded
[-- Attachment #1: Type: text/plain, Size: 998 bytes --]
hi,
yes,you are right.the usleep didn't give out accurate delay.so I make a delay funtion to fix it.
thank you for you help.:)
regards
tony
That depends on how accurate you want. Sleep() functions can't be too accurate
for Linux schedule characteristic. To get best accuracy, you can use hardware
timer. udelay() is a choice which reduces the overall system performance.
Best Regards,
Leo
> -----Original Message-----
> From: linuxppc-embedded-bounces+leoli=freescale.com@ozlabs.org
> [mailto:linuxppc-embedded-bounces+leoli=freescale.com@ozlabs.org] On Behalf
> Of tony
> Sent: Wednesday, May 24, 2006 5:24 PM
> To: linuxppc-embedded@ozlabs.org
> Subject: delay programming
>
>
> hi all
> I want to delay 1ms in the program,
> does usleep(1000) works accurate?
> any good idea?
>
> regards
> tony
>
>
> _______________________________________________
> Linuxppc-embedded mailing list
> Linuxppc-embedded@ozlabs.org
> https://ozlabs.org/mailman/listinfo/linuxppc-embedded
[-- Attachment #2: Type: text/html, Size: 1839 bytes --]
^ permalink raw reply
* Re: snd-aoa status update / automatic driver loading
From: Eddy Petrişor @ 2006-05-25 7:21 UTC (permalink / raw)
To: Johannes Berg, linuxppc-dev list, debian-powerpc
In-Reply-To: <20060523154137.GA3205@spring.luon.net>
T24gNS8yMy8wNiwgU2pvZXJkIFNpbW9ucyA8c2pvZXJkQHNwcmluZy5sdW9uLm5ldD4gd3JvdGU6
Cj4gT24gRnJpLCBNYXkgMTksIDIwMDYgYXQgMTE6MjA6MjlQTSArMTAwMCwgUGF1bCBDb2xsaW5z
IHdyb3RlOgo+ID4gSm9oYW5uZXMgQmVyZyA8am9oYW5uZXNAc2lwc29sdXRpb25zLm5ldD4gd3Jp
dGVzOgo+ID4KPiA+ID4gT24gVGh1LCAyMDA2LTA1LTE4IGF0IDEwOjI1ICswMzAwLCBFZGR5IFBl
dHJpPz9vciB3cm90ZToKPiA+ID4KPiA+ID4+IEFueSBjaGFuY2UgZm9yIDUsMiA/IFdoYXQgaXMg
bmVlZGVkIGZvciBpdD8gQ29kZWMgb25seT8KPiA+ID4KPiA+ID4gSSBkb24ndCBrbm93LiBJZiB5
b3UgdHJ5IGxvYWRpbmcgdGhlIG1vZHVsZXMsIHRoZSBrZXJuZWwgd2lsbCB0ZWxsIHlvdQo+ID4g
PiBzb21ldGhpbmcgYWJvdXQgYW4gdW5oYW5kbGVkIGxheW91dCBpZC4gQWx0ZXJuYXRpdmVseSwg
eW91IGNhbiBmaW5kIHRoZQo+ID4gPiBsYXlvdXQtaWQgZmlsZSBpbiB5b3VyIC9wcm9jL2Rldmlj
ZS10cmVlLyBhbmQgdGVsbCBtZSB0aGUgbnVtYmVyIGluIGl0Lgo+ID4gPiBUaGUgcmVzdCBJIGNh
biBmaWd1cmUgb3V0Lgo+Cj4gSSB3YW50ZWQgdG8gdGVzdCBvbiBteSBQb3dlckJvb2s1LDIuIFVo
Zm9ydHVuYXRlbHkgaSBjYW4ndCBmaW5kIG5vIGxheW91dC1pZAo+IGZpbGUgZm9yIHRoZSBzb3Vu
ZCBkZXZpY2Ugb3IgYW55IG90aGVyIGxheW91dC1pZCBmaWxlIGZvciB0aGF0IG1hdHRlcjoKClNh
bWUgbWFjaGluZSBoZXJlOyBJIGhhdmUgY2xvbmVkIHRoZSBhb2EgcmVwbyBhbmQgIm1hZGUiIGl0
LgpJbnNtb2QgZGlkbid0IHdvcmsgb24gYW55IG90aGVyIG1vZHVsZSBidXQgdGhlIHRoZSBzb3Vu
ZGJ1cywgYW5kCnJlc3VsdGVkIGluIGEgbWlzc2luZyBzeW1ib2wuCgpUaGlzIGlzIG9uIGEgMi4x
Ni4xNyBrZXJuZWwKCgotLSAKUmVnYXJkcywKRWRkeVAKPT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09CiJJbWFnaW5hdGlvbiBpcyBtb3JlIGltcG9ydGFudCB0aGFu
IGtub3dsZWRnZSIgQS5FaW5zdGVpbgo=
^ permalink raw reply
* Re: snd-aoa status update / automatic driver loading
From: Eddy Petrişor @ 2006-05-25 7:21 UTC (permalink / raw)
To: linuxppc-dev list, debian-powerpc
In-Reply-To: <60381eeb0605250021t17ff3299l74fc59993c683306@mail.gmail.com>
T24gNS8yNS8wNiwgRWRkeSBQZXRyacWfb3IgPGVkZHkucGV0cmlzb3JAZ21haWwuY29tPiB3cm90
ZToKPiBUaGlzIGlzIG9uIGEgMi4xNi4xNyBrZXJuZWwKCmVyciwgMi42LjE2LjE3CgotLSAKUmVn
YXJkcywKRWRkeVAKPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
CiJJbWFnaW5hdGlvbiBpcyBtb3JlIGltcG9ydGFudCB0aGFuIGtub3dsZWRnZSIgQS5FaW5zdGVp
bgo=
^ permalink raw reply
* Re: snd-aoa status update / automatic driver loading
From: Benjamin Herrenschmidt @ 2006-05-25 8:00 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev list, Benjamin Berg, debian-powerpc
In-Reply-To: <1148463777.11734.19.camel@johannes>
On Wed, 2006-05-24 at 11:42 +0200, Johannes Berg wrote:
> On Wed, 2006-05-24 at 08:15 +1000, Benjamin Herrenschmidt wrote:
> > > Right, that's how snd-powermac does it. It has the nasty side-effect of
> > > polluting the cache a lot though, since dbdma commands are 16 bytes
> > > long. Am I wrong?
> >
> > You don't have that much DBDMA commands that it would pollute the cache
> > _a lot_ :)
>
> Ah, yeah, I guess so. Well I do have 32 dbdma commands, them being
> spaced up in 16-bytes means 16 cachelines, no? I'm not sure how the
> cache is wired up ...
On a 32 bits CPU yes.
> > > Alsa calls this thing the 'pointer' :) The frame counter we currently
> > > use is the frame counter register of the i2s bus controller, and I don't
> > > see why we shouldn't do that instead of reading back all the dbdma
> > > command status fields.
> >
> > If you manage to have it properly in sync, that may work too.
>
> Seems to work fine so far, even if bcm43xx kills a few interrupts ;)
So it's bcm's fault ? Did you do a bit of analysis ? that would be
useful...
Ben.
^ permalink raw reply
* Re: snd-aoa status update / automatic driver loading
From: Johannes Berg @ 2006-05-25 9:42 UTC (permalink / raw)
To: Benjamin Herrenschmidt; +Cc: linuxppc-dev list, Benjamin Berg, debian-powerpc
In-Reply-To: <1148544004.13249.270.camel@localhost.localdomain>
[-- Attachment #1: Type: text/plain, Size: 471 bytes --]
On Thu, 2006-05-25 at 18:00 +1000, Benjamin Herrenschmidt wrote:
> So it's bcm's fault ? Did you do a bit of analysis ? that would be
> useful...
I kinda assumed the list was lagging again and my brother had already
posted the solution. Yes, bcm does some measuring stuff that keeps
interrupts disabled for lots of milliseconds (25 or something). It's
being fixed.
I still think, however, that we ought to be able to deal with lost
interrupts.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: snd-aoa status update / automatic driver loading
From: Johannes Berg @ 2006-05-25 9:43 UTC (permalink / raw)
To: Eddy Petrişor; +Cc: linuxppc-dev list, debian-powerpc
In-Reply-To: <60381eeb0605250021t17ff3299l74fc59993c683306@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
On Thu, 2006-05-25 at 10:21 +0300, Eddy Petrişor wrote:
> Same machine here; I have cloned the aoa repo and "made" it.
> Insmod didn't work on any other module but the the soundbus, and
> resulted in a missing symbol.
You probably forgot to load snd-pcm.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: PowerMac: force only suspend-to-disk to be valid
From: Johannes Berg @ 2006-05-25 10:05 UTC (permalink / raw)
To: linuxppc-dev list; +Cc: Andrew Morton
In-Reply-To: <1146562296.3858.9.camel@localhost>
[-- Attachment #1: Type: text/plain, Size: 1446 bytes --]
On Tue, 2006-05-02 at 11:31 +0200, Johannes Berg wrote:
> This patch adds the .valid callback to pm_ops on PowerMac so that only the
> suspend to disk state can be entered. Note that just returning 0 would
> suffice since the upper layers don't pass PM_SUSPEND_DISK down, but I think
> they ought to be passing it down since they do really need support (or
> am I mistaken again?) so we handle it there regardless.
No one ever seemed to care about this patch, can we queue it up for
2.6.18? I suppose it's too late now for 2.6.17 even if it fixes the
long-standing but that on ppc, /sys/power/state kills the machine.
[quoted patch for reference]
> --- wireless-dev.orig/arch/powerpc/platforms/powermac/setup.c 2006-05-02 10:57:32.101509438 +0200
> +++ wireless-dev/arch/powerpc/platforms/powermac/setup.c 2006-05-02 10:58:44.491509438 +0200
> @@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_
> return 0;
> }
>
> +static int pmac_pm_valid(suspend_state_t state)
> +{
> + switch (state) {
> + case PM_SUSPEND_DISK:
> + return 1;
> + /* can't do any other states via generic mechanism yet */
> + default:
> + return 0;
> + }
> +}
> +
> static struct pm_ops pmac_pm_ops = {
> .pm_disk_mode = PM_DISK_SHUTDOWN,
> .prepare = pmac_pm_prepare,
> .enter = pmac_pm_enter,
> .finish = pmac_pm_finish,
> + .valid = pmac_pm_valid,
> };
>
> #endif /* CONFIG_SOFTWARE_SUSPEND */
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* [snd] looking for layout-ids
From: Johannes Berg @ 2006-05-25 10:43 UTC (permalink / raw)
To: debian-powerpc; +Cc: linuxppc-dev list
[-- Attachment #1: Type: text/plain, Size: 1028 bytes --]
Hey,
In order to replace snd-powermac for the newer machines where the
'sound' node has the 'layout-id' property, I'm looking for testers on
machines that have a layout-id [1] property with one of the following
values: 0x24, 0x29, 0x33, 0x50 and 0x3a.
Once I have all these, I will, along with submitting snd-aoa [2], submit
a patch to snd-powermac that makes it refuse loading in presence of a
layout-id property as a first step to migrate to snd-aoa.
At the same time, I'll probably make i2sbus refuse attaching to a device
unless there's a layout-id property so that it doesn't claim devices aoa
doesn't handle yet.
johannes
[1] to find your layout-id, execute the following:
find /proc/device-tree/ -name layout-id | xargs hexdump -e '1/4 "0x%x\n"'
If you get no output, you have no layout-id property. If you do get
output, it will look like this:
0x46
This is the layout-id of your sound node.
[2] Before you ask: I will not do this before snd-aoa supports headphone
detection :)
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: [snd] looking for layout-ids
From: Andreas Schwab @ 2006-05-25 12:33 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev list, debian-powerpc
In-Reply-To: <1148553785.11759.12.camel@johannes.berg>
Johannes Berg <johannes@sipsolutions.net> writes:
> In order to replace snd-powermac for the newer machines where the
> 'sound' node has the 'layout-id' property, I'm looking for testers on
> machines that have a layout-id [1] property with one of the following
> values: 0x24
That would be mine, but it has the problem of the broken device tree, so
i2sbus doesn't work yet.
> [2] Before you ask: I will not do this before snd-aoa supports headphone
> detection :)
Another important feature would be DRC, IMHO.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply
* Re: [snd] looking for layout-ids
From: Johannes Berg @ 2006-05-25 12:37 UTC (permalink / raw)
To: Andreas Schwab; +Cc: linuxppc-dev list, debian-powerpc
In-Reply-To: <jefyiy9tds.fsf@sykes.suse.de>
[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]
> > In order to replace snd-powermac for the newer machines where the
> > 'sound' node has the 'layout-id' property, I'm looking for testers on
> > machines that have a layout-id [1] property with one of the following
> > values: 0x24
>
> That would be mine, but it has the problem of the broken device tree, so
> i2sbus doesn't work yet.
Ah, right. I'll have to check with Ben a bit more when he comes back. He
seemed to have half of a plan ;)
> > [2] Before you ask: I will not do this before snd-aoa supports headphone
> > detection :)
>
> Another important feature would be DRC, IMHO.
Yeah, I guess, but that's only doable with the tas codec. I don't think
it's hard, if anyone wnats to try: the tas datasheet is in my
repository, and all you need to do is modify the tas codec to show the
controls for that. Could also use some bass/treble controls.
If we want DRC even for the other machines, that's an alsa userspace
thing since it needs a soft-DSP then.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: [snd] looking for layout-ids
From: Johannes Berg @ 2006-05-25 12:41 UTC (permalink / raw)
To: Ken Moffat; +Cc: linuxppc-dev list, debian-powerpc
In-Reply-To: <20060525123247.GA19308@deepthought.linux.bogus>
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
Hey,
> How about 0x3c and 0x3d (PowerMac9,1) ? I can't see anything in
> snd-aoa-fabric-layout that matches 60 or 61. I last tried to play
> with this a few weeks ago, but gave up with what I assumed were
> config problems (undefined symbols) and had too many other things to
> get on with.
undefined symbols are usually because alsa isn't configured, or snd-pcm
isn't loaded.
> Certainly, this is one of the machines where loading snd-powermac
> is catastrophic.
Catastrophic? How so? Anyway, I don't care much :)
Anyway, if you want to give it a spin, try the latest snd-aoa (see
http://johannes.sipsolutions.net/Projects/snd-aoa/ for a description).
It should report an unknown layout, which are those two ones you
described above. I think you probably have a tas and topaz combination,
so if you get i2sbus to load, I might be able to give you a patch to
test.
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: CPU 1 refused to die!
From: Giuliano Pochini @ 2006-05-25 12:46 UTC (permalink / raw)
To: Nathan Lynch; +Cc: LinuxPPC-dev
In-Reply-To: <20060523225113.GD11414@localdomain>
On 23-May-2006 Nathan Lynch wrote:
> Giuliano Pochini wrote:
>>
>> I booted with maxcpus=1, then I enabled the 2nd cpu
>> with echo 1 > /sys/devices/system/cpu/cpu1/online
>
> So onlining at runtime seems to work. Did you verify that tasks get
> run on the 2nd cpu after you online it?
Yes, I did, and the difference in speed is pretty obvious.
> Any other strange messages in dmesg?
Nothing unusual.
> Can you online and offline cpus if you boot without maxcpus=1?
It behaves exactly the same. I can't say exactly when it stopped
working. 2.6.14 worked fine.
--
Giuliano.
^ permalink raw reply
* Re: [snd] looking for layout-ids
From: Paul Collins @ 2006-05-25 13:43 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev list, debian-powerpc
In-Reply-To: <1148553785.11759.12.camel@johannes.berg>
Johannes Berg <johannes@sipsolutions.net> writes:
> Hey,
>
> In order to replace snd-powermac for the newer machines where the
> 'sound' node has the 'layout-id' property, I'm looking for testers on
> machines that have a layout-id [1] property with one of the following
> values: 0x24, 0x29, 0x33, 0x50 and 0x3a.
0x33 here.
--
Dag vijandelijk luchtschip de huismeester is dood
^ permalink raw reply
* Re: PowerMac: force only suspend-to-disk to be valid
From: Andrew Morton @ 2006-05-25 14:05 UTC (permalink / raw)
To: Johannes Berg; +Cc: linuxppc-dev
In-Reply-To: <1148551527.11759.10.camel@johannes.berg>
Johannes Berg <johannes@sipsolutions.net> wrote:
>
> On Tue, 2006-05-02 at 11:31 +0200, Johannes Berg wrote:
> > This patch adds the .valid callback to pm_ops on PowerMac so that only the
> > suspend to disk state can be entered. Note that just returning 0 would
> > suffice since the upper layers don't pass PM_SUSPEND_DISK down, but I think
> > they ought to be passing it down since they do really need support (or
> > am I mistaken again?) so we handle it there regardless.
>
> No one ever seemed to care about this patch,
I don't recall having seen it before.
> can we queue it up for
> 2.6.18? I suppose it's too late now for 2.6.17 even if it fixes the
> long-standing but that on ppc, /sys/power/state kills the machine.
>
> [quoted patch for reference]
>
> > --- wireless-dev.orig/arch/powerpc/platforms/powermac/setup.c 2006-05-02 10:57:32.101509438 +0200
> > +++ wireless-dev/arch/powerpc/platforms/powermac/setup.c 2006-05-02 10:58:44.491509438 +0200
> > @@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_
> > return 0;
> > }
> >
> > +static int pmac_pm_valid(suspend_state_t state)
> > +{
> > + switch (state) {
> > + case PM_SUSPEND_DISK:
> > + return 1;
> > + /* can't do any other states via generic mechanism yet */
> > + default:
> > + return 0;
> > + }
> > +}
> > +
> > static struct pm_ops pmac_pm_ops = {
> > .pm_disk_mode = PM_DISK_SHUTDOWN,
> > .prepare = pmac_pm_prepare,
> > .enter = pmac_pm_enter,
> > .finish = pmac_pm_finish,
> > + .valid = pmac_pm_valid,
> > };
> >
> > #endif /* CONFIG_SOFTWARE_SUSPEND */
>
It looks like a 2.6.17 patch to me. If someone wants to send it over with
changelog, signed-off-by, etc I can take care of it.
^ permalink raw reply
* Re: PowerMac: force only suspend-to-disk to be valid
From: Andrew Morton @ 2006-05-25 14:10 UTC (permalink / raw)
To: johannes, linuxppc-dev, benh
In-Reply-To: <20060525070558.2b7e24cd.akpm@osdl.org>
Andrew Morton <akpm@osdl.org> wrote:
>
> > > +static int pmac_pm_valid(suspend_state_t state)
> > > +{
> > > + switch (state) {
> > > + case PM_SUSPEND_DISK:
> > > + return 1;
> > > + /* can't do any other states via generic mechanism yet */
> > > + default:
> > > + return 0;
> > > + }
> > > +}
> > > +
> > > static struct pm_ops pmac_pm_ops = {
> > > .pm_disk_mode = PM_DISK_SHUTDOWN,
> > > .prepare = pmac_pm_prepare,
> > > .enter = pmac_pm_enter,
> > > .finish = pmac_pm_finish,
> > > + .valid = pmac_pm_valid,
> > > };
> > >
> > > #endif /* CONFIG_SOFTWARE_SUSPEND */
> >
>
> It looks like a 2.6.17 patch to me. If someone wants to send it over with
> changelog, signed-off-by, etc I can take care of it.
>
Please also explain whether this fix is needed in 2.6.16.x.
^ permalink raw reply
* [PATCH] PowerMac: force only suspend-to-disk to be valid
From: Johannes Berg @ 2006-05-25 14:11 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev list
This patch adds the .valid callback to pm_ops on PowerMac so that only the
suspend to disk state can be entered. Note that just returning 0 would
suffice since the upper layers don't pass PM_SUSPEND_DISK down, but we
handle it there regardless just in case that changes.
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
--- wireless-dev.orig/arch/powerpc/platforms/powermac/setup.c 2006-05-02 10:57:32.101509438 +0200
+++ wireless-dev/arch/powerpc/platforms/powermac/setup.c 2006-05-02 10:58:44.491509438 +0200
@@ -463,11 +463,23 @@ static int pmac_pm_finish(suspend_state_
return 0;
}
+static int pmac_pm_valid(suspend_state_t state)
+{
+ switch (state) {
+ case PM_SUSPEND_DISK:
+ return 1;
+ /* can't do any other states via generic mechanism yet */
+ default:
+ return 0;
+ }
+}
+
static struct pm_ops pmac_pm_ops = {
.pm_disk_mode = PM_DISK_SHUTDOWN,
.prepare = pmac_pm_prepare,
.enter = pmac_pm_enter,
.finish = pmac_pm_finish,
+ .valid = pmac_pm_valid,
};
#endif /* CONFIG_SOFTWARE_SUSPEND */
^ permalink raw reply
* Re: PowerMac: force only suspend-to-disk to be valid
From: Johannes Berg @ 2006-05-25 14:13 UTC (permalink / raw)
To: Andrew Morton; +Cc: linuxppc-dev
In-Reply-To: <20060525071013.21379ba8.akpm@osdl.org>
[-- Attachment #1: Type: text/plain, Size: 319 bytes --]
On Thu, 2006-05-25 at 07:10 -0700, Andrew Morton wrote:
> Please also explain whether this fix is needed in 2.6.16.x.
Well, for a very long time, echoing 'standby' or 'mem'
into /sys/power/state has killed the machine on powerpc. This patch
fixes that. So I guess yes, it is applicable to 2.6.16.x
johannes
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 793 bytes --]
^ permalink raw reply
* Re: [Fwd: Re: via-pmu runs device_power_down in atomic context]
From: Alan Stern @ 2006-05-25 14:12 UTC (permalink / raw)
To: Andrew Morton; +Cc: cpufreq, Johannes Berg, linuxppc-dev
In-Reply-To: <20060524215917.230af218.akpm@osdl.org>
On Wed, 24 May 2006, Andrew Morton wrote:
> > device_power_down should be called with interrupts off, thus the PMU
> > driver is fine. It's a misnamed function, it calls the sysdev's suspend
> > and those should be called with irq off. I think the problem is more due
> > to some cpufreq or notifier change that somebody done to recent kernels
> > and that added some might_sleep.... I wonder why.
> >
> > Andrew, what's up there ? What is this new
> > "blocking_notifier_call_chain" thing ? notifiers use to not use
> > semaphores and not be blocking... at least powermac implementation of
> > cpufreq relies on that.
>
> notifiers used to be racy too - we just waddled across them without any
> locking.
>
> Alan made a best-effort conversion of callers, and there have been a few
> problems.
>
> Here, pmac has gone and unilaterally decided that device_power_down() is
> atomic, even though device_power_down() _already_ calls suspend_device(),
> which does down(). So I'd say you've gone and found a via-pmu bug here.
>
> A way of shutting up the warning would be to use an atomic notifier, but
> it'll still be buggy. Better would be to teach pmac_suspend_devices() not
> to assume things which aren't true ;)
Someone else had a problem with the cpufreq conversion earlier. I posted
a message on the cpufreq mailing list but nobody ever responded to it.
This may or may not be related to that earlier problem.
In essence, the problem seemed to be that the cpufreq notifier chain is
sometimes expected to be blocking and sometimes expected to be atomic,
based on the "val" code passed to notifier_call_chain. The cleanest
solution would be to split the single notifier chain into two chains,
one always blocking and the other always atomic.
Somebody who knows more about cpufreq than I do will have to make that
change.
Alan Stern
^ 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