From patchwork Wed Apr 13 22:39:44 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Javier Martinez Canillas X-Patchwork-Id: 8829651 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C9844C0553 for ; Wed, 13 Apr 2016 22:40:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 04ADA2020F for ; Wed, 13 Apr 2016 22:40:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 1288A2037C for ; Wed, 13 Apr 2016 22:40:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754241AbcDMWj5 (ORCPT ); Wed, 13 Apr 2016 18:39:57 -0400 Received: from lists.s-osg.org ([54.187.51.154]:55751 "EHLO lists.s-osg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752391AbcDMWjz (ORCPT ); Wed, 13 Apr 2016 18:39:55 -0400 Received: from localhost.localdomain (unknown [162.246.216.28]) by lists.s-osg.org (Postfix) with ESMTPSA id 62DEEE279A; Wed, 13 Apr 2016 22:39:48 +0000 (UTC) Subject: Re: tvp5150 regression after commit 9f924169c035 To: Wolfram Sang References: <56B204CB.60602@osg.samsung.com> <20160208105417.GD2220@tetsubishi> <56BE57FC.3020407@osg.samsung.com> <20160212221352.GY3500@atomide.com> <56BE5C97.9070607@osg.samsung.com> <20160212224018.GZ3500@atomide.com> <56BE65F0.8040600@osg.samsung.com> <20160212234623.GB3500@atomide.com> <56BE993B.3010804@osg.samsung.com> <20160412223254.GK1526@katana> From: Javier Martinez Canillas Cc: Tony Lindgren , linux-i2c@vger.kernel.org, Mauro Carvalho Chehab , Linux Media Mailing List , linux-pm@vger.kernel.org, Alan Stern Message-ID: <570ECAB0.4050107@osg.samsung.com> Date: Wed, 13 Apr 2016 18:39:44 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <20160412223254.GK1526@katana> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Hello Wolfram, On 04/12/2016 06:32 PM, Wolfram Sang wrote: > >> I'll try to find some time next week to dig deeper on this. Just >> thought that may be related to the issue you found but it seems >> that's not the case. > > Any updates on this? > Sorry, I've been sick and then busy with other stuff so I didn't have time to dig deeper on this. > Thanks, > > Wolfram > I'll write what I found so far in case someone with better knowledge about the runtime PM API and the OMAP I2C controller driver can have an idea of what could be causing this. The problem is that after commit 9f924169c035 ("i2c: always enable RuntimePM for the adapter device"), i2c_smbus_read_byte_data() fails and returns -110 (ETIMEDOUT) error in the tvp5150 I2C driver. The call trace is the following: i2c_device_probe tvp5150_probe tvp5150_read i2c_smbus_read_byte_data i2c_smbus_xfer i2c_transfer omap_i2c_xfer omap_i2c_xfer_msg The fail in omap_i2c_xfer_msg() is due the wait_for_completion_timeout() timeout, so it seems the omap_i2c_isr_thread() is not calling complete() for the cmd_complete completion when runtime PM is enabled (no idea why). If I revert commit 9f924169c035 then things works again or if I use the following patch that basically disables runtime PM for the OMAP adapter after it has been enabled by the I2C core due commit 9f924169c035: Best regards, diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 37a88f0ae179..0b72b21b379d 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c @@ -1445,6 +1445,8 @@ omap_i2c_probe(struct platform_device *pdev) goto err_unuse_clocks; } + pm_runtime_disable(&adap->dev); + dev_info(omap->dev, "bus %d rev%d.%d at %d kHz\n", adap->nr, major, minor, omap->speed);