From patchwork Thu Oct 17 06:14:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joel Stanley X-Patchwork-Id: 176548 Delivered-To: patch@linaro.org Received: by 2002:a92:7e96:0:0:0:0:0 with SMTP id q22csp466223ill; Wed, 16 Oct 2019 23:14:26 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeWrilf+IVb5dWfsIlBUb+RhKLbBYwyvCH91PTtVex22Q26tKa/HIUelSD4OxL9q5hmnmX X-Received: by 2002:a17:906:1942:: with SMTP id b2mr1954910eje.36.1571292866285; Wed, 16 Oct 2019 23:14:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571292866; cv=none; d=google.com; s=arc-20160816; b=mVs7avijo0SH0U8/55M813YUB/4rOYL5tP0Bi/WUuDLweeNZc1gBfxDbugJ6qsb4tc L93t23IyXKXEZVovPmetUbz0/OrnHnDyrDEIEJByiid4e48PBMGN53qIpb+Zvz85pizi E7kLJ8mtV43Z+/whFGgmvIQbc124KLOShUkg6P9fB828jjBeGWca4Yv0VD10l90vrF8u GZTQy8Fr+aR7xLTLP+jVfEu5B0IbgW6XSe0L37WaOcU2vwjpv5TCiSm398RDKG55Be0b ekXxdjM99YwdQZV2jsM5lB5/SP3u6seoXYyKlvfWvM2Q/VUs4WxHuD1EJBF+OT80fYyz 8hKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :mime-version:dkim-signature; bh=SSycC+6FLXhjLvO+eUNuIjWKaeeqP5Qat7UwzKeLNrc=; b=TyuIUaC/wLPFwQZLBLaGQfV0AY1d2N8TUL+DnfYmvtiEp3zvtfqgMrQa2uh2KVKZvM 8ollmr/BN7svs8+2kHiRGMmngZ23vBJ24FWa+nsvlLjdYqHQ71UWLLs7WqxY6FNMmtL9 YZ6Pss4TP/cnwJL6OPZG51chB1BC6ljT5lRSuLKz094HX/dY4lrZC6pHTnRxzX8CkaS2 /zgCE3kOHTvQ/WbWK5Xqm4OvTtlWZUBMm6fJactpCOYPaijV+hZaYUOZFzPlZ3Dmlo61 9lDvXEaDVf7E1e2bUCHR3ebykAMRfX+6D457M3AatHJ3a1oV8xR7mlKqqocWHwXON1Sc pl7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=Q+5CxomM; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w12si815395ejb.303.2019.10.16.23.14.25; Wed, 16 Oct 2019 23:14:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@jms.id.au header.s=google header.b=Q+5CxomM; spf=pass (google.com: best guess record for domain of linux-i2c-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-i2c-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389053AbfJQGOZ (ORCPT + 2 others); Thu, 17 Oct 2019 02:14:25 -0400 Received: from mail-qt1-f171.google.com ([209.85.160.171]:43651 "EHLO mail-qt1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731726AbfJQGOZ (ORCPT ); Thu, 17 Oct 2019 02:14:25 -0400 Received: by mail-qt1-f171.google.com with SMTP id t20so1904183qtr.10 for ; Wed, 16 Oct 2019 23:14:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jms.id.au; s=google; h=mime-version:from:date:message-id:subject:to:cc; bh=SSycC+6FLXhjLvO+eUNuIjWKaeeqP5Qat7UwzKeLNrc=; b=Q+5CxomMgCIuC811bGWVLqai3qJaMmwh0GRCQJhvQ6vVu8IIFArRU0cpmmsnmN/ass uhaeYa6PoijW/wlmpLyzkIwDPnypt7XyezWbs3c3AIvUXLkfbGjE+fQfj1dwf6B+Q1s9 aEbk4TmWXzVivz7KRfiQUdTyY0Hk519+pctLY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to:cc; bh=SSycC+6FLXhjLvO+eUNuIjWKaeeqP5Qat7UwzKeLNrc=; b=cp0o/nWzfR5ossr9YFFkCoJEUjsl0wD8zwWLXMQ1CJ0xGE7tx129rgZMtQjulkOar0 IPfPvnOEKouM77eK7tTzAOyWwvxq9RZQxwPe2Burrasn2fuqe6963/T5otwfSpqAJkrB ZCFeHZ9BT2UmXFESm2ZQDSj/8aZaa/TTbnYuMFMlhAe5SDxf15K51dPCmamMw6/20ALs AtUYizOr61hBmraMApK34D1lloA/9AwDUachjfG0VzXHncdfxRt6N4TY+nCffTSJSKvx wWgGud1FrqA0Aw0R0OS+bLRDekQon+sStrWLNgSGYE+zoWCqVq2ep+VcQqufybFuTQKp JnKw== X-Gm-Message-State: APjAAAXNWkEvleS5e/9wLVqjJMRN4vD1YgV5amFN/iKV4jPAkukHausl LtvzvPFMji+SfQtkZ4PHT+QAszFkBMv/qiGAFjA= X-Received: by 2002:ac8:1207:: with SMTP id x7mr2116697qti.255.1571292863733; Wed, 16 Oct 2019 23:14:23 -0700 (PDT) MIME-Version: 1.0 From: Joel Stanley Date: Thu, 17 Oct 2019 06:14:12 +0000 Message-ID: Subject: AST2600 i2c irq issue To: Jae Hyun Yoo , Brendan Higgins Cc: linux-aspeed , linux-i2c@vger.kernel.org, Andrew Jeffery , Eddie James , Ryan Chen Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org I have been doing bringup of the ast2600. It contains i2c buses that are register compatible with the ast2500, and I am running them without buffer or DMA mode. This is with v5.3.6, with no patches other than adding the compatible string: I see this behavior: [ 20.981417] aspeed-i2c-bus 1e78a280.i2c-bus: master failed to RX [ 20.988259] aspeed-i2c-bus 1e78a280.i2c-bus: irq handled != irq. expected 0x00000014, but was 0x00000010 [ 22.451265] aspeed-i2c-bus 1e78a200.i2c-bus: master failed to STOP. irq_status:0x0 [ 22.459909] aspeed-i2c-bus 1e78a200.i2c-bus: irq handled != irq. expected 0x00000010, but was 0x00000000 [ 22.470604] aspeed-i2c-bus 1e78a200.i2c-bus: irq handled != irq. expected 0x00000011, but was 0x00000000 [ 29.156951] aspeed-i2c-bus 1e78a280.i2c-bus: master failed to STOP. irq_status:0x0 [ 29.165601] aspeed-i2c-bus 1e78a280.i2c-bus: irq handled != irq. expected 0x00000010, but was 0x00000000 It happens on boot, and can also be triggered by placing load on the system. In particular, if I copy a large amount of data to the flash. The IRQs are being served on one of the CPUs: 29: 0 0 GIC-0 142 Level 1e78a080.i2c-bus 30: 0 0 GIC-0 143 Level 1e78a100.i2c-bus 31: 0 0 GIC-0 144 Level 1e78a180.i2c-bus 32: 302596 0 GIC-0 145 Level 1e78a200.i2c-bus 33: 197340 0 GIC-0 146 Level 1e78a280.i2c-bus 34: 196900 0 GIC-0 147 Level 1e78a300.i2c-bus 35: 0 0 GIC-0 149 Level 1e78a400.i2c-bus 36: 2199 0 GIC-0 151 Level 1e78a500.i2c-bus 37: 0 0 GIC-0 152 Level 1e78a580.i2c-bus 38: 3407 0 GIC-0 153 Level 1e78a600.i2c-bus 39: 0 0 GIC-0 154 Level 1e78a680.i2c-bus 40: 0 0 GIC-0 155 Level 1e78a700.i2c-bus Following a hunch, I booted the system with SMP disabled (it's a dual core part). The issue did not reproduce. This suggests the driver is lacking locking. I am yet to do any detailed debugging. Have you seen any behavior like this? --- a/drivers/i2c/busses/i2c-aspeed.c +++ b/drivers/i2c/busses/i2c-aspeed.c @@ -938,6 +938,10 @@ static const struct of_device_id aspeed_i2c_bus_of_table[] = { .compatible = "aspeed,ast2500-i2c-bus", .data = aspeed_i2c_25xx_get_clk_reg_val, }, + { + .compatible = "aspeed,ast2600-i2c-bus", + .data = aspeed_i2c_25xx_get_clk_reg_val, + }, { }, };