From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755812AbbESMgO (ORCPT ); Tue, 19 May 2015 08:36:14 -0400 Received: from mx0b-0016f401.pphosted.com ([67.231.156.173]:27823 "EHLO mx0b-0016f401.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755524AbbESMgL (ORCPT ); Tue, 19 May 2015 08:36:11 -0400 Date: Tue, 19 May 2015 20:32:42 +0800 From: Jisheng Zhang To: Mika Westerberg CC: , , , Subject: Re: [PATCH] i2c: designware: separate ops for system_sleep_pm and runtime_pm Message-ID: <20150519203242.74617ad6@xhacker> In-Reply-To: <20150518082823.GH1490@lahna.fi.intel.com> References: <1431693099-2292-1-git-send-email-jszhang@marvell.com> <20150518082823.GH1490@lahna.fi.intel.com> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-05-19_04:2015-05-19,2015-05-19,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1505190158 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Mika, On Mon, 18 May 2015 11:28:23 +0300 Mika Westerberg wrote: > On Fri, May 15, 2015 at 08:31:39PM +0800, Jisheng Zhang wrote: > > Commit 1fc2fe204cb9 ("i2c: designware: Add runtime PM hooks") adds > > runtime pm support using the same ops for system sleep and runtime pm. > > When suspend to ram, the i2c host may have been runtime suspended, thus > > i2c_dw_disable() hangs. > > It hangs because it has already been powered off, right? Either be powered off or clock gated or even both. > > > This patch fixes this issue by separating ops for system sleep pm and > > runtime pm, and in the system suspend/resume path, runtime pm apis are > > used to ensure the device is at correct state. > > I can see that this fixes the issue with the platform driver (as the > platform bus core doesn't power on the device automatically as opposed > to other buses, like PCI). However, I'm thinking that can we do better > here. > > Instead of powering the device on again, can't we leave it in low power > state? Recently added 'dev->power.direct_complete' may be used to > achieve that, I think. how to handle runtime suspended via just being clock gated? Currently the only solution is using the runtime pm apis to ensure the device is in a working state during s2ram. What's your opinion? Thanks, Jisheng