Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp3374627ybz; Mon, 27 Apr 2020 14:55:24 -0700 (PDT) X-Google-Smtp-Source: APiQypKowJnX++pbgkU9b7njUihISW5qmSNrgNTJ5IGy2l3/k4rEGr15PJ1bZZmA3EHoHAUnj1cD X-Received: by 2002:a50:a883:: with SMTP id k3mr20349442edc.198.1588024524008; Mon, 27 Apr 2020 14:55:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588024523; cv=none; d=google.com; s=arc-20160816; b=MM4aIPX81LvYGlRX9avnQTrQlOaylu+XPGm49TrIUPiesMu31K8/4h7CbfV9xkKu+4 G0+Uo9mTvhfygdDP6RRhXRllE/nvQrADMcwYsjGFAtKI1ZbZCMQaI+3uSa5Hln5z7jXo qqPsVpdeSw97FVjiFGc9mndHYYYVfkWMrgTwl34rtxmAEr6EQ6I2sZucm18boa3tQ4HP UCTosRmZHfV8HQ+lrXLNy5g77hAVXvF7elali0dxpDaBZjGU2GavKQa2KZ7j7anfLjXB 5edI6AA3kTPrfrjpO0UdSvDHGKBYvQU7lE++vrgdyc9eV1Q4AS+5qU4UIW0gLSYpvPi4 dJLA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:date:message-id:autocrypt :from:references:cc:to:subject; bh=q48xgEZtdaJicFIzp9hfEi4YRWlPnVGJ7V7wXJBHX6Q=; b=spsnWLC5qtVmz7DiKaXRnMCsMaNw0wb/RnVzHoBQjorB1McoBVE3eBGBO9j91Zf1HQ mYz8Df3txfK3r55jQLpeAeiEp/+KMxMq6RXQSm2gEHmehhctZluwq0ddJikkmHjvbKK/ aM17DoW5owYeBi/Sex2FaueRLmOvuQ84qchLUNUTv2Io5Jd9C4FRo9co80Akjo9JONZt 76feQaOzY2cwJOG6uthYhi/Y5Obj105YG4Z4umg+Eueo5pUgLFMt2FYcMjJMky2CvgaP /IhPcgF38mZndiW6X5ZRqbeb8x3yUf+m+7FMXqXP66eVTEoHmhyNt9vLRuqvuy0aIfMj 8myw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qn16si517731ejb.66.2020.04.27.14.55.00; Mon, 27 Apr 2020 14:55:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726403AbgD0VxO (ORCPT + 99 others); Mon, 27 Apr 2020 17:53:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726318AbgD0VxN (ORCPT ); Mon, 27 Apr 2020 17:53:13 -0400 Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [IPv6:2001:67c:2050::465:201]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3623AC03C1A7 for ; Mon, 27 Apr 2020 14:53:12 -0700 (PDT) Received: from smtp1.mailbox.org (smtp1.mailbox.org [80.241.60.240]) (using TLSv1.2 with cipher ECDHE-RSA-CHACHA20-POLY1305 (256/256 bits)) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 499z6X1361zQlHw; Mon, 27 Apr 2020 23:53:08 +0200 (CEST) X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp1.mailbox.org ([80.241.60.240]) by gerste.heinlein-support.de (gerste.heinlein-support.de [91.198.250.173]) (amavisd-new, port 10030) with ESMTP id PNHCJvhImbyx; Mon, 27 Apr 2020 23:53:02 +0200 (CEST) Subject: Re: [PATCH 1/4] spi: lantiq: Synchronize interrupt handlers and transfers To: Dilip Kota , broonie@kernel.org, robh@kernel.org, linux-spi@vger.kernel.org, devicetree@vger.kernel.org Cc: linux-kernel@vger.kernel.org, daniel.schwierzeck@gmail.com, andriy.shevchenko@intel.com, cheol.yong.kim@intel.com, chuanhua.lei@linux.intel.com, qi-ming.wu@intel.com References: <3bf88d24b9cad9f3df1da8ed65bf55c05693b0f2.1587702428.git.eswara.kota@linux.intel.com> From: Hauke Mehrtens Autocrypt: addr=hauke@hauke-m.de; keydata= mQINBFtLdKcBEADFOTNUys8TnhpEdE5e1wO1vC+a62dPtuZgxYG83+9iVpsAyaSrCGGz5tmu BgkEMZVK9YogfMyVHFEcy0RqfO7gIYBYvFp0z32btJhjkjBm9hZ6eonjFnG9XmqDKg/aZI+u d9KGUh0DeaHT9FY96qdUsxIsdCodowf1eTNTJn+hdCudjLWjDf9FlBV0XKTN+ETY3pbPL2yi h8Uem7tC3pmU7oN7Z0OpKev5E2hLhhx+Lpcro4ikeclxdAg7g3XZWQLqfvKsjiOJsCWNXpy7 hhru9PQE8oNFgSNzzx2tMouhmXIlzEX4xFnJghprn+8EA/sCaczhdna+LVjICHxTO36ytOv7 L3q6xDxIkdF6vyeEtVm1OfRzfGSgKdrvxc+FRJjp3TIRPFqvYUADDPh5Az7xa1LRy3YcvKYx psDDKpJ8nCxNaYs6hqTbz4loHpv1hQLrPXFVpoFUApfvH/q7bb+eXVjRW1m2Ahvp7QipLEAK GbiV7uvALuIjnlVtfBZSxI+Xg7SBETxgK1YHxV7PhlzMdTIKY9GL0Rtl6CMir/zMFJkxTMeO 1P8wzt+WOvpxF9TixOhUtmfv0X7ay93HWOdddAzov7eCKp4Ju1ZQj8QqROqsc/Ba87OH8cnG /QX9pHXpO9efHcZYIIwx1nquXnXyjJ/sMdS7jGiEOfGlp6N9IwARAQABt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zoQka1kJi6RmBFpDQUg7+/PS6lCFoEppWp7eUSSNPm8VFb jwa1D3MgS3+VSKOMmFWGRCY99bWnl2Zd2jfdETmBFNXA94mg2N2vI/THju79u1dR9gzpjH7R 3jmPvpEc2WCU5uJfaVoAEqh9kI2D7NlQCG80UkXDHGmcoHBnsiEZGjzm5zYOYinjTUeoy3F0 8aTZ+e/sj+r4VTOUB/b0jy+JPnxn23FktGIYnQ+lLsAkmcbcDwCop4V59weR2eqwBqedNRUX 5OTP93lUIhrRIy3cZT/A5nNcUeCYRS8bCRFKrQKEn92RFg== Message-ID: <1536b752-13d1-128b-1393-80cf175df5e2@hauke-m.de> Date: Mon, 27 Apr 2020 23:52:59 +0200 MIME-Version: 1.0 In-Reply-To: <3bf88d24b9cad9f3df1da8ed65bf55c05693b0f2.1587702428.git.eswara.kota@linux.intel.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: 011F817F1 X-Rspamd-Score: -4.42 / 15.00 / 15.00 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/24/20 12:42 PM, Dilip Kota wrote: > Synchronize tx, rx and error interrupts by registering to the > same interrupt handler. Interrupt handler will recognize and process > the appropriate interrupt on the basis of interrupt status register. > Also, establish synchronization between the interrupt handler and > transfer operation by taking the locks and registering the interrupt > handler as thread IRQ which avoids the bottom half. > Fixes the wrongly populated interrupt register offsets too. > > Fixes: 17f84b793c01 ("spi: lantiq-ssc: add support for Lantiq SSC SPI controller") > Fixes: ad2fca0721d1 ("spi: lantiq-ssc: add LTQ_ prefix to defines") > Signed-off-by: Dilip Kota > --- > drivers/spi/spi-lantiq-ssc.c | 89 ++++++++++++++++++++++---------------------- > 1 file changed, 45 insertions(+), 44 deletions(-) > Hi, I tried this patch series on a TP-LINK TD-W8970 (VRX200 with SPI flash) and the SPI controller is failing like this: ----- [ 6.947194] printk: bootconsole [early0] disabled [ 6.964210] spi-lantiq-ssc 1e100800.spi: Lantiq SSC SPI controller (Rev 8, TXFS 8, RXFS 8, DMA 1) [ 7.175188] spi-nor spi0.4: SPI transfer timed out [ 7.178558] spi_master spi0: failed to transfer one message from queue [ 7.185120] spi-nor spi0.4: error -145 reading JEDEC ID [ 7.190378] spi-nor: probe of spi0.4 failed with error -2 [ 7.199729] libphy: Fixed MDIO Bus: probed ------ It already fails when applying this first patch only. Without this patch is works like this: ----- [ 6.939498] printk: bootconsole [early0] disabled [ 6.954016] spi-lantiq-ssc 1e100800.spi: Lantiq SSC SPI controller (Rev 8, TXFS 8, RXFS 8, DMA 1) [ 6.975465] spi-nor spi0.4: s25fl064k (8192 Kbytes) [ 6.979066] 4 fixed-partitions partitions found on MTD device spi0.4 [ 6.985338] Creating 4 MTD partitions on "spi0.4": [ 6.990127] 0x000000000000-0x000000020000 : "u-boot" [ 6.997422] 0x000000020000-0x0000007c0000 : "firmware" [ 7.212304] random: crng init done [ 8.796128] 2 tplink-fw partitions found on MTD device firmware [ 8.800674] 0x000000020000-0x00000027878f : "kernel" [ 8.807776] 0x000000278790-0x0000007c0000 : "rootfs" [ 8.813611] mtd: device 3 (rootfs) set to be root filesystem [ 8.818268] 1 squashfs-split partitions found on MTD device rootfs [ 8.824123] 0x000000590000-0x0000007c0000 : "rootfs_data" [ 8.831772] 0x0000007c0000-0x0000007d0000 : "config" [ 8.837785] 0x0000007d0000-0x000000800000 : "boardconfig" [ 8.848193] libphy: Fixed MDIO Bus: probed ------ This was done by applying your patches on top of kernel 5.4.35 and adding this: "spi: lantiq-ssc: Use devm_platform_ioremap_resource() in lantiq_ssc_probe()" in OpenWrt master. Hauke