linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Anton Vorontsov <cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Joakim Tjernlund
	<joakim.tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: Re: [PATCH] spi: spi_mpc8xxx.c: fix potential memory corruption.
Date: Wed, 12 May 2010 20:43:21 +0400	[thread overview]
Message-ID: <20100512164321.GA5522@oksana.dev.rtsoft.ru> (raw)
In-Reply-To: <OFB1D6A895.8E381278-ONC1257721.005A1E7B-C1257721.005A885D-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>

On Wed, May 12, 2010 at 06:28:51PM +0200, Joakim Tjernlund wrote:
> Anton Vorontsov <cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote on 2010/05/12 18:22:31:
> >
> > On Wed, May 12, 2010 at 05:50:50PM +0200, Joakim Tjernlund wrote:
> > > tx_dma/rx_dma are already set to a dummy buffer when no
> > > tx/rx buffer and t->tx_dma/t->rx_dma does not contain a dma
> > > address, but NULL.
> > > This may lead to corruption of kernel memory. Fix this by
> > > leaving tx_dma/rx_dma alone.
> > >
> > > Do not INIT_TX_RX while controller is enabled, this is bad according
> > > to the MPC8321 manual.
> > >
> > > Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
> >
> > Acked-by: Anton Vorontsov <cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> >
> > Thanks!
> :)
> 
> Who will make sure this goes to Linus?

I guess it's Grant. Cc'ed.

>  Jocke
> 
> BTW, I am having another problem too. An ADC doesn't work when in QE/CPM mode(CPU mode is fine)
> The only thing I can think of ATM is if word size is handled differently? We
> are using 16 bits words.

No idea. Have you tried loopback mode? Create a dummy spidev
device, and try Documentation/spi/spidev_test.c's --loop switch.

Personally I tested QE/CPM mode with M25Pxx flashes. IIRC, I
also tested it with the spi_mmc driver on MPC8323E-RDB board.
Both drivers work with 8 bits words.

-- 
Anton Vorontsov
email: cbouatmailru-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
irc://irc.freenode.net/bd2

------------------------------------------------------------------------------

  parent reply	other threads:[~2010-05-12 16:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-12 15:50 [PATCH] spi: spi_mpc8xxx.c: fix potential memory corruption Joakim Tjernlund
     [not found] ` <1273679450-4185-1-git-send-email-Joakim.Tjernlund-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2010-05-12 16:22   ` Anton Vorontsov
     [not found]     ` <20100512162231.GA449-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
2010-05-12 16:28       ` Joakim Tjernlund
     [not found]         ` <OFB1D6A895.8E381278-ONC1257721.005A1E7B-C1257721.005A885D-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2010-05-12 16:43           ` Anton Vorontsov [this message]
     [not found]             ` <20100512164321.GA5522-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
2010-05-13  7:53               ` Joakim Tjernlund
2010-05-13  9:36               ` Joakim Tjernlund
     [not found]                 ` <OFD4A1BD4A.1E890808-ONC1257722.00336F58-C1257722.0034C1F5-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2010-05-13  9:55                   ` Anton Vorontsov
     [not found]                     ` <20100513095545.GA11506-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
2010-05-13 12:33                       ` Joakim Tjernlund
2010-05-13 13:50                       ` Joakim Tjernlund
2010-05-13 15:55                       ` Joakim Tjernlund
     [not found]                         ` <OF224832EB.3B3694C0-ONC1257722.00574009-C1257722.00577791-SNLAxHN9vbcOP4wsBPIw7w@public.gmane.org>
2010-05-13 16:18                           ` Anton Vorontsov
     [not found]                             ` <20100513161851.GA23404-wnGakbxT3iijyJ0x5qLZdcN33GVbZNy3@public.gmane.org>
2010-05-13 19:47                               ` Joakim Tjernlund
2010-05-13 21:13               ` Grant Likely
     [not found]                 ` <AANLkTillcDbtpIcq7ZYID9xBpHuGfcBQNNSZJFuyqHYM-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-05-14 12:30                   ` Joakim Tjernlund

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=20100512164321.GA5522@oksana.dev.rtsoft.ru \
    --to=cbouatmailru-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=joakim.tjernlund-SNLAxHN9vbcOP4wsBPIw7w@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 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).