Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1770443imm; Thu, 27 Sep 2018 02:09:48 -0700 (PDT) X-Google-Smtp-Source: ACcGV63GUjCOgnUd3BX7XBZX9CNZ6hLpFCAocX6wHQEX8e+EpgiuQEI94b+jTNFYDBNl/oSsO2u1 X-Received: by 2002:a17:902:7482:: with SMTP id h2-v6mr2630419pll.228.1538039388506; Thu, 27 Sep 2018 02:09:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538039388; cv=none; d=google.com; s=arc-20160816; b=TQAA74hqwMjQ12qw04aB0sPebqtf72uCJbmvuVzZDNhZCQrrb7J/Nduaw6sY9LwwtZ PnUawTLrQMstv0dC38XNMCo/NHYLoebrWUtDKku9FsTezZvcTck78svYGR67N8ZqJHz0 7b2nE8Qhfirp8Jq6kOI8xdrNPkCulRw4s0jKKgmuJfE8uqNMfPexU2TBvJMonAu363EH X4VgHrBiYllX9pmJBocVkgCKqPXOv5xFkAjwEJN/Hhv3w9OuL9ooClxwq/Swy1l6+HN9 hQb4UEFiv+TcdFc3O79IlTQwxm2cm6nFU//0yz5CWbenVbkoe5aVR2rt9Q9TDneiup9D t9lA== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from; bh=GNNWKr9XpPWHmDSDQcabe/nCIz5pkn6fsdSga+wp9Kk=; b=fCGM+bpcH+g6CVT54AFSTSvFTkTRT7mu0Fg5NDIFw6zVjG8cHQSUmhSgyPkZyZGVZ+ X2Mc/vi/10B0vflgF+79InRiKxS9+BovnKeglX9yMaf6LYyp9uuuDrew2PROJ2wDzZNG kSahliCQYZryybgZa3XOfleY+p9kw7WwlCl8flzCmLbAZhsgA99KECMvafT0xFlRlbh/ M94FEiGb+AVeUXsEj6UnANttD1Nz8EgIYPxbZg/m3Y4WDZ93GnjImLB1xaminDLnxmTB L5//+AwR5SkGypdulYg0OGxlfYt4d+ckJKbGu78y4bGu68VT+pGIk0dV1dnGq/BV/KY1 2Ajg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 x10-v6si1471057plo.100.2018.09.27.02.09.33; Thu, 27 Sep 2018 02:09:48 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728120AbeI0P0F (ORCPT + 99 others); Thu, 27 Sep 2018 11:26:05 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:54994 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727020AbeI0P0E (ORCPT ); Thu, 27 Sep 2018 11:26:04 -0400 Received: from localhost (ip-213-127-77-73.ip.prioritytelecom.net [213.127.77.73]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id F026410A4; Thu, 27 Sep 2018 09:08:48 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, "Andrew F. Davis" , Mark Brown Subject: [PATCH 4.18 27/88] ASoC: tas6424: Save last fault register even when clear Date: Thu, 27 Sep 2018 11:03:08 +0200 Message-Id: <20180927090303.827448741@linuxfoundation.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180927090300.631426620@linuxfoundation.org> References: <20180927090300.631426620@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Andrew F. Davis commit d40e3e9e44db4b3c8777f3b515ba6097ba26e3b2 upstream. When there is no fault bit set in a fault register we skip the fault reporting section for that register. This also skips over saving that registers value. We save the value so we will not double report an error, but if an error clears then returns we will also not report it as we did not save the all cleared register value. Fix this by saving the fault register value in the all clear path. Signed-off-by: Andrew F. Davis Signed-off-by: Mark Brown Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- sound/soc/codecs/tas6424.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) --- a/sound/soc/codecs/tas6424.c +++ b/sound/soc/codecs/tas6424.c @@ -424,8 +424,10 @@ static void tas6424_fault_check_work(str TAS6424_FAULT_PVDD_UV | TAS6424_FAULT_VBAT_UV; - if (reg) + if (!reg) { + tas6424->last_fault1 = reg; goto check_global_fault2_reg; + } /* * Only flag errors once for a given occurrence. This is needed as @@ -461,8 +463,10 @@ check_global_fault2_reg: TAS6424_FAULT_OTSD_CH3 | TAS6424_FAULT_OTSD_CH4; - if (!reg) + if (!reg) { + tas6424->last_fault2 = reg; goto check_warn_reg; + } if ((reg & TAS6424_FAULT_OTSD) && !(tas6424->last_fault2 & TAS6424_FAULT_OTSD)) dev_crit(dev, "experienced a global overtemp shutdown\n"); @@ -497,8 +501,10 @@ check_warn_reg: TAS6424_WARN_VDD_OTW_CH3 | TAS6424_WARN_VDD_OTW_CH4; - if (!reg) + if (!reg) { + tas6424->last_warn = reg; goto out; + } if ((reg & TAS6424_WARN_VDD_UV) && !(tas6424->last_warn & TAS6424_WARN_VDD_UV)) dev_warn(dev, "experienced a VDD under voltage condition\n");