Received: by 10.213.65.68 with SMTP id h4csp907447imn; Tue, 27 Mar 2018 10:59:11 -0700 (PDT) X-Google-Smtp-Source: AIpwx48m9T8+W3LJAQyZPiMrmX45PISzp8wPP+/VuLPuvNljQjNLsu0uaHE6KeWQPPsSUGkQIuaA X-Received: by 10.101.97.178 with SMTP id i18mr176655pgv.439.1522173551487; Tue, 27 Mar 2018 10:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173551; cv=none; d=google.com; s=arc-20160816; b=i81PCAMyLjdmAzJUILImgJHfymxlmEP2q0Sp9miqWAELXvdQ6KycSWlccl9MiJpUED zG28SfXYirdPnHtBVLMdHcfgC854xHBaOcpH+PKLdpZc8V0Uu62d/juyaGujMd6Gbp5T tplBzEITF4raRAz/4RP38ql9vfop7R579AtIS3Ujom3MfDOBiR0DMzookHT4FvpxUw/9 vdDe9JDuNa0gik2qH62+zyWiqG/VC97En1XjMVzmkGAbbxKaJX6cd8huIo0ygrMuTLLf dxwks+ZkpL6fsfKzskQOQaDCDkvKWZ7qpIYSq1MFYQgv/RFf7Pd3lwROENoajuv04SOT oHsg== 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=tknT5t6PiLR8Rr/sHO2gxgfbumwh9Yv238OeoK8usK4=; b=ub2jJRhQhUzkOSJoPJhGpKCq+nC8kuUchBiPvKtQTb1jOGq9j1Al+jiEofvJWjZrzW oKQVXcbCHVphkTTnLUvQGpaMJPn5rXpclA3lIpRxqk4Nn7jaKhhEchsycLKHqRKaKklr 6cGgypegeUUosnqA+U9BFLfjpsn87DL2f+QXCoL4NQIBu4ubhloqsEZvzDTTyS+lv84P Mk24Ms+le311SPsaEbJtyVgLIC/Pg48NqM9/XiD1Oo0Lf6vPZzSqS+Lv6yfdM6rQiBgj 755AN3W4+OOC9bZI8ttdSau29Lg1WSgFUh8GdkJgGJAzfef1rtaQhIjtWN6tQcnYUa76 owhw== 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 s3si1261150pfj.50.2018.03.27.10.58.57; Tue, 27 Mar 2018 10:59:11 -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 S1753182AbeC0Qau (ORCPT + 99 others); Tue, 27 Mar 2018 12:30:50 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:42532 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752259AbeC0Qar (ORCPT ); Tue, 27 Mar 2018 12:30:47 -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 E7053C0F; Tue, 27 Mar 2018 16:30:45 +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.9 11/67] clk: bcm2835: Protect sections updating shared registers Date: Tue, 27 Mar 2018 18:27:03 +0200 Message-Id: <20180327162727.316212345@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162726.702411083@linuxfoundation.org> References: <20180327162726.702411083@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.9-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 @@ -566,8 +566,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); @@ -644,9 +646,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);