From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anton Vorontsov Subject: Re: [PATCH] spi: spi_mpc8xxx.c: fix potential memory corruption. Date: Wed, 12 May 2010 20:43:21 +0400 Message-ID: <20100512164321.GA5522@oksana.dev.rtsoft.ru> References: <1273679450-4185-1-git-send-email-Joakim.Tjernlund@transmode.se> <20100512162231.GA449@oksana.dev.rtsoft.ru> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: spi-devel-general-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Joakim Tjernlund Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: spi-devel-general-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: linux-spi.vger.kernel.org On Wed, May 12, 2010 at 06:28:51PM +0200, Joakim Tjernlund wrote: > Anton Vorontsov 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 > > > > Acked-by: Anton Vorontsov > > > > 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 ------------------------------------------------------------------------------