From patchwork Wed Jul 7 09:40:29 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aisheng Dong X-Patchwork-Id: 12362359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6E61C07E95 for ; Wed, 7 Jul 2021 10:19:49 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 82DB761C98 for ; Wed, 7 Jul 2021 10:19:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 82DB761C98 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=nxp.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=8nt2USaCsnp2MyFvnZ8qHDopS/h52HrnjcB3pG0mDhk=; b=tN/9iT5rh+0g2H AKOADYHJF8qWutwsKyOvr3AWs+HNynTnj8OTlw0ss4rzgDr+clY54iK0H21vtZBKrH98h4rUBBwJK qHRq0/M+ZwtLQgTuccM9HpMbjpow7yfjj6s0ICRhot9vF5EMoEASffqdPdPJ2QWZdAkpOPqX3oQ92 dtkcE3EdKZDolQPxRWwYUFtjVACDzy7iY7f+1JnUVncIGwvS2bsOKrPycOPO8HXwSsou04gvLnXpg jRhWtwTLosan8pjgRKYYrmr1uOOqWQ2I3kgVZUcN1s2n7g7SAsZIdMEBrd42I4bywLNf+prw3KBim mvuBIfGcAfnYmIadjH/A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1m14bT-00ERTd-Rq; Wed, 07 Jul 2021 10:16:29 +0000 Received: from mail-am6eur05on2065.outbound.protection.outlook.com ([40.107.22.65] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1m143f-00EIHm-Jl for linux-arm-kernel@lists.infradead.org; Wed, 07 Jul 2021 09:41:34 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=BoJrQ6FE8KDaR3Jyge9c51Tr0EqiCwZM0PSxn1jMusiIEV+QTKHGp4ThMQeg6g7og7BYgoEAjHkCss6uIu3dqbzWjOj3hFqUHUIL5EkhGong8hQiJLhX4GPsVslDIc5OUnuEN0UkeaSXw+CLwueb7KJ5i8K0Z+VZIQmfUI20loWwyMraPHmzV2nRLx7JBJ5NUiG4vjdQpRduxfkZ3K6S1axILSd4Vdim+WtQZQ5FEmTIP/SNNMTsyvl5IWX3hsWRgL+W5/XqbjMKgynJuMiLhCq3aMhsisCZqI2igMJjcdcSJ8y1ktUr36wRTGk8hm66kGndJm5Syw7Y241FamlJyA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKsbWyfe07PseCqnlASYSgLMBrjN+fKjPpDfJ2JrCSc=; b=JW8rgsZPyE8A2lFzsJp3uCwhsAhK5su++dZwiYrBTM8JjAPynT5i+A9ou93m62V1jUNqnTmtayCkdFU7wGx2Bn/n3LaGkXht8XOABREVIOaHG5ZKrSjwsXoklMgLE0YM5U9jWpy0mcrO8OMgvis+wJO1SprEfqS2bekztetQJWw8jG4MIU9b7piL9S8lfAwoDh10s0BKzsArT4VJmtsKT8whBVzrm29VoitpfK47pgOzmREbvyIjWCpAMwwfGc2trzsccOzwBM4A3ns3TEyiFpzrjCtD3BilrT/OUbGIH5tX86wOLXLvUM6VFB0FFT9/KCJnWNgB7KwG/BWJ/bM+4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKsbWyfe07PseCqnlASYSgLMBrjN+fKjPpDfJ2JrCSc=; b=l0t62PBviupkUOCZITq6TAGK1Z2gCsfWYjcjluGJqtn+hM96illfymbjl42I3QCOSVuDRKDF3Uc39VsYNVHtyyET0MTBzdGHv0QYVtH652ViKdRHLknwCefDwSCao1l+8AclWO82fEK9ZUy+l+qaJl9CkJ1sfbJ5672vxMHS4WI= Authentication-Results: vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=none action=none header.from=nxp.com; Received: from DB9PR04MB8477.eurprd04.prod.outlook.com (2603:10a6:10:2c3::11) by DU2PR04MB8824.eurprd04.prod.outlook.com (2603:10a6:10:2e3::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4287.23; Wed, 7 Jul 2021 09:41:28 +0000 Received: from DB9PR04MB8477.eurprd04.prod.outlook.com ([fe80::9daa:ab21:f749:36d2]) by DB9PR04MB8477.eurprd04.prod.outlook.com ([fe80::9daa:ab21:f749:36d2%9]) with mapi id 15.20.4308.021; Wed, 7 Jul 2021 09:41:28 +0000 From: Dong Aisheng To: linux-remoteproc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org, ohad@wizery.com, dongas86@gmail.com, bjorn.andersson@linaro.org, mathieu.poirier@linaro.org, Dong Aisheng , Peng Fan Subject: [PATCH V2 1/5] remoteproc: fix the wrong default value of is_iomem Date: Wed, 7 Jul 2021 17:40:29 +0800 Message-Id: <20210707094033.1959752-1-aisheng.dong@nxp.com> X-Mailer: git-send-email 2.25.1 X-ClientProxiedBy: SG2PR03CA0112.apcprd03.prod.outlook.com (2603:1096:4:91::16) To DB9PR04MB8477.eurprd04.prod.outlook.com (2603:10a6:10:2c3::11) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from localhost.localdomain (119.31.174.66) by SG2PR03CA0112.apcprd03.prod.outlook.com (2603:1096:4:91::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4308.8 via Frontend Transport; Wed, 7 Jul 2021 09:41:25 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fc235263-4229-407a-6666-08d9412b64e5 X-MS-TrafficTypeDiagnostic: DU2PR04MB8824: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: a7+jf2P3NQ0pdNOSW0e115pxpNihia1haT80Z7EFcPUq9FzMqhHdPRG/deN8ay0v//vDL2NmltYgMiMPQzzDq2CsefCQHWU6MhUXHrQ9uJ4TyshBsgl3EkqPZgoguqWJ/ncWeHLLXehKPEjb4AnBmBbaZOZlc15lurCic4t8aj/n2RCtnaaZ+UIj1TBx/yucWW6TnmkV7WpodcD29CCeMLwPaFYNUeX6nS8Mrr/P8iM0TECTKv4u0JVZb78CWxj/PQSbGD2MkZlkW+Wd6d1yzIP4ut74N1rdmP3ZnuRRsfhvM+YASrsxv8IlHI/EMgWNBZplMmuFMBYBf6ELYWOnbHAwJuE8QqzhkN/z9cROUxLNMkoOlSOfPG5rF6A1CgSEidFsrueZYFdv4mAbCrDoQFm8VI3uDsWhxMV2hFxi9a6IYTrj47kx4SrM2pg+ERR1Pr1c5ZE7Gld7y/4825XObS9L+8OBmPGJKG0lsuENiM6BHcJ6eMknTePgCCPiiES250g70IoM+LtrXx864JfiEXvZMR9zFEbFQGcweh5cVgrB0fKrqTDSRPL2ZuWK53lqJS4bHQHwvVtIC+ttM2E0ztCnBhVy7AfY2rb8yCgVcH1CHhXgxCoYYtIOhY60IPehPdcQ2Mq5XI5hq8L0UeabRMhX0Xd6QjMMrWwVnmvunj/0zD7a5igga5f7qC+rcCoqJqvGMFo2/86Pg4DgfK6ieg== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB9PR04MB8477.eurprd04.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(396003)(39860400002)(346002)(136003)(366004)(376002)(5660300002)(316002)(66556008)(186003)(66476007)(8936002)(66946007)(36756003)(54906003)(6506007)(478600001)(86362001)(4326008)(83380400001)(2616005)(52116002)(26005)(6916009)(38100700002)(2906002)(38350700002)(1076003)(6486002)(8676002)(956004)(6512007); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: lJ/juckwM7NSWXTAhdvSOADklEsyKcsT4wc2Rsl0B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C+d3wBM6q+KxhYVpBwSh/gBmQpg1YBcrVZ9hCsy/owV/m83q1lPyOdLNgsuPoP5R0gQB4LV64ZvOZKyWAVZkPhWlGXUCLBH8sVokYKomSWC0hcDaHGhDbunTgnMyLm3iA+n1wG+h7dDfJoDc4vIkavkxlmVQgh/e3RaUMl7DZej92vzR2pW2ZGtc11z41rng4f+fgMJW/bkhHQtTC/+VLu+NneMKMRH3OazM4Sgm2k X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: fc235263-4229-407a-6666-08d9412b64e5 X-MS-Exchange-CrossTenant-AuthSource: DB9PR04MB8477.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jul 2021 09:41:28.5613 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7EKlvcsZWS8bDDse4Sd8bYB7oDTP/ERBF7HMciB76OHt1Qxhh2O9TGU+5GFPziO9KL1lj1Z6QF38qlliE0kyBA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR04MB8824 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210707_024131_718404_A072E840 X-CRM114-Status: GOOD ( 12.58 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently the is_iomem is a random value in the stack which may be default to true even on those platforms that not use iomem to store firmware. Cc: Bjorn Andersson Cc: Mathieu Poirier Cc: Peng Fan Fixes: 40df0a91b2a5 ("remoteproc: add is_iomem to da_to_va") Signed-off-by: Dong Aisheng Reviewed-by: Peng Fan --- v1->v2: * update rproc_copy_segment as well --- drivers/remoteproc/remoteproc_coredump.c | 2 +- drivers/remoteproc/remoteproc_elf_loader.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/remoteproc/remoteproc_coredump.c b/drivers/remoteproc/remoteproc_coredump.c index aee657cc08c6..c892f433a323 100644 --- a/drivers/remoteproc/remoteproc_coredump.c +++ b/drivers/remoteproc/remoteproc_coredump.c @@ -152,8 +152,8 @@ static void rproc_copy_segment(struct rproc *rproc, void *dest, struct rproc_dump_segment *segment, size_t offset, size_t size) { + bool is_iomem = false; void *ptr; - bool is_iomem; if (segment->dump) { segment->dump(rproc, segment, dest, offset, size); diff --git a/drivers/remoteproc/remoteproc_elf_loader.c b/drivers/remoteproc/remoteproc_elf_loader.c index e8078efb3dec..3cd1798f17a3 100644 --- a/drivers/remoteproc/remoteproc_elf_loader.c +++ b/drivers/remoteproc/remoteproc_elf_loader.c @@ -178,8 +178,8 @@ int rproc_elf_load_segments(struct rproc *rproc, const struct firmware *fw) u64 filesz = elf_phdr_get_p_filesz(class, phdr); u64 offset = elf_phdr_get_p_offset(class, phdr); u32 type = elf_phdr_get_p_type(class, phdr); + bool is_iomem = false; void *ptr; - bool is_iomem; if (type != PT_LOAD) continue;