From patchwork Fri May 19 10:55:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Jiada" X-Patchwork-Id: 9736885 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2B51C601C2 for ; Fri, 19 May 2017 10:56:03 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BB0828788 for ; Fri, 19 May 2017 10:56:03 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E8DE288C4; Fri, 19 May 2017 10:56:03 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2CE628788 for ; Fri, 19 May 2017 10:56:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750828AbdESK4B (ORCPT ); Fri, 19 May 2017 06:56:01 -0400 Received: from relay1.mentorg.com ([192.94.38.131]:64136 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750805AbdESK4B (ORCPT ); Fri, 19 May 2017 06:56:01 -0400 Received: from svr-orw-mbx-03.mgc.mentorg.com ([147.34.90.203]) by relay1.mentorg.com with esmtp id 1dBfZf-0004Id-Go from Jiada_Wang@mentor.com ; Fri, 19 May 2017 03:55:59 -0700 Received: from [192.168.109.129] (147.34.91.1) by svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) with Microsoft SMTP Server (TLS) id 15.0.1210.3; Fri, 19 May 2017 03:55:56 -0700 Message-ID: <591ECF3B.4040001@mentor.com> Date: Fri, 19 May 2017 03:55:55 -0700 From: Jiada Wang User-Agent: Mozilla/5.0 (X11; Linux i686; rv:11.0) Gecko/20120411 Thunderbird/11.0.1 MIME-Version: 1.0 To: Fabio Estevam CC: Leonard Crestez , Fabio Estevam , "linux-spi@vger.kernel.org" , Mark Brown Subject: Re: [PATCH] spi: imx: Revert "spi: imx: dynamic burst length adjust for PIO mode" References: <1495113735-11891-1-git-send-email-fabio.estevam@nxp.com> <1495115958.26925.23.camel@nxp.com> <591DBFD2.4090601@mentor.com> In-Reply-To: X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) To svr-orw-mbx-03.mgc.mentorg.com (147.34.90.203) Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello Fabio Although I don't have this spi-nor chip populated on my sabresd, but I think I managed to re-create similar scenario, could you help to check if the following change address the spi-nor detection issue } @@ -288,6 +289,9 @@ static void spi_imx_u32_swap_u8(struct spi_transfer *transfer, u32 *buf) { int i; + if (!buf) + return; + for (i = 0; i < transfer->len / 4; i++) *(buf + i) = cpu_to_be32(*(buf + i)); } @@ -296,6 +300,9 @@ static void spi_imx_u32_swap_u16(struct spi_transfer *transfer, u32 *buf) { int i; + if (!buf) + return; + for (i = 0; i < transfer->len / 4; i++) { Thanks, Jiada On 05/18/2017 08:41 AM, Fabio Estevam wrote: > Hi Jiada, > > On Thu, May 18, 2017 at 12:37 PM, Jiada Wang wrote: > >> Which kernel and HW version are you using for test? > I am running linux-next 20170518 on a imx6q sabresd revB board. > >> with the test on my imx6q sabresd board, >> no matter using upstream kernel or our internal kernel, >> the issue exists with or without the patch. > There are some imx6q sabresd boards that does not come with the SPI > NOR flash populated. > > I assume your board does not have the SPI NOR populated, so that's why > you always get the same message. > > Reverting 8d4a6cad7adb ("spi: imx: dynamic burst length adjust for PIO > mode") makes the SPI NOR to work again here. Tested-by: Fabio Estevam --- To unsubscribe from this list: send the line "unsubscribe linux-spi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/spi/spi-imx.c b/drivers/spi/spi-imx.c index 782045f..a097a8d 100644 --- a/drivers/spi/spi-imx.c +++ b/drivers/spi/spi-imx.c @@ -242,6 +242,7 @@ static bool spi_imx_can_dma(struct spi_master *master, struct spi_device *spi, return false; spi_imx->wml = i; + spi_imx->dynamic_burst = 0; return true;