From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=3.0 tests=DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, FROM_LOCAL_DIGITS,FROM_LOCAL_HEX,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CE727C432C3 for ; Tue, 3 Dec 2019 01:33:36 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7A8D0206DC for ; Tue, 3 Dec 2019 01:33:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="m5P2TWX6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7A8D0206DC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1ibx40-0000K8-3b; Mon, 02 Dec 2019 20:33:16 -0500 Received: from mail-oi1-x232.google.com ([2607:f8b0:4864:20::232]) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES128-GCM-SHA256:128) (Exim 4.92.3) (envelope-from ) id 1ibx3w-0000K1-D1 for kernelnewbies@kernelnewbies.org; Mon, 02 Dec 2019 20:33:12 -0500 Received: by mail-oi1-x232.google.com with SMTP id v140so1616711oie.0 for ; Mon, 02 Dec 2019 17:33:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yqlH4i8j2dLVhTLJMcAvu2g4Hpc3KxfvJmgQVcfBK2s=; b=m5P2TWX69EWOv1owtJgz8YsThYsfzKhlVGXCdC3zWrJVhMews2PL/vlI8Ogf3+m0ON mGvlQ1SsLZ0T1z1/g3zSyA4iGDatyoNoWCdGwlDjcp7LSGyLMA3vWR/RCFkNymSe3Oqx gVkP+Yf+b4qks0iGMKwW0s2oYhcgI10F9HORAUIT3XjWkK5OXPk1WaDtHHUAZ9xTUguU DKTq+qrCAFyOrqRA1DcfkjfurZOtxODAEfT6lLt4W9UuTWD4wC1jl9q/oKjzl1zjWx2z kdc9nmsbvmWvepg5rdTmsOJwqP1ybAT6X73a3VnGTi7MMnxJejO7QOJ9qp6NpS6cgUZs flow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yqlH4i8j2dLVhTLJMcAvu2g4Hpc3KxfvJmgQVcfBK2s=; b=pmJ8C7TBIGRXH9TAiPX2qanBVmz4rPx7FuXCpo90LJJPPoon6mjwony6yWW0hCCOdd 4UYByDlyskYH6Mz1NeIuz/0taUTC9vHs7DUtlGg/RUJ9RhJvZux+lrgzntl0NqTCyICF eW129/hLq2rao+FSH7wi5FPDcg6/Ve5gSxAnx0uXcCP+LxBA0/Jnu2Ls4e3gwJkP6emh k33lEIJ/uyN/XFZDBWBubHWh6y1pFs6mYHzcPiScy33w+CAYXlxhp67T6SKKmXKDtdLy CPxaLJd8G6mWNe2dB0yDwPiMV8fiK+UjtfehXA18dnK2TCLxANnD6L2d/vFQjhlKN6zL kYqQ== X-Gm-Message-State: APjAAAVBIKhFxXiAOxBuIWa9g1vCH6p6l1K4UW0Jshe6YuH7pQh13xhe kuiCCNNMjwSLNRP5VfOp8gXp0NPdbVHJl6btTHc= X-Google-Smtp-Source: APXvYqzv4CbkGX53rfQmMW7PkkIp6dV0XgaQQRMPTbm8Ja76Qh+g27Jllj5xOIqfNcge3qepL/+dB3JxJxcZhOpMN7U= X-Received: by 2002:aca:bb89:: with SMTP id l131mr1774300oif.65.1575336730387; Mon, 02 Dec 2019 17:32:10 -0800 (PST) MIME-Version: 1.0 References: <83466c12-9329-dbee-1751-6f7717210f4f@gmail.com> In-Reply-To: <83466c12-9329-dbee-1751-6f7717210f4f@gmail.com> From: anish singh Date: Mon, 2 Dec 2019 17:30:10 -0800 Message-ID: Subject: Re: I2C bus driver TIMEDOUT because of PM autosuspend To: primoz.beltram@gmail.com Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org On Fri, Nov 29, 2019 at 12:53 PM Primoz Beltram wrote: > > I am analysing a problem with I2C bus driver where the problem shows up > as I2C bus completely blocked. The LX driver in question is > /drivers/i2c/busses/i2c-xiic.c. > Problem is difficult to reproduce, it happens very rarely. So far I saw > that the main precondition is to have very heavy I2C traffic on bus. > In my case this is achieved/reproduced via netdev driving SFP LEDs via > /sys/class/leds/ (via gpio-pca953x). I generate traffic with iperf3. > Network traffic is on 10Gbps EMAC. LX kernel is 4.14.0. > What I saw from debugging this problem is that I2C bus get blocked when > wait_event_timeout() completes because of timeout. The timeout handling > in this driver is probably not robust enough (bus should not remain > blocked), but at this moment this are just my speculations (don't know > enough details). Check with salea logic analyzer what happens to the i2c bus. > > Looking the driver code and data on oscilloscope, I saw that SCL in > single I2C data transfer sequence can be interrupted for very long > delays, e.g up to hundredths of usec (SCL is 100kHz). I started to > suspect that PM autosuspend delay could play some role here. There are > only two delays in driver code, first in wait_event_timeout and second > in set autosuspend delay. Case is a bit strange because in very busy I2C > traffic, PM autosuspend should not be triggered at all. Additionally, if > I lower PM timeout, e.g. from 1000 (default) to 100, I hit the problem > sooner (waits for problem hit are in order of n*10minutes). > > It looks to me that PM autosupend is playing some role here. > > Power management options in my .config: > # CONFIG_SUSPEND is not set > # CONFIG_PM is not set > CONFIG_ARCH_SUSPEND_POSSIBLE=y > > I intentionally did not put all detail descriptions of embedded system > and test setup here (long list), because the main reason of this post is: > > The workaround that works for me/customer (at the moment) is to disable > PM autosuspend in the driver code, either by incerementing PM delay from > 1000 to 10000 or by disabling autosuspend (comment out call to > pm_runtime_put_autosuspend() in xiic_xfer()). > > But, I would like to expose/discuss this issue (maintainer of the code, > or others). > The reason/source of the problem can be much more complex and in some > other place. > > So my question is who should I contact, is this the M: in the > MAINTAINERS list, the MODULE_AUTHOR, ...? You can certainly add the author in loop but I am afraid you won't get any help as this would be specific to your board. So, best is to check soc vendor who has written your i2c bus driver or it could be a issue with your i2c client in that case show them your salea logic analyzer logs to see if they can figure out anything wrong. > How to proceed. > > WBR Primoz > > > _______________________________________________ > Kernelnewbies mailing list > Kernelnewbies@kernelnewbies.org > https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies