From mboxrd@z Thu Jan 1 00:00:00 1970 From: Vignesh R Subject: Re: [RFC PATCH 6/6] spi: Get rid of the spi_flash_read() API Date: Fri, 16 Feb 2018 15:51:00 +0530 Message-ID: <674d7b22-a3ac-e812-04db-aa0acb1671b0@ti.com> References: <20180205232120.5851-1-boris.brezillon@bootlin.com> <20180205232120.5851-7-boris.brezillon@bootlin.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Cc: Peter Pan , Frieder Schrempf , Yogesh Gaur , =?UTF-8?B?UmFmYcWCIE1pxYJlY2tp?= , Kamal Dasu To: Boris Brezillon , David Woodhouse , Brian Norris , Boris Brezillon , Marek Vasut , Richard Weinberger , Cyrille Pitchen , , Mark Brown , Return-path: In-Reply-To: <20180205232120.5851-7-boris.brezillon-LDxbnhwyfcJBDgjK7y7TUQ@public.gmane.org> Content-Language: en-US Sender: linux-spi-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Hi Boris, On Tuesday 06 February 2018 04:51 AM, Boris Brezillon wrote: > From: Boris Brezillon > > This API has been replaced by the spi_mem_xx() one, its only user > (spi-nor) has been converted to spi_mem_xx() and all SPI controller > drivers that were implementing the ->spi_flash_xxx() hooks are also > implementing the spi_mem ones. So we can safely get rid of this API. > > Signed-off-by: Boris Brezillon > --- > drivers/spi/spi-ti-qspi.c | 41 --------------------------------- > -static bool ti_qspi_spi_flash_can_dma(struct spi_device *spi, > - struct spi_flash_read_message *msg) > -{ > - return virt_addr_valid(msg->buf); > -} > - This causes kernel crash because spi_map_buf() now tries to map vmalloc'd buffers in LPAE backed memory not accessible by 32bit DMA: ubiattach -p /dev/mtd9 [ 114.482439] Unable to handle kernel paging request at virtual address bf867000 [ 114.489689] pgd = 045b2870 [ 114.492403] [bf867000] *pgd=ad22c003, *pmd=00000000 [ 114.497309] Internal error: Oops: 2a06 [#1] PREEMPT SMP ARM [ 114.502903] Modules linked in: ecdh_generic extcon_usb_gpio omap_aes_driver omap_sham omap_des des_generic crypto_engine omap_crypto [ 114.514894] CPU: 1 PID: 1862 Comm: ubiattach Not tainted 4.16.0-rc1-next-20180212-00009-gbaa4bd31694e-dirty #16 [ 114.525023] Hardware name: Generic DRA74X (Flattened Device Tree) [ 114.531145] PC is at v7_dma_inv_range+0x30/0x48 [ 114.535693] LR is at dma_cache_maint_page+0x110/0x124 [ 114.540763] pc : [] lr : [] p We need ->can_dma like interface in spi_controller_mem_ops to prevent such buffers being mapped for certain SoCs. Or SPI NOR framework needs to use bounce buffers. -- Regards Vignesh -- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org More majordomo info at http://vger.kernel.org/majordomo-info.html