All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Ribeiro <drwyrm-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Ned Forrester <nforrester-/d+BM93fTQY@public.gmane.org>
Cc: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>,
	spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: pxa2xx_spi suspend/resume
Date: Fri, 13 Mar 2009 06:11:01 -0300	[thread overview]
Message-ID: <1236935461.623.38.camel@brutus> (raw)
In-Reply-To: <49B9D47C.8050105-/d+BM93fTQY@public.gmane.org>

Em Qui, 2009-03-12 às 23:35 -0400, Ned Forrester escreveu:
> Hmmm... This looks scary.  If the DRCMR registers went to zero, what
> else has changed in the DMA setup?  A call to pxa2xx_spi_remove() would
> have cleared these, but that should not be called for suspend/resume.
> Have you checked all the other DMA related registers that are assigned
> to the SSP device?  Are these the only ones that are anomalous, or are
> these just the first ones you found?
> 
> Actually, I don't think there are any other registers, save the ones
> that will be set up by pump_transfers(), anyway.  The PXA270 has a few
> more DMA related registers than the PXA255, but I don't see anything
> that looks like trouble, other than what you found above.

Everything else is OK. DRCMR is the only thing that gets nuked and is
not restored by pump_transfers().

> I would not jump to the conclusion (perhaps you haven't, but I don't
> have the whole picture) that we just need to restore these two
> registers.  You need to make sure that the assigned DMA channels are
> still allocated.  I wonder what process cleared these registers and what
> that might mean about the possibility that DMA channel assignments were
> purged on resume.

Currently i am restoring them to their probe() values on resume(), only
if rx_channel and tx_channel are != -1 (dma enabled). It seems to be
working fine. Im not sure if this is all that is needed, but i suspect
its enough.

And i think that its not software that is nuking DRCMR, as i said on a
previous email, i dont need to restore DRCMR if i use the "core" pm_test
mode. (the core pm_test executes the suspend/resume routines just as if
it was a normal suspend/resume, the only difference is that PXA will not
be really suspend).

There is still a chance that my bootloader is nuking these registers on
resume before giving control to kernel, i will check the bootloader code
and see if this is the case. I suspect it isn't.

> You could try a patch to restore DRCMR registers to see if that fixes
> the problem or just makes things worse.  I don't recommend submitting
> such a patch without guidance from someone more knowledgeable about DMA
> and suspend/resume.

It fixes the problem here, im not sure if its all that is needed, so,
lets wait for more comments on this before i submit the patch.

> In the process of searching for inspiration on this matter, I was
> reminded of another poster who has tried getting suspend/resume to work.
>  I don't think that the thread:

I googled the ML archives before posting and found this thread. And
altough it has the same symptoms, i think it may be a different problem.
I discarded his fix proposal at the first debug run, because my SSP
registers are exactly what i expected on resume(), and exactly the same
as they were on suspend().

-- 
Daniel Ribeiro


------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
spi-devel-general mailing list
spi-devel-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/spi-devel-general

  parent reply	other threads:[~2009-03-13  9:11 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-11 11:30 pxa2xx_spi suspend/resume Daniel Ribeiro
2009-03-11 13:53 ` Ned Forrester
     [not found]   ` <49B7C260.40906-/d+BM93fTQY@public.gmane.org>
2009-03-11 12:09     ` Daniel Ribeiro
2009-03-11 12:59     ` Daniel Ribeiro
2009-03-12 14:38 ` Ned Forrester
     [not found]   ` <49B91E76.3090309-/d+BM93fTQY@public.gmane.org>
2009-03-12 17:47     ` Daniel Ribeiro
2009-03-13  3:35       ` Ned Forrester
     [not found]         ` <49B9D47C.8050105-/d+BM93fTQY@public.gmane.org>
2009-03-13  9:11           ` Daniel Ribeiro [this message]
2009-03-13 13:32             ` Ned Forrester
     [not found]               ` <49BA607A.5020509-/d+BM93fTQY@public.gmane.org>
2009-03-14  4:08                 ` Daniel Ribeiro

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=1236935461.623.38.camel@brutus \
    --to=drwyrm-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org \
    --cc=nforrester-/d+BM93fTQY@public.gmane.org \
    --cc=spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.