Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2879440rwb; Mon, 15 Aug 2022 13:10:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR5MyaduE9KpZlMZMhE6wKu8kwPe8TRLUJ3X4HHlXr88wa8uWeUB9MGFsKCfIKYfsiMkeLeU X-Received: by 2002:a17:90a:982:b0:1ef:f525:9801 with SMTP id 2-20020a17090a098200b001eff5259801mr20397255pjo.191.1660594240372; Mon, 15 Aug 2022 13:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660594240; cv=none; d=google.com; s=arc-20160816; b=sJSxYEz3fgwMykGxAXiHEiG+WLWCX4CIPA8H3PfsP4r0TvdfYWdafKyVCLiopOgy/6 FGfykXBB4meXFZ6O/1YngyAF7XkQnzRWjVCEyxDFbPKaVk/rmm8I9Ab9jPAb+stTfe8s bCHm1IkRtG2Kp6K+n9mFuFNrdgXsHV/Oi7RdnygSnlMeKh1rZ+zWbVZCK808rHk+hlbs pNZho9Phs11LvB5FaItzg+pfMg/sflY+Na0nzv9lAjPfFezVLaLo71KbzbkARf8s6MaT DG8thS0pNd/1BVo3eowun43mq3C1rIcmV4dvWVfzbNSSeQrfrY5cCKztqzK+4FnQVrz3 jB3Q== 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=FwBwJYjtTlWHBySFiHFpfC3S/XS1TEtMRi1Tzky5RbdMGsnnJ663bRnP8sivhP8K0I EiQT3h1tOpN6UubOcVX3sdsWzxU/8h0UYPPiUEIz8aKfoT1D3GEVIoTfYYG/HOj9bdiT jhprsqrQ7It7b62054vFgMpRWPHxRM/TMsqJluSSIHrLLqe/GxG9BJCzgRtcdJKR3J8k 1m2A20i8o+vQKsn4dWntQ2O5zNdFCx8VVqu3RMvyJIohHM2nRBVzQPnDucVX4udQFXUO fRXSYhRJZgYAXF0qIk6U0tOWhpDsPRWw1YisBhEOMCKKu+hZa67i0TzVTfpZuHvQ7wWS GCFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=xvsLAWMS; 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 e1-20020a170902e0c100b0016f86a21198si9225629pla.610.2022.08.15.13.10.29; Mon, 15 Aug 2022 13:10:40 -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=xvsLAWMS; 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 S1343830AbiHOTNK (ORCPT + 99 others); Mon, 15 Aug 2022 15:13:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343641AbiHOTJd (ORCPT ); Mon, 15 Aug 2022 15:09:33 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 653F62B189; Mon, 15 Aug 2022 11:36:03 -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 dfw.source.kernel.org (Postfix) with ESMTPS id 00CB661019; Mon, 15 Aug 2022 18:36:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 775B0C433D6; Mon, 15 Aug 2022 18:36:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660588562; bh=8yMkKzhaIIy3DNw9qsKXKinY89NRF/Ka1TXvMtoYgLo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xvsLAWMSXZsnkROXT9v7EjLUDEFv4tVXziIdsN8G4mLlzfXju93ihoRn6f/rEWM58 PkrB+jjRigIPmi9gRzK47A6YAz/PhSXs0O1QI/k1MktV/K3b+/TDG2gaH47MbJNf0k A9frfXdE9HEiEEdhIHUafTYCg6WChk9BgoJDzr/I= 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.15 443/779] clk: qcom: clk-krait: unlock spin after mux completion Date: Mon, 15 Aug 2022 20:01:27 +0200 Message-Id: <20220815180356.203257575@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180337.130757997@linuxfoundation.org> References: <20220815180337.130757997@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