From patchwork Sat Oct 13 00:55:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brian Norris X-Patchwork-Id: 10639787 X-Patchwork-Delegate: kvalo@adurom.com Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E2F1A14BD for ; Sat, 13 Oct 2018 00:55:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E0CEE2B719 for ; Sat, 13 Oct 2018 00:55:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D520A2B72D; Sat, 13 Oct 2018 00:55:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8DA5D2B719 for ; Sat, 13 Oct 2018 00:55:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727034AbeJMIag (ORCPT ); Sat, 13 Oct 2018 04:30:36 -0400 Received: from mail-pl1-f194.google.com ([209.85.214.194]:38455 "EHLO mail-pl1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726956AbeJMIaf (ORCPT ); Sat, 13 Oct 2018 04:30:35 -0400 Received: by mail-pl1-f194.google.com with SMTP id q19-v6so3575749pll.5 for ; Fri, 12 Oct 2018 17:55:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=szr5KLhOEepnxhuji3Nc/YMARBLGRK4oTE2y29Q5DuI=; b=Vf2+ez732wRfmVM5sn8xhWJ3KJnSnR4AoDZzbC6Vwr6SxJ2oi+WphOdQ7d1JF1g/VW DsWjigQ6B3oVlmy6rHzucW3S3IsbNj9y9HiY5cQzFKImG/RuJJbnS1UakIeCGlD7ip45 X+G/DJNufbQ4WVt1LKM36ZidXZOhb5pZ7DeB0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=szr5KLhOEepnxhuji3Nc/YMARBLGRK4oTE2y29Q5DuI=; b=KYuv7Tyrz0yHsWg+iBQPqEctkWFxDTDvt5lx9xSy665BoqX3aosJiAqOUSshyA0Pl5 m3M/nu0fBfEArOkJ3WFuh2QOuh47Lf2tJQtCcWRDNoJmjGJBm1jshTPUd+fApIEfnWlN GgsoLJnNoZ5+p2NKLqCR3frryYZwlb97+33GANCYaewSa8Umg83sVp0FTtPe7r1yt0SD X9zTOpmzwdQ0Mhk1QOed6nV9WdLOxhUM9JLQU8I2I8PCzlonV84cs+NoV+I/wJvoe4dQ NTzNRV0AY26ADrx56d8VyPGK5yrJ58MrMxKXISMDDRENFTYCCnFCkZj6LgGHrtlAUXtO B+sQ== X-Gm-Message-State: ABuFfoiQYjvc12leHbnzEzsUmGTytknXZd/ddgLKqJJ42DDWpXNbfmsf r1bqB3vr0vpqqgbjjMQa1RsPug== X-Google-Smtp-Source: ACcGV61Zu1kR1AYSCorKL4Rnwd2Ixd4lQtWeU4CYJ3liGav4XVMNIc+mMIc1AgBkcymlOtFlH5hF9g== X-Received: by 2002:a17:902:50e3:: with SMTP id c32-v6mr5923263plj.129.1539392134274; Fri, 12 Oct 2018 17:55:34 -0700 (PDT) Received: from smtp.gmail.com ([2620:15c:202:1:299d:6b87:5478:d28a]) by smtp.gmail.com with ESMTPSA id n7-v6sm2766183pgv.63.2018.10.12.17.55.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Oct 2018 17:55:33 -0700 (PDT) From: Brian Norris To: Kalle Valo Cc: ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, Govind Singh , Doug Anderson , , Brian Norris Subject: [PATCH 4/4] ath10k: snoc: fix unbalanced clock error handling Date: Fri, 12 Oct 2018 17:55:04 -0700 Message-Id: <20181013005504.46399-4-briannorris@chromium.org> X-Mailer: git-send-email 2.19.1.331.ge82ca0e54c-goog In-Reply-To: <20181013005504.46399-1-briannorris@chromium.org> References: <20181013005504.46399-1-briannorris@chromium.org> MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Similar to regulator error handling, we should only start tearing down the 'i - 1' clock when clock 'i' fails to enable. Otherwise, we might end up with an unbalanced clock, where we never successfully enabled the clock, but we try to disable it anyway. Signed-off-by: Brian Norris Reviewed-by: Douglas Anderson --- drivers/net/wireless/ath/ath10k/snoc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath10k/snoc.c b/drivers/net/wireless/ath/ath10k/snoc.c index 5a8e87339df2..a835599a8d55 100644 --- a/drivers/net/wireless/ath/ath10k/snoc.c +++ b/drivers/net/wireless/ath/ath10k/snoc.c @@ -1470,7 +1470,7 @@ static int ath10k_snoc_clk_init(struct ath10k *ar) return 0; err_clock_config: - for (; i >= 0; i--) { + for (i = i - 1; i >= 0; i--) { clk_info = &ar_snoc->clk[i]; if (!clk_info->handle)