From patchwork Mon Aug 3 04:44:21 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 6927071 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id CAEAA9F373 for ; Mon, 3 Aug 2015 04:51:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CA37A2051D for ; Mon, 3 Aug 2015 04:51:31 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CC9942050E for ; Mon, 3 Aug 2015 04:51:30 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZM7fs-0004qM-Do; Mon, 03 Aug 2015 04:48:32 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZM7fq-0004pu-3R for linux-arm-kernel@bombadil.infradead.org; Mon, 03 Aug 2015 04:48:30 +0000 Received: from smtp10.smtpout.orange.fr ([80.12.242.132] helo=smtp.smtpout.orange.fr) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZM7fl-0007lR-Uf for linux-arm-kernel@lists.infradead.org; Mon, 03 Aug 2015 04:48:27 +0000 Received: from belgarion ([109.214.23.104]) by mwinf5d20 with ME id 04nt1r00P2El94l034nu9M; Mon, 03 Aug 2015 06:47:59 +0200 X-ME-Helo: belgarion X-ME-Auth: amFyem1pay5yb2JlcnRAb3JhbmdlLmZy X-ME-Date: Mon, 03 Aug 2015 06:47:59 +0200 X-ME-IP: 109.214.23.104 From: Robert Jarzmik To: Ezequiel Garcia Subject: Re: [PATCH v2 0/4] mtd: pxa3xx_nand: rework the timing setup References: <1436281707-20106-1-git-send-email-antoine.tenart@free-electrons.com> <20150717134159.GC10608@kwain> <55A912F0.7080605@vanguardiasur.com.ar> <87h9p2is8e.fsf@belgarion.home> <87wpxufw2v.fsf@belgarion.home> X-URL: http://belgarath.falguerolles.org/ Date: Mon, 03 Aug 2015 06:44:21 +0200 In-Reply-To: (Ezequiel Garcia's message of "Sun, 2 Aug 2015 23:49:55 -0300") Message-ID: <87si81m15m.fsf@belgarion.home> User-Agent: Gnus/5.130008 (Ma Gnus v0.8) Emacs/24.4 (gnu/linux) MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150803_004826_390041_81742B9C X-CRM114-Status: GOOD ( 24.41 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: zmxu@marvell.com, Boris Brezillon , Antoine Tenart , "linux-kernel@vger.kernel.org" , "linux-mtd@lists.infradead.org" , jszhang@marvell.com, Brian Norris , David Woodhouse , linux-arm-kernel , Sebastian Hesselbarth Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Ezequiel Garcia writes: > Just tested linux-next (hence *without* the patchset) and I see > the same "Wait time out". In other words, pxa3xx-nand is broken > on PXA :/ > > Interestingly, the culprit doesn't seem to be in pxa3xx-nand itself. > Reverting the recent commits on pxa3xx-nand doesn't help. > > ce914e6 mtd: nand: pxa3xx: fix build on ARM64 > afca11e mtd: nand: pxa3xx: Switch FIFO draining to jiffies-based timeout > e5860c1 mtd: pxa3xx_nand: cleanup wait_for_completion handling > 7c2f717 mtd: pxa3xx_nand: initialiaze pxa3xx_flash_ids to 0 > ed446cc Merge MTD updates into -next > e423c90 mtd: pxa3xx_nand: fix driver when num_cs is 0 > 2454225 mtd: pxa3xx-nand: handle PIO in threaded interrupt > 8dad038 mtd: nand: pxa3xx: Fix PIO FIFO draining > b7e46062 mtd: pxa3xx_nand: make the driver work on big-endian systems > 5b3e507 mtd: nand: pxa3xx: Use ECC strength and step size devicetree binding > eee0166 mtd: nand: pxa3xx: Clean pxa_ecc_init() error handling > 17754ad mtd: nand: pxa3xx: Make of_device_id array const > e634ce5 mtd: nand: pxa3xx: Print actual ECC strength in error message > > Yet v3.18 succeeds to pass a few NAND blocks on nandtest. > > Robert: any ideas? Actually yes, I worked on that this weekend. Would you try the following patch [1] to see if it works for you ? The issue I see is that : - there is a bug in the clk driver for pxa3xx I introduced (CKEN_AB) - and shutting down the GCU clock prevents the NAND from working (I can't explain that one yet) Cheers. diff --git a/drivers/clk/pxa/clk-pxa3xx.c b/drivers/clk/pxa/clk-pxa3xx.c index c677b9ab5367..a47a0c40f937 100644 --- a/drivers/clk/pxa/clk-pxa3xx.c +++ b/drivers/clk/pxa/clk-pxa3xx.c @@ -126,7 +126,7 @@ PARENTS(pxa3xx_ac97_bus) = { "ring_osc_60mhz", "ac97" }; PARENTS(pxa3xx_sbus) = { "ring_osc_60mhz", "system_bus" }; PARENTS(pxa3xx_smemcbus) = { "ring_osc_60mhz", "smemc" }; -#define CKEN_AB(bit) ((CKEN_ ## bit > 31) ? &CKENA : &CKENB) +#define CKEN_AB(bit) ((CKEN_ ## bit > 31) ? &CKENB : &CKENA) #define PXA3XX_CKEN(dev_id, con_id, parents, mult_lp, div_lp, mult_hp, \ div_hp, bit, is_lp, flags) \ PXA_CKEN(dev_id, con_id, bit, parents, mult_lp, div_lp, \ @@ -136,6 +136,10 @@ PARENTS(pxa3xx_smemcbus) = { "ring_osc_60mhz", "smemc" }; mult_hp, div_hp, delay) \ PXA3XX_CKEN(dev_id, con_id, pxa3xx_pbus_parents, mult_lp, \ div_lp, mult_hp, div_hp, bit, pxa3xx_is_ring_osc_forced, 0) +#define PXA3XX_PBUS_CKENF(dev_id, con_id, bit, mult_lp, div_lp, \ + mult_hp, div_hp, delay, flag) \ + PXA3XX_CKEN(dev_id, con_id, pxa3xx_pbus_parents, mult_lp, \ + div_lp, mult_hp, div_hp, bit, pxa3xx_is_ring_osc_forced, flag) #define PXA3XX_CKEN_1RATE(dev_id, con_id, bit, parents) \ PXA_CKEN_1RATE(dev_id, con_id, bit, parents, \ CKEN_AB(bit), (CKEN_ ## bit % 32), 0) @@ -173,13 +177,13 @@ static struct desc_clk_cken pxa3xx_clocks[] __initdata = { static struct desc_clk_cken pxa300_310_clocks[] __initdata = { - PXA3XX_PBUS_CKEN("pxa3xx-gcu", NULL, PXA300_GCU, 1, 1, 1, 1, 0), - PXA3XX_PBUS_CKEN("pxa3xx-nand", NULL, NAND, 1, 2, 1, 4, 0), + PXA3XX_PBUS_CKENF("pxa3xx-gcu", NULL, PXA300_GCU, 1, 1, 1, 1, 0, CLK_IGNORE_UNUSED), + PXA3XX_PBUS_CKENF("pxa3xx-nand", NULL, NAND, 1, 2, 1, 4, 0, CLK_IGNORE_UNUSED), PXA3XX_CKEN_1RATE("pxa3xx-gpio", NULL, GPIO, pxa3xx_13MHz_bus_parents), }; static struct desc_clk_cken pxa320_clocks[] __initdata = { - PXA3XX_PBUS_CKEN("pxa3xx-nand", NULL, NAND, 1, 2, 1, 6, 0), + PXA3XX_PBUS_CKENF("pxa3xx-nand", NULL, NAND, 1, 2, 1, 4, 0, CLK_IGNORE_UNUSED), PXA3XX_PBUS_CKEN("pxa3xx-gcu", NULL, PXA320_GCU, 1, 1, 1, 1, 0), PXA3XX_CKEN_1RATE("pxa3xx-gpio", NULL, GPIO, pxa3xx_13MHz_bus_parents), }; @@ -187,7 +191,7 @@ static struct desc_clk_cken pxa320_clocks[] __initdata = { static struct desc_clk_cken pxa93x_clocks[] __initdata = { PXA3XX_PBUS_CKEN("pxa3xx-gcu", NULL, PXA300_GCU, 1, 1, 1, 1, 0), - PXA3XX_PBUS_CKEN("pxa3xx-nand", NULL, NAND, 1, 2, 1, 4, 0), + PXA3XX_PBUS_CKENF("pxa3xx-nand", NULL, NAND, 1, 2, 1, 4, 0, CLK_IGNORE_UNUSED), PXA3XX_CKEN_1RATE("pxa93x-gpio", NULL, GPIO, pxa3xx_13MHz_bus_parents), };