Received: by 10.213.65.68 with SMTP id h4csp881039imn; Tue, 27 Mar 2018 10:29:42 -0700 (PDT) X-Google-Smtp-Source: AIpwx48xWl84+zWjYHZoTYR/tQNP9KPLVnZqtsLmspPU098vSmdJYaoQvQvanjMoqWcX6NMAWFQj X-Received: by 10.98.223.149 with SMTP id d21mr181175pfl.160.1522171782491; Tue, 27 Mar 2018 10:29:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522171782; cv=none; d=google.com; s=arc-20160816; b=KnFj9q0f9LYE7X1+UFP7LFyvQpyNrE6wQiimevKlZonzsodWjMyMVLbHABwwgdy3de 3vcA9/27KUYPJPtE8PwIp06WkxVyl34hQ9oGewS7Y9DSEUH4hJWwYv7JNQlVD1WnAEgo Zd+NePGvlfTyyYNCPek5JLBcLM6KK4NRXdoVCP0ZXY4Z5kYYC9xHEJpAqg4ZIvzth27q XoC5W1Vi+8VQNt+mRysQJZvTqIOcxbfvh4jPXpD9gh0PuqURy2KUBkQQR+NrJA1nPQnq TnvZzyNLkdsSOP2ySZMiADZsRq8ta/ljQQvyrRgwtgXIaKY9FMIS1gt3E07g3kOjgtdg 8ikQ== 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=67e5QBRxL1rdgJSeBQlD6OJKBuKPQUH9uUN0jSdSGPk=; b=Uio/ZfntAvzq5EU2mBJKURN/ZfqUqFsOfXR7ab/YOtlTT+D6McTZLNNfpXNVtQn2bn cM2/NmH/J8/vZiiu/oNl2YwKHPhvhbOa5YEFiBNHnx1VzSGd0WiXuB7MQauaGSq+DRin 8ePO56ltzie6+22DAdtSQW9L2qfPIILyklqRimlKS6Vr8aFPUsTvPzG/wp40YN7h5Eej he5EzY7fl6sGrMHedUc0YaKzmiwdNNvpXgISXN2C6sgxemfz/HwOfBMwlAl5Ssr1kWfO YhxiqUamW4kmwVvSdW8JKjGGOvfJtHGWK4XxRdQaO9jxSIrPkxNEV5o2dnysJLo0u1CI tD4g== 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 g15si1119887pgf.541.2018.03.27.10.29.27; Tue, 27 Mar 2018 10:29:42 -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 S1753382AbeC0Qga (ORCPT + 99 others); Tue, 27 Mar 2018 12:36:30 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:45774 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751486AbeC0Qg0 (ORCPT ); Tue, 27 Mar 2018 12:36:26 -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 754B1ED4; Tue, 27 Mar 2018 16:36:25 +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.14 026/101] clk: bcm2835: Protect sections updating shared registers Date: Tue, 27 Mar 2018 18:26:58 +0200 Message-Id: <20180327162751.593619068@linuxfoundation.org> X-Mailer: git-send-email 2.16.3 In-Reply-To: <20180327162749.993880276@linuxfoundation.org> References: <20180327162749.993880276@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.14-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 @@ -653,8 +653,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); @@ -731,9 +733,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);