Received: by 10.213.65.68 with SMTP id h4csp837143imn; Tue, 27 Mar 2018 09:41:20 -0700 (PDT) X-Google-Smtp-Source: AIpwx48S13wOcuvonldffSFvxRpAxOSpKMLIVmfW2cjqwZ3LxfFDNeRAtBDS87/c2ZFHwGIW3tPb X-Received: by 10.99.182.73 with SMTP id v9mr51458pgt.158.1522168880274; Tue, 27 Mar 2018 09:41:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522168880; cv=none; d=google.com; s=arc-20160816; b=pUxqJ48gtRdJpe/VaZ8X+TxB9mSYPhsXyt89+gIQ1VmSdHGZTja7SksPlV8XKFY6VZ HoCybecRC1WJRf/D5w+wQSiuDWlMsRgiQmSg+0jHtmbDKZIJ+ZeGsaLoDXtC9xqalbPn LnZ9WUurMq+ImNBWnmzW2mbsgehrUie/YiadMbGJiZ4zQpTL9zH8HLo+N0BKJ3mxtPNS kgxDxNNS1EDJlf/0KyvEkZX9QRFJBQ6EGQLPW2dYHCMRawiGb9Z2QAYIwEome2nM9Faw 23fpEF7bq+mt7CdZXGL6YT+lAsT2Lx1+lyLRpGE/ZLrZ5DjjDnVvJDbovxM8KXN9Gx5t LvEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=nKVNQU6a0E2XAHYQUqt9LbsAn+VgGWBYRGJiHHJXHjo=; b=sbFqClBeg9hjB9EXaEAxBl1Ur5eaR9iRPPQ2cbnvuEPe55efK/aOG3Hm7JbTSsPNwv n0wcD+lEu5JhFzTMfVEhGkyY66wLz4+uU661JRyR2dvRyucQtdy/Rdet/02J/deydVgm QhDCF5wNMIke+3hDt02uavl/zBbVGk/tqpEPyX3MQB11kUCuudWNXo4ekbxxvS5ckiHa YVIVf7aYYBtxKp4RbUQUHevI3tOTvPqhQHjNWhxVGt5a36E0/fAviWUEcE1ATCh4lR/4 7FyUvYDYo9os+NgXTspD6zrfOwvrXVCtU21pkGMYboOttVFnGWU092jm81dI3WiaFvII oFFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w9-v6si573174plp.304.2018.03.27.09.41.05; Tue, 27 Mar 2018 09:41:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932306AbeC0Qjf (ORCPT + 99 others); Tue, 27 Mar 2018 12:39:35 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:47260 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932255AbeC0Qjc (ORCPT ); Tue, 27 Mar 2018 12:39:32 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 056131027; Tue, 27 Mar 2018 16:39:31 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Boris Brezillon , Eric Anholt , Stephen Boyd Subject: [PATCH 4.15 026/105] clk: bcm2835: Protect sections updating shared registers Date: Tue, 27 Mar 2018 18:27:06 +0200 Message-Id: <20180327162758.996892482@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162757.813009222@linuxfoundation.org> References: <20180327162757.813009222@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.15-stable review patch. If anyone has any objections, please let me know. ------------------ From: Boris Brezillon commit 7997f3b2df751aab0b8e60149b226a32966c41ac upstream. CM_PLLx and A2W_XOSC_CTRL registers are accessed by different clock handlers and must be accessed with ->regs_lock held. Update the sections where this protection is missing. Fixes: 41691b8862e2 ("clk: bcm2835: Add support for programming the audio domain clocks") Cc: Signed-off-by: Boris Brezillon Reviewed-by: Eric Anholt Signed-off-by: Stephen Boyd Signed-off-by: Greg Kroah-Hartman --- drivers/clk/bcm/clk-bcm2835.c | 4 ++++ 1 file changed, 4 insertions(+) --- a/drivers/clk/bcm/clk-bcm2835.c +++ b/drivers/clk/bcm/clk-bcm2835.c @@ -623,8 +623,10 @@ static int bcm2835_pll_on(struct clk_hw ~A2W_PLL_CTRL_PWRDN); /* Take the PLL out of reset. */ + spin_lock(&cprman->regs_lock); cprman_write(cprman, data->cm_ctrl_reg, cprman_read(cprman, data->cm_ctrl_reg) & ~CM_PLL_ANARST); + spin_unlock(&cprman->regs_lock); /* Wait for the PLL to lock. */ timeout = ktime_add_ns(ktime_get(), LOCK_TIMEOUT_NS); @@ -701,9 +703,11 @@ static int bcm2835_pll_set_rate(struct c } /* Unmask the reference clock from the oscillator. */ + spin_lock(&cprman->regs_lock); cprman_write(cprman, A2W_XOSC_CTRL, cprman_read(cprman, A2W_XOSC_CTRL) | data->reference_enable_mask); + spin_unlock(&cprman->regs_lock); if (do_ana_setup_first) bcm2835_pll_write_ana(cprman, data->ana_reg_base, ana);