linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Martin Diehl <mdiehlcs@compuserve.de>
To: Linus Torvalds <torvalds@transmeta.com>
Cc: Kai Germaschewski <kai@thphy.uni-duesseldorf.de>,
	"Adam J. Richter" <adam@yggdrasil.com>, Martin Mares <mj@suse.cz>,
	Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: PCI irq routing..
Date: Thu, 7 Dec 2000 19:30:40 +0100 (CET)	[thread overview]
Message-ID: <Pine.LNX.4.21.0012070023560.438-100000@notebook.diehl.home> (raw)
In-Reply-To: <Pine.LNX.4.10.10012060939240.1611-100000@penguin.transmeta.com>


On Wed, 6 Dec 2000, Linus Torvalds wrote:

> On Wed, 6 Dec 2000, Martin Diehl wrote:
> > 
> [Cardbus config space lost after APM suspend/resume]
> 
> Can you remind me in a day or two if I haven't gotten back to you? I don't
> have any machines that need this, but I've seen ones that do, and if
> you're willing to test..

sure, will to do testing (and reminding ;-)

> Yes, this is expected for routers that we don't know about: we will still
> use the irq that the device claims it has, but we will obviously fail to
> try to route it (but it still works if the BIOS had already routed it -
> which is how the old code always worked anyway).

btw, I'm thinking I could guess the routing from the VLSI config space,
but I don't have any doc's. Would it be worth to try to add some specific
get/set methods for this device? What about testers (or people who have
access to the docs)?

> Anyway, for the suspend-resume thing, if you want to go ahead on your own
> without a real patch from me, the fix is along the lines of

well, took me some time to follow all the paths thru cardbus/pcmcia stuff
wrt suspend/resume from pm - but ended up at:

>  - add two functions:
> 
> 	static void yenta_save_config(pci_socket_t *socket)
> 	static void yenta_restore_config(pci_socket_t *socket)

That's the crucial point, imho. The PCI layer forwards the PM events to
the cardbus-driver's suspend/resume methods, which are calling 
pcmcia_suspend/resume_socket(). The latter in turn will call back the
appropriate yenta_operations which are registered to it. So much for sure.

However, there is no pcmcia_resume path forwarded to yenta since the
traditional pccard_operations did not provide such a method and pcmcia
simply re-initialized it's sockets. My assumption is, you haven't meant
to add a do-nothing resume to all the pcmcia-stuff (including i82365,
tcic) just to allow yenta to register for a resume operation which would
be there for cardbus only.
So my suggestion is to have cardbus_save/restore_config() exactly doing
what you've said for yenta_*.

>  - do a "yenta_save_config()" in "yenta_suspend()" and a
>    "yenta_restore_config()" at the top of "yenta_resume()"

yenta_resume() does not exist.
yenta_*() replaced by cardbus_*() as explained.

>  - test. Also test with the "pci_set_power_state(3)" in suspend enabled,
>    because it may/should actually work with that enabled too.

same point: pci_set_power_state(3) should go to cardbus_suspend(), not
yenta.

A first try of this ended oopsing at pm suspend somewhere below
pci_pm_*(). It turned out the reason was the cardbus_suspend() (and resume
too) method which was *invoked several times* in a row!

The reason for this is in drivers/pci.c where bridges are touched
twice: once as a device on a bus and once via ->self from the bus behind.
I'm not sure whether this is the intended behavior - but it definitely
calls cardbus_suspend/resume() twice which breaks when forwarding to
pcmcia_suspend/resume_socket().

So I've tentatively worked around using a "once" flag added to
pci_socket_t. This solves the problems during suspend/resume and the
cardbus' config space appears to be restored as intended - good.

The bad news however is, the sockets are still broken after
resume. Unfortunately there are several candidates I've spotted:

- calling yenta_init() stuff at resume - is this sufficient?
  Probably we have to forward the pm-triggered resume from pm along
  pci -> cardbus -> pcmcia -> yenta (last link currently missed,
  because the pcmcia layer switches from incoming resume notification
  to init path)

- some content of the mem/io regions might need to be preserved

- some TI1131 oddity wrt to CSC-INT's - requested IRQ's show up correctly
  in /proc/interrupts and are properly triggered and handled at card
  insert/eject. But after pm suspend/resume the box freezed when inserting
  or ejecting the cards (no response to SysRq anymore).

I'll try to continue on this.

Regards
Martin

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

  reply	other threads:[~2000-12-07 19:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <Pine.LNX.4.30.0012052110590.968-100000@localhost.localdomain>
2000-12-05 23:04 ` PCI irq routing Linus Torvalds
2000-12-05 23:25   ` Kai Germaschewski
2000-12-06  9:29   ` Martin Diehl
2000-12-06 17:49     ` Linus Torvalds
2000-12-07 18:30       ` Martin Diehl [this message]
2000-12-07 18:38         ` Linus Torvalds
2000-12-08  0:49           ` Martin Diehl
2000-12-11  1:46           ` [PATCH] VLSI irq router (was: PCI irq routing..) Martin Diehl
2000-12-15 18:39           ` yenta, pm, ioremap(!) problems " Martin Diehl
2000-12-15 18:55             ` Linus Torvalds
2000-12-16  0:21               ` Martin Diehl
2000-12-18 13:08               ` [PATCH] yenta, pm - part 1 Martin Diehl
2000-12-18 13:10               ` [PATCH] yenta, pm - part 2 Martin Diehl
     [not found] <20001130093428.A6326@atrey.karlin.mff.cuni.cz>
2000-12-12  1:15 ` PCI irq routing Linus Torvalds
2000-12-12  1:52 davej

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=Pine.LNX.4.21.0012070023560.438-100000@notebook.diehl.home \
    --to=mdiehlcs@compuserve.de \
    --cc=adam@yggdrasil.com \
    --cc=kai@thphy.uni-duesseldorf.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mj@suse.cz \
    --cc=torvalds@transmeta.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 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).