Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp673732ybk; Fri, 15 May 2020 10:32:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJywA7wYX/T9fs3mfvOlleu9qsgIm+YkaDF1WzJYpimIa3sxDFevTX5Lg5QjreZl48jIHp0S X-Received: by 2002:a17:907:1199:: with SMTP id uz25mr4131119ejb.24.1589563968346; Fri, 15 May 2020 10:32:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589563968; cv=none; d=google.com; s=arc-20160816; b=jTTNUnSCDnpjdS0bUGPRRheG9nYY0uJW76H74Qw6juh9NYApwiMZUAjzQpw1i/Swjm EXVrJ7rPbSmEcTMVQToIzXjRqt4g7S9bkR4LYKVy3OfjdxxP3yn66GWnDglSJvOCBkhb s/k8Lqp+D8JtoaQxy6AcpZaI+sAp2eaVXR3V/EqibHXA6t4TowHrmCryDQ3a1pV+kQrW VI2kYzfk0odsTvN2EyDb62Bk40/aP/fhaL4k/In/t9ISSbxxF6s81/TT37ssYkLI3IXc PkTBRNGuamr8MzwerZRic4yHEKC7bcWReA5aXozgQairsHqYKAMXJt6cQek+lTU4Fd8+ BR9A== 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:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=h/F90YLQpUp0HHTIQUShz3e2nnAFVjUCmhXhEdzbwnY=; b=NRmmA7YJDwqzPg7B3A5M/cQnlkR7mPderx/p/x7eMOGfwi4eubil+IlYmlF5qpoPO/ mvxvQ2YlW6wvS3KVI1G/Eqt/9ZcdhMbmDwsvczHwg8y5rltCFDGJbtuUq9/j34JjuNqB 1WaQjJbPy9FlmhAhA7FbtYi3pDxR2DWUCahJe10zWbTXYIW18flPDgF5brBssGoD8C3f wmBoahaF172Hngd64v7EZ/IaS1MDLndvsZSZcy8WhYBgKtYyoEqS333H+DO/gve6n3TJ 2IMYAa6cEFjwvUvo/YdC34DLT0zaUGXAY+lRvsrB9K2yRuguMRvmm+h9VDJeOjnOWVy/ 9m8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KibfLZUk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si1651950eji.355.2020.05.15.10.32.25; Fri, 15 May 2020 10:32:48 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=KibfLZUk; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726694AbgEORaw (ORCPT + 99 others); Fri, 15 May 2020 13:30:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35044 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726494AbgEORav (ORCPT ); Fri, 15 May 2020 13:30:51 -0400 Received: from mail-lf1-x144.google.com (mail-lf1-x144.google.com [IPv6:2a00:1450:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC59DC061A0C; Fri, 15 May 2020 10:30:49 -0700 (PDT) Received: by mail-lf1-x144.google.com with SMTP id h188so2493887lfd.7; Fri, 15 May 2020 10:30:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=h/F90YLQpUp0HHTIQUShz3e2nnAFVjUCmhXhEdzbwnY=; b=KibfLZUk0ftdUq5UDaH2o15irQFHqyz8gi8IqEMsrfk7C4YJfNpMj1v3aDGFgUiDl+ Ei/Kt5/khtVtNkdg/aICAD6wcWLCfORTzMRxOmigg+/vPxaELL+8f1WC/9y11fbjbHfc GkSWrvrsVc/rgXn+5qNqg/TRJrPdhUTl+jp0IwbwXhNHIeTopMkk3ImSd+kEUIvFqBr+ Yqg6bF92+Qyql0MoOeSdMxXGCb9h+vlV3qey2xv/lkRFsB9TtIqHzC7xJlYRvN6c3ydT twT6Vi7ldFq7ZGduwpM5To/mB8XIFwT2UhuzlXRkcydEWl9zsgVqe5PPOOGegc1+g2vc B3mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=h/F90YLQpUp0HHTIQUShz3e2nnAFVjUCmhXhEdzbwnY=; b=sEraOlyV+/B5BCM5fiPv4vnBkb/Xjerwg0gBuMwzgN1kTq5BEwxomuko6Dbk0nEhEi /P7r56yrQmZvrsSjA+GhAOOPzvouDGVPy5MTEbRopvFU9Fh/OkXEGLtya5ILdLQow9v1 gm29tlcZCgVAnVtuGcigFqm5iEQ6ceJ8Aw1j9+b3+2f3+4oBiZTB1Whs7m8vX1e+zEQL 6MojS8lWiV4L/sbhcL2OJ2hbNrBOFdp4KmHp/bdI0Dyv5UHbg6n/KHMBgLmbxnl93UYq eB/oSHgsiNAdykavktFI7pTwtaUGvVy6cGieDja844eSJaFt/oSvLRucR0m3hhw1CxgG 2m2A== X-Gm-Message-State: AOAM531H78aLFnwD4Natz1e6xv29Qd4AAoSNr9kXz3W2zcyixZjKeGRw RwwKmMh32NnMukg4thTjJ+A+F+1L X-Received: by 2002:ac2:5ccf:: with SMTP id f15mr3073677lfq.216.1589563847942; Fri, 15 May 2020 10:30:47 -0700 (PDT) Received: from [192.168.2.145] (ppp91-78-208-152.pppoe.mtu-net.ru. [91.78.208.152]) by smtp.googlemail.com with ESMTPSA id j24sm1471099ljg.60.2020.05.15.10.30.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 15 May 2020 10:30:45 -0700 (PDT) Subject: Re: [PATCH v1] mfd: tps65910: Correct power-off programming sequence To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Tony Lindgren , Lee Jones , Thierry Reding , Jonathan Hunter , Zack Pearsall , linux-tegra@vger.kernel.org, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200514205022.7024-1-digetx@gmail.com> <20200515110754.GB20564@qmqm.qmqm.pl> From: Dmitry Osipenko Message-ID: <7e1eaac5-34d1-f76e-e4c5-bc36f56a7064@gmail.com> Date: Fri, 15 May 2020 20:30:43 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200515110754.GB20564@qmqm.qmqm.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 15.05.2020 16:30, Michał Mirosław пишет: > On Thu, May 14, 2020 at 11:50:21PM +0300, Dmitry Osipenko wrote: >> This patch fixes system shutdown on a devices that use TPS65910 as a >> system's power controller. In accordance to the TPS65910 datasheet, the >> PMIC's state-machine transitions into the OFF state only when DEV_OFF >> bit of DEVCTRL_REG is set. The ON / SLEEP states also should be cleared, >> otherwise PMIC won't get into a proper state on shutdown. Devices like >> Nexus 7 tablet and Ouya game console are now shutting down properly. >> >> Tested-by: Zack Pearsall >> Signed-off-by: Dmitry Osipenko >> --- >> drivers/mfd/tps65910.c | 12 ++++++++++-- >> 1 file changed, 10 insertions(+), 2 deletions(-) >> >> diff --git a/drivers/mfd/tps65910.c b/drivers/mfd/tps65910.c >> index 11959021b50a..22116cee411d 100644 >> --- a/drivers/mfd/tps65910.c >> +++ b/drivers/mfd/tps65910.c >> @@ -440,8 +440,16 @@ static void tps65910_power_off(void) >> DEVCTRL_PWR_OFF_MASK) < 0) >> return; >> >> - tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, >> - DEVCTRL_DEV_ON_MASK); >> + if (tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, >> + DEVCTRL_DEV_SLP_MASK) < 0) >> + return; >> + >> + if (tps65910_reg_clear_bits(tps65910, TPS65910_DEVCTRL, >> + DEVCTRL_DEV_ON_MASK) < 0) >> + return; >> + >> + tps65910_reg_set_bits(tps65910, TPS65910_DEVCTRL, >> + DEVCTRL_DEV_OFF_MASK); >> } > > Isn't it enough to update the DEVCTRL with just one > tps65910_reg_update_bits()? IIRC, we've tried that variant and it didn't work. Although, maybe it was affected by some other changes that we were trying simultaneously, so could be worthwhile to re-check it. Thank you for the comment!