From patchwork Mon Apr 12 08:40:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 419511 Delivered-To: patch@linaro.org Received: by 2002:a02:c4d2:0:0:0:0:0 with SMTP id h18csp1559521jaj; Mon, 12 Apr 2021 01:57:04 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyWEUjhw9FKhln2S0vQokR8mZjJZLo3etiwUrVRnH89idl3pxubUGrKwz8TRiL3093noK56 X-Received: by 2002:a63:4d0:: with SMTP id 199mr26509982pge.304.1618217824246; Mon, 12 Apr 2021 01:57:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618217824; cv=none; d=google.com; s=arc-20160816; b=UwImf7In1ZSDZtrRXIi3UpAzOSsYXqoJLKRIYzkgpRXthsWzN282/NymBsDrW5NNEd 5s24lvo7HvhI4f0jEU3jzWix116eZTkni4kAwUrv1/KnnCmayQGJ+eCEytIa5bdtyKYu p58tVZ6Q3uy1hL7pbsBGq2Sxqb0GEQmKXln3eMiP+Xm+NM3WfGvb9590JDr6Tzny67Is Djjik7ONMDKd3AzQZdgYvW28bwxuAmIL+CFvGzLdEU0RSYAJ1niVKcPm1/tBUVmH5DkA wXj+1KOWcKFwRaVfUwI/0sktp/u/EkdJfdy5KezieObahwmfIQskOoXXcMCE9NVB4zRm UOIw== 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=bXVVxITWam0e4Qq8lP0416tAo+9mrp0lhs1v/VbhYZ0=; b=DjMbu1BJl4RxIvEwKfebyDg8TWn6HvKj3jatQUG2ZLghMcg46Yp5lPOSRVQ2huAzyb T2GAsf2vXb8W1buGe35JomdTewqu/kcPOCLdcqlwZbmk5fh+BiwuxykJP2u4IJH8LHyD KWiKfj0bPkx9c3YBemx+L7KnN0W2U3NH+MhDQSYEWhgLNLcCJA2taM7OgGug0kwLqB9W ORlPFSYH74Z2m+G70hyhHFjoehpQ1fMS49IUFoAGb1vL+u+u6yIwrAkGPCxWISNJi1Lr l9NKwaXV+UIz6mz6xIu1OpmnxMPqIYmjdjKLuQQA5TTClFzANBgfeaU63dC0ZOJhmJdH dSAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YKfFq6At; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x17si3397580plm.273.2021.04.12.01.57.03; Mon, 12 Apr 2021 01:57:04 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=YKfFq6At; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S238772AbhDLI5U (ORCPT + 12 others); Mon, 12 Apr 2021 04:57:20 -0400 Received: from mail.kernel.org ([198.145.29.99]:44694 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238981AbhDLIzR (ORCPT ); Mon, 12 Apr 2021 04:55:17 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 2A0C56124A; Mon, 12 Apr 2021 08:54:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1618217657; bh=XzYqd4Wk2MNbI79pscmIUBZKL0rKAEqzneFBph07z/g=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YKfFq6AtMbSmR29ldL7kVNkpjTo1/2dMGphguplgF7hdGfTSZYV57IW9/bEK1AKiY OhDhtmIixYESxEJ3OEUiUn6fn09fu1S4YbtDJlzA31hnfAvui+IkbmVl/U13y5tuGb bm2wmSrs1rDyTFOzuGhx8pIThaCrO96NdQVeS4Mo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Arnd Bergmann , Bjorn Andersson , Sasha Levin Subject: [PATCH 5.10 096/188] remoteproc: qcom: pil_info: avoid 64-bit division Date: Mon, 12 Apr 2021 10:40:10 +0200 Message-Id: <20210412084016.838020005@linuxfoundation.org> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210412084013.643370347@linuxfoundation.org> References: <20210412084013.643370347@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Arnd Bergmann [ Upstream commit 7029e783027706b427bbfbdf8558252c1dac6fa0 ] On 32-bit machines with 64-bit resource_size_t, the driver causes a link failure because of the 64-bit division: arm-linux-gnueabi-ld: drivers/remoteproc/qcom_pil_info.o: in function `qcom_pil_info_store': qcom_pil_info.c:(.text+0x1ec): undefined reference to `__aeabi_uldivmod' Add a cast to an u32 to avoid this. If the resource exceeds 4GB, there are bigger problems. Fixes: 549b67da660d ("remoteproc: qcom: Introduce helper to store pil info in IMEM") Signed-off-by: Arnd Bergmann Link: https://lore.kernel.org/r/20210103135628.3702427-1-arnd@kernel.org Signed-off-by: Bjorn Andersson Signed-off-by: Sasha Levin --- drivers/remoteproc/qcom_pil_info.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.30.2 diff --git a/drivers/remoteproc/qcom_pil_info.c b/drivers/remoteproc/qcom_pil_info.c index 5521c4437ffa..7c007dd7b200 100644 --- a/drivers/remoteproc/qcom_pil_info.c +++ b/drivers/remoteproc/qcom_pil_info.c @@ -56,7 +56,7 @@ static int qcom_pil_info_init(void) memset_io(base, 0, resource_size(&imem)); _reloc.base = base; - _reloc.num_entries = resource_size(&imem) / PIL_RELOC_ENTRY_SIZE; + _reloc.num_entries = (u32)resource_size(&imem) / PIL_RELOC_ENTRY_SIZE; return 0; }