Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp458541ybl; Fri, 6 Dec 2019 00:20:45 -0800 (PST) X-Google-Smtp-Source: APXvYqzwv4I3ynOxEm3XeWnhBpMH3KvUhozAfq6ZM7TAJYNRuYTIO+iEhT83+66ew2neAte/gkRa X-Received: by 2002:a9d:600e:: with SMTP id h14mr8592111otj.113.1575620445148; Fri, 06 Dec 2019 00:20:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575620445; cv=none; d=google.com; s=arc-20160816; b=g5yJ1fcP/1fhx0DCaWtiR20gUs5l30plC1zDtvxbi9AEo1vMQJAnxTW/0J6F76VMBe +FUgQTPRsI9XXOeSNzxOoIJQETUDQ9gPGbvxzyyVcs4FIGgoqN655OgrO+5Jz0ZAsHT9 edFvQWGjVAEbBm+cPKs+lmLHo2qWKmGL+XlDeuUPVhIl6j2ixnQEupAC6SjzdDsu/eIz GbZ8mNFZjI50+OvgBOC4SU2FfQKSZTmC4U9I0M9leOtpfBMVCfGm3upiWQxifbxmwz/w Wd8LyMmW1IjKYjmWfnmXWX+zgL3GiTKnTZt0iOg/9Duo/a0/6rO2er/0Na8MbmZT+foE 55LQ== 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=6vcNVWFrHn/SvqVY9StBuo/jTuPFzfRjFOoFMP+jKUU=; b=cnxnSAEtyzznyXTumKCx9sYesYLvM+wtvv3dP59wa4CTlvz4wZxgS8hsAiOJGHaQLK d3vUCt1TnIHMzvSb+VJjMnvRX5TtPdLFMr9ITl56aI4WzOSWSxuN0hvX2NrZuYTNlTeD hhw1F2FQpLi3N6C/BpevBNLDPWxRtDQompn/5T21SjsoSMS9lH/d94aJf9FNcT5Sw6ut RyERkaWvsZ0R6e/5OTbWMh28uXwHMXf4DLdZl4UuYrcYxEi5JLsacAbKF/ayBjv1utrH Hiex8ABBPRN0kzPBY/WX4+KyFE1Hy0grQd4eyGOu4QvN0BOF9YP56EnGUZRMlrGYy0DP tvXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=NwOAavXG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e59si4661717ote.97.2019.12.06.00.20.33; Fri, 06 Dec 2019 00:20:45 -0800 (PST) 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; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=NwOAavXG; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726469AbfLFITg (ORCPT + 99 others); Fri, 6 Dec 2019 03:19:36 -0500 Received: from mx07-00178001.pphosted.com ([62.209.51.94]:16768 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726088AbfLFITg (ORCPT ); Fri, 6 Dec 2019 03:19:36 -0500 Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id xB68HKZ8029511; Fri, 6 Dec 2019 09:19:16 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=STMicroelectronics; bh=6vcNVWFrHn/SvqVY9StBuo/jTuPFzfRjFOoFMP+jKUU=; b=NwOAavXGFLkqdSgokTDPjp9XTHmJVfeSnH2AB/3N+M4tdXmreX35BQJjvk+22xXiibJN T0KSl8UtuyEb7K10bXWiDDI16i/F5ZOADisRT4UXywZtU5N3KpzlqIy3NJVEy5WbcCOH hxbrczOeUeNigf4ctd/E+5lOnLSzUPT+bQMiGjKwJ9y3KhZur9WZKqeYZHlAbiiZpgg3 3LRKOKb9Zc7WyKfzZAeFjoEJ8eKK5IhU7E9dAsr1d88iydrVL7lJNOpvt4r8r/gXEyga vKDZJRVqKWuXU3zmh53DqFbtQXG8tpGG8dcTTeg7qYhSw8xJoZRGQ1gTxPsQkY20v9o3 8w== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2wkf2y7a2x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 06 Dec 2019 09:19:16 +0100 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 3AFDB100034; Fri, 6 Dec 2019 09:19:16 +0100 (CET) Received: from Webmail-eu.st.com (sfhdag3node2.st.com [10.75.127.8]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 1F14C2A68A1; Fri, 6 Dec 2019 09:19:16 +0100 (CET) Received: from lmecxl0995.lme.st.com (10.75.127.50) by SFHDAG3NODE2.st.com (10.75.127.8) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Fri, 6 Dec 2019 09:19:15 +0100 Subject: Re: [PATCH] rtc: stm32: add missed clk_disable_unprepare in error path of resume To: Chuhong Yuan CC: , Alessandro Zummo , Alexandre Belloni , Alexandre Torgue , , Maxime Coquelin , , References: <20191205160655.32188-1-hslester96@gmail.com> From: Amelie DELAUNAY Message-ID: <521207d1-4537-fda9-ca03-4f952b505d03@st.com> Date: Fri, 6 Dec 2019 09:19:15 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.2.1 MIME-Version: 1.0 In-Reply-To: <20191205160655.32188-1-hslester96@gmail.com> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.75.127.50] X-ClientProxiedBy: SFHDAG2NODE3.st.com (10.75.127.6) To SFHDAG3NODE2.st.com (10.75.127.8) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,18.0.572 definitions=2019-12-06_01:2019-12-04,2019-12-06 signatures=0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/5/19 5:06 PM, Chuhong Yuan wrote: > The resume() forgets to call clk_disable_unprepare() when failed. > Add the missed call to fix it. > > Signed-off-by: Chuhong Yuan > --- > drivers/rtc/rtc-stm32.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/rtc/rtc-stm32.c b/drivers/rtc/rtc-stm32.c > index 781cabb2afca..d774aa18f57a 100644 > --- a/drivers/rtc/rtc-stm32.c > +++ b/drivers/rtc/rtc-stm32.c > @@ -897,8 +897,11 @@ static int stm32_rtc_resume(struct device *dev) > } > > ret = stm32_rtc_wait_sync(rtc); > - if (ret < 0) > + if (ret < 0) { > + if (rtc->data->has_pclk) > + clk_disable_unprepare(rtc->pclk); > return ret; > + } > > if (device_may_wakeup(dev)) > return disable_irq_wake(rtc->irq_alarm); > Reviewed-by: Amelie Delaunay