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: 10639801 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 015D614BD for ; Sat, 13 Oct 2018 00:56:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F0BA42B719 for ; Sat, 13 Oct 2018 00:56:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E54B72B72D; Sat, 13 Oct 2018 00:56:14 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id DB32D2B719 for ; Sat, 13 Oct 2018 00:56:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Xr0ZvL+U3r5i2Yekxyc4t6lqz+XuT+gPiwHan9IsN88=; b=Ialwh8ohTQttKN GQro5ih0dLYPPLSbrUmGE0JLXqlknaTkVHyEfBttgvactE/YwK9UBJE6SQURHMC66qPuh+S6KHL8l EJLtUyg6erY20/XZrojI8ldnO5/miFO+acIkpUKU2USC+fdQkPriQqFQ4NZHCg+VfFMR2/+eTcUCQ 4v1gVYvQw6LOPqBXm6vCPDUCG2tdKyiWEaf36KD8qDN5AQjiuCsVmw4n2/nWKDZpY74sI6sOS950c kx2ziuPjar7z8dKxKT/j4xu3Nb6ddJhnktJbX6LHlTI3C8XsTYD8mfzQppjaGgU6QIbcjKfkWkclX V+VoQ4cgHhNhvTNbSK9A==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1gB8Dw-0001eo-MJ; Sat, 13 Oct 2018 00:56:08 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1gB8DY-0001Lz-PN for ath10k@lists.infradead.org; Sat, 13 Oct 2018 00:55:50 +0000 Received: by mail-pl1-x643.google.com with SMTP id u6-v6so3918278plz.4 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=HkGB4JuiK8DoTRcGEBupAgs5Y6ItU0UIKfj1ZFNuW7EpSLByPZIdGw1sNmZv0mYaAL uzQW8Iue/rHLi0raPXp3ohYIeMd9QPg8e+tM2Cn8g8WqRQfO3h87jvxP585IVWjEYQrB YxV4bOt4bhozHrLi+t6V9ii+U4kV8XGmMQDVMkVewC0Hi8y7KvxbjNiSyWB78FhE+Kro bjpezp90V4Rs1OnNUhx1uU+v7DMpuMdJfcsVT+sLu+Jh0SS7K5sxO92apxhqPawbM5pB KH7QHW7WXl/srAUQ2tuVF871LB9BD7bnDYKwjoqMzqz7FQFhm1MS+NLi/mP1s4p3gziS IykQ== X-Gm-Message-State: ABuFfoien6jvdZ2milAtmFifoMMhkVhqHBAqaAiwuSjKJTsThccpVJRI 4TOsoO+ETm1g0IHrjG/F6eJCog== 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20181012_175544_853841_B9231AEC X-CRM114-Status: GOOD ( 12.93 ) X-BeenThere: ath10k@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Govind Singh , Brian Norris , linux-wireless@vger.kernel.org, Doug Anderson , ath10k@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "ath10k" Errors-To: ath10k-bounces+patchwork-ath10k=patchwork.kernel.org@lists.infradead.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)