Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3025197rwb; Mon, 15 Aug 2022 16:23:11 -0700 (PDT) X-Google-Smtp-Source: AA6agR41+k3uF7m6+tW+Fibynb2B91YmdWGYT9u8/SstUKG5DeAWdSo8rgxzcD8pIbHYmuurbG8f X-Received: by 2002:a17:906:cc0e:b0:731:6844:880a with SMTP id ml14-20020a170906cc0e00b007316844880amr11740660ejb.514.1660605791662; Mon, 15 Aug 2022 16:23:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660605791; cv=none; d=google.com; s=arc-20160816; b=lsSTGfBfCazfS12emJPmAWr+4tr3/KFhJ6jDvUpZqbAQtKQZBMz9Ks6IjtcL1QJeoC Wvh4pitulyH46FRfgeFVxJ5ybEPpVVQPaa6rc+WOipOVnivJCr2NgqGcZ0eBpnRI4ey8 3X/TCKcWEHdFz6R2JvZBPsThr10OlJdka/OFhV4uW0bEqaHfoJRfgctDOWD3oC1WL8He 614TqeaN8695sLPWXF4LgxrMMUFhQqYmmpxXm3v11k0HJrkF3zhd1HurTRkamlmf9Hid Pl3MTNx+zrXaqOBwicYb97AbjoNuqDUR0KIHSgQvCOrKW76PUl4LWXFjoHKMQLn+UmqC OI5A== 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=NYhuJbVvHSEeViwQYqduBBGigWY7VzgpMbSLyUfVVtOJ0Ups+byC6TTXDZ79+Qr5X0 3mwmtf2Wi1uf7mWRj/SghX+QsgslsQLn7i3Wh+YxznafBb7+hBdiHsyh5HPQ5vJSqiAr uHNqsDUX7CzrXzW1UKU4Z5F8EFM0x6JgwtauJ4Tbvna4mw/8p/9fw+GH6jqrYm03XsFR Wysq+MtcKFneMQ6LBqbyYUSUJ9gxtI/KHHrrRAIQDO4t3QdRZXIoJhf5h3pVvewOCsse nV2YGeXMrMwbVTNkXxslkpvq7ah+KINikTqzJuftbOHDsWsSm3AlD5YlJYGiwvnghj0d 2Taw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=wtb5w3lc; 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 cw9-20020a170906478900b0072b61694e92si10455047ejc.350.2022.08.15.16.22.46; Mon, 15 Aug 2022 16:23:11 -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=wtb5w3lc; 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 S1348453AbiHOVyn (ORCPT + 99 others); Mon, 15 Aug 2022 17:54:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350551AbiHOVvg (ORCPT ); Mon, 15 Aug 2022 17:51:36 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9582E106FBB; Mon, 15 Aug 2022 12:33:05 -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 E8A2AB80EA7; Mon, 15 Aug 2022 19:33:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B144C433D6; Mon, 15 Aug 2022 19:33:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591982; bh=8yMkKzhaIIy3DNw9qsKXKinY89NRF/Ka1TXvMtoYgLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wtb5w3lczj0nviXn8a5nG2Nkp8JKgSj0TQYHHy2Url6UCH7xwtkf/yRHccyCiaa+l HL5eEjdS5JbYkbo9lFXbQj1n2CzrXb6qu7ktKR9oWIqI3S0jTrusqgJjeicz1F2jTf axuRwGpefMsPrSepl2SRhuwWOjNRVSGauxLqUtho= 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.18 0696/1095] clk: qcom: clk-krait: unlock spin after mux completion Date: Mon, 15 Aug 2022 20:01:35 +0200 Message-Id: <20220815180458.175221153@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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