Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3113926rwb; Mon, 15 Aug 2022 18:26:48 -0700 (PDT) X-Google-Smtp-Source: AA6agR5DObs04S4cRxG0708DohP45vB769QXLJQUNMTuXFprd4/frH2nPFgPYrf3vqX68mmy5cc7 X-Received: by 2002:a17:90b:35ce:b0:1f4:d048:74d0 with SMTP id nb14-20020a17090b35ce00b001f4d04874d0mr21301807pjb.45.1660613208711; Mon, 15 Aug 2022 18:26:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660613208; cv=none; d=google.com; s=arc-20160816; b=TH6mHG0mQRHgLR7t0WY7JGUdIdCqryXQXwVlazv/Q7E10shPrVOJAzpOE+RYav6ypk xyvKdhnmiAIZIaVVLNyXFnPuUu3fGCAFgF0f6W93lYN1WZ2zduooXgmENTXm3+DuePGL iTLgWg9md39jgpEsFcvDirkHgB4QsKqTJbs1b/X5PezyN2pQJcExWbg7MoBrB0duysqW Y+uEVlUwBuKLYI1+9ylO1i9KmlGmhm/pR5T0eNKgq7tvcFC3rcGIkYnWEVfDxBE9Z5kR jgSorggq/GGk41HXom6E5odQSveMqNnMMSILnZKKOxIzZYceYpJgVqy9Kga3UOtIH3gh LdvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0PizFzX7WcULu/L/bNnG61/Gzq/YKVwHJYBY6RJYu7Q=; b=K6DQkNwj+6UBkaAJ72XYvXoW5R3C4cJeKaQy4Le0YjiWL8ijHs2Urfj+F79Oa+4DVB VS4rBmmUT6OS6XmkvSSHVOAUUZrXSLybKnhkBdQJ+Gk1/7wIw0FlCQwY3F/928zylp3g 2xMigX/Sj6lROSA/DW4MxBxgkd4+XAIulg7AokPniWXfMfDBtM4b6UTyJGjCMqUEaelJ GQisZBSYQEBOIjSFcCR7lSDNwbBEFkSf1XgqkO4huwlZAe/HWLNRtH/+reBJ2eAM5uWD DdCx1AfcTvcnnKr44qt0+vO98iSjgkp8NA8Wkgfr9scUbEUr75yWTOFv0pvqtDd6afJL bAIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NadCh0N6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a19-20020a17090abe1300b001f2d4a96b60si10649168pjs.144.2022.08.15.18.26.37; Mon, 15 Aug 2022 18:26:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=NadCh0N6; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352679AbiHPATK (ORCPT + 99 others); Mon, 15 Aug 2022 20:19:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60092 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1357020AbiHPAM5 (ORCPT ); Mon, 15 Aug 2022 20:12:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5C8D617545E; Mon, 15 Aug 2022 13:29:37 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 80792B811A5; Mon, 15 Aug 2022 20:29:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id BD051C433D7; Mon, 15 Aug 2022 20:29:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595374; bh=8yMkKzhaIIy3DNw9qsKXKinY89NRF/Ka1TXvMtoYgLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NadCh0N6Jcf7rBc1+JZL1hNfCxwZIyRXALXLokeW62+DhSv3ExmRKtTvhhcDee6/o y9TyndTnZcscPzrkb14MclvBjKh0lMbbuP2WGOh1eNB675OvuJ6srDGQjMqkCDLyM1 d3s9mZDohovdbb9vbGU+6bdPP6/u2XS95Y0rN7is= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ansuel Smith , Dmitry Baryshkov , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.19 0744/1157] clk: qcom: clk-krait: unlock spin after mux completion Date: Mon, 15 Aug 2022 20:01:40 +0200 Message-Id: <20220815180509.227870647@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ansuel Smith [ Upstream commit df83d2c9e72910416f650ade1e07cc314ff02731 ] Unlock spinlock after the mux switch is completed to prevent any corner case of mux request while the switch still needs to be done. Fixes: 4d7dc77babfe ("clk: qcom: Add support for Krait clocks") Signed-off-by: Ansuel Smith Reviewed-by: Dmitry Baryshkov Signed-off-by: Bjorn Andersson Link: https://lore.kernel.org/r/20220430054458.31321-3-ansuelsmth@gmail.com Signed-off-by: Sasha Levin --- drivers/clk/qcom/clk-krait.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/clk/qcom/clk-krait.c b/drivers/clk/qcom/clk-krait.c index 59f1af415b58..90046428693c 100644 --- a/drivers/clk/qcom/clk-krait.c +++ b/drivers/clk/qcom/clk-krait.c @@ -32,11 +32,16 @@ static void __krait_mux_set_sel(struct krait_mux_clk *mux, int sel) regval |= (sel & mux->mask) << (mux->shift + LPL_SHIFT); } krait_set_l2_indirect_reg(mux->offset, regval); - spin_unlock_irqrestore(&krait_clock_reg_lock, flags); /* Wait for switch to complete. */ mb(); udelay(1); + + /* + * Unlock now to make sure the mux register is not + * modified while switching to the new parent. + */ + spin_unlock_irqrestore(&krait_clock_reg_lock, flags); } static int krait_mux_set_parent(struct clk_hw *hw, u8 index) -- 2.35.1