Received: by 10.213.65.68 with SMTP id h4csp912686imn; Tue, 27 Mar 2018 11:04:25 -0700 (PDT) X-Google-Smtp-Source: AIpwx49T7YpBw9We1Nh2wONP0QRUughJTkfrCOS/afPzh0lHN/jQbhu6rIaOni12+iA1xdGbBDaI X-Received: by 2002:a17:902:a981:: with SMTP id bh1-v6mr303758plb.255.1522173865453; Tue, 27 Mar 2018 11:04:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522173865; cv=none; d=google.com; s=arc-20160816; b=w9yC0QRzAJPP2knrVUsBaut1ymjTTObIyh/7i1U3LQZiQgQ6YMuch6pvSStaLljvhL r16NwkzPUumifQHKY3u6MeSAVxrwZbok1kFLnHVoTikbcCZ/SVkeJq7ffa9YI4lsNc8R xEjjq8hdQSZIrNMn+wvNrQuAXItiCrmMpgmb+850d+CEeQ4ugwXMdSnKd2YcWd/swW/e QLYUnu2pY5BhldCaTRY9dw9CIhf/UDWQ9e+I1XD/+JcFJkKc2quGuG1hTwJ3K+w6m+8D 5GlkIv9TSgTII8X/52uSopbApZq014i87l3C8EHicolE732mjPYNMgtDSEl5aPgVPlHh W+DQ== 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=mgANRZNDVHh844OyEVTFAs5yQnBFO5j8bra+cCoBF0E=; b=Mn1VN8fibSH6CgTcjIh/Gh/cJb0BsY0ux3JcfjH+HXNDGFnUoOydwvHGsKBSqKm8hF 0EUsZemTSNyBvY0uUVRavif8JYjwLnDI01Ophy0lh1SOS5nYHFEYh8/+Pi3jFm+5A3Ud BOuRPNdMApFp8c9bc6VAJ6jezySfUHYptacuHJFHq7ZadYrVreEk7+ZabexFzZ3AxPmg cibJ8Yy3Yy9XqZdmoFATpjy6DDeV4vRj/G4Hojjw6wXcDIYxQa7CIVBeo7trWPDcG9TV wncj9+Lzm7IWm5nokN1E2Y/O8iRqqaQbBtQO5VeDN4CZNWRlohTxQgnpYar/iIoAzWyp 8zAQ== 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 k2-v6si1661653plt.413.2018.03.27.11.04.11; Tue, 27 Mar 2018 11:04:25 -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 S1753125AbeC0SCT (ORCPT + 99 others); Tue, 27 Mar 2018 14:02:19 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:41552 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752889AbeC0Q34 (ORCPT ); Tue, 27 Mar 2018 12:29:56 -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 808361107; Tue, 27 Mar 2018 16:29:55 +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.4 10/43] clk: bcm2835: Protect sections updating shared registers Date: Tue, 27 Mar 2018 18:27:14 +0200 Message-Id: <20180327162716.939196093@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162716.407986916@linuxfoundation.org> References: <20180327162716.407986916@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.4-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 @@ -912,8 +912,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); @@ -997,9 +999,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);