From patchwork Mon Oct 24 11:28:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8552 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp417097wru; Mon, 24 Oct 2022 05:12:37 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6C/RzocyG1rpptImhuR34BoLGg3L2AcpSzkdrkO1zkmCd2Qg8PvtnChOITrVufsE+EEmLJ X-Received: by 2002:a05:6402:540d:b0:450:bda7:f76e with SMTP id ev13-20020a056402540d00b00450bda7f76emr30641276edb.249.1666613557259; Mon, 24 Oct 2022 05:12:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666613557; cv=none; d=google.com; s=arc-20160816; b=q1ZGOdHxBQYB96CZAXXTgQsqieURKsBv2LXP2oVavJ5N+iiswmbrD4Erxu/molT/fP 3UPfkNIzmwnCY1K9QUi6NOuw6zLY0YhQQW+J8wMBdFE9Hz326+f1/1pt3CuSFR69z/xu /VZ0R/wA8fLwk51ilOUKeToc0rxvBtzrFIdn3z6civ+6qFOAnH8VslscbsxWMP5dv38x nJ7ntvEVp9piXMPEfydMVI/sG+BojE79yKCNAVCpsaosH6b9Y8/3JjCBug4CSFh8n0xK XGJPLENb27NAwk9rj5rvbOU/7WG08FC5PjorHB0DIyptkmtkceXj4879l5IxssyjFTaz 6YlQ== 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=Mff6Wq2CHDJjuHXooZbjA5R9abR1cVLwkQ6ZvK/C0iI=; b=ZJacfrZmPjSZmuKB6GfDryor3PKuZWUyAksxm4aYBi+btLHadKkvngwgi2iSGrz+3K qeP0poyKqKUBFxvDVVU69pI295+v8uicficFuTxjGt1mewc2FrK2kMq7qP2chus9tbFO MaXycEf4duDADSIm/7WJKWavOCRPtRfOd7+1ed5BeN5TYNG6Hwv+H1hmPN0mtl8IDCmr ZRCmBRjgWsFw1PUz5hqcLRn/RiVcB2idTEH/ZTWOr9Pxi2VD5axTEC1iomxzRo992Vx4 IRLA3CWwCT8EbLntTrY5Uwu3zCnlwupb3xsgl3mk3mmR3P7PoelcxHxCrvNiq1gyT4rI kDnQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=15Xvcaeg; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z14-20020a05640240ce00b00461b8e2c7f4si3814959edb.548.2022.10.24.05.12.13; Mon, 24 Oct 2022 05:12:37 -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=15Xvcaeg; 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 S232276AbiJXMAV (ORCPT + 99 others); Mon, 24 Oct 2022 08:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58004 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230372AbiJXL62 (ORCPT ); Mon, 24 Oct 2022 07:58:28 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 286D67C1BB; Mon, 24 Oct 2022 04:47:45 -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 ams.source.kernel.org (Postfix) with ESMTPS id 7820EB8113A; Mon, 24 Oct 2022 11:45:42 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CE9EBC433D6; Mon, 24 Oct 2022 11:45:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611941; bh=bv+YjerPCNsSGuoXywI9SmTXpCLVVrrMngsjwcsVIM0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=15Xvcaegzk2rwwH57XeJT3iqaqfx7qLd3rALYTmgwX3hH0F8uhhxef24vcMRoSL60 JXKML8p7POrv9szbZD5yX9rur6ejLnbuPNXZRnM6GAyD1f5KnVGoy1mXMMXh4wqbcp LCo0VS1mVbluvm3g6EZlczHdC1fXPDU4Ty2KpPgA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jernej Skrabec , Samuel Holland , Heiko Stuebner , Sasha Levin Subject: [PATCH 4.14 010/210] soc: sunxi: sram: Actually claim SRAM regions Date: Mon, 24 Oct 2022 13:28:47 +0200 Message-Id: <20221024112957.223383204@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 X-Spam-Status: No, score=-7.6 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747570977585784204?= X-GMAIL-MSGID: =?utf-8?q?1747570977585784204?= From: Samuel Holland [ Upstream commit fd362baad2e659ef0fb5652f023a606b248f1781 ] sunxi_sram_claim() checks the sram_desc->claimed flag before updating the register, with the intent that only one device can claim a region. However, this was ineffective because the flag was never set. Fixes: 4af34b572a85 ("drivers: soc: sunxi: Introduce SoC driver to map SRAMs") Reviewed-by: Jernej Skrabec Signed-off-by: Samuel Holland Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Signed-off-by: Jernej Skrabec Link: https://lore.kernel.org/r/20220815041248.53268-4-samuel@sholland.org Signed-off-by: Sasha Levin --- drivers/soc/sunxi/sunxi_sram.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/sunxi/sunxi_sram.c b/drivers/soc/sunxi/sunxi_sram.c index 882be5ed7e84..97bb4d8007ff 100644 --- a/drivers/soc/sunxi/sunxi_sram.c +++ b/drivers/soc/sunxi/sunxi_sram.c @@ -253,6 +253,7 @@ int sunxi_sram_claim(struct device *dev) writel(val | ((device << sram_data->offset) & mask), base + sram_data->reg); + sram_desc->claimed = true; spin_unlock(&sram_lock); return 0;