From patchwork Thu Mar 7 10:12:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 159825 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7251181jad; Thu, 7 Mar 2019 02:13:38 -0800 (PST) X-Google-Smtp-Source: APXvYqxleeUuYH+M+iEfn+0GlODr0NIZhM5y9dpEnMaqRu3TtS7ZEjXCOR+xPdzPFAmSzDlAJU2j X-Received: by 2002:aa7:8a0a:: with SMTP id m10mr11934237pfa.129.1551953618145; Thu, 07 Mar 2019 02:13:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551953618; cv=none; d=google.com; s=arc-20160816; b=Ta9Q9Os6MaxaKIPJwaiivVMs1UUbJ/Uo1u8WcLAwtmI7cvCPrzPi8S+UHUxuu4bKKV UEyiJk8shSVveIG+eZaNG6eS7skHeNf/KQC1V01H5Gv+N913u2WMRzPyggZzV+l0HsLN Notvp7NppCiBJeitSohwAB/KtSGEK54r1eZ+/+5vq6VAD5mIDwhd0tfN8xB6BYcImcIo Oxd94LthThBBnBifRKvMM4skzRi45iK2+XGFoz7n+I6bSvcedFV66hzn6MoydmGms7VK gObSnv56Na1e2lV5ERURAzkuGTPKgW6980BiBS5lbxaVEJlBu3SDpiPuYAK2N9ed4fZc cPtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=QZXoHVQPaXkLWzJQl44F85OjDTIH9iGYQGdOEpv6nuY=; b=bWW69LMzPClUFtg5QcjAAbbd/lGvSel+V4p+Fib49UZTq8fC7WZ20sq8BKMrVhHj4B Vbs3XZuobtCKgip/sEKmrihBNP/7x6/GMcyICnvJrs2W30UKSCgpk9XUzvGMSNAQo0Xj 0D6hkcpgog2DHgqiOIT+u1S4JwpZdfKvcVQLWGrUYDIW3ODVdyaICj80vS+aV9x7LewT 0tw1+U3FxjaCWJ5i29USlGwyDFTMyCvHMYRnft11pVPVXt4zWcA9/M9r9jWBxj5Ffzlw foBJuF7hqAcYgT2HPqJB4oXY0CPaRUMK9W2wxaDvhf8DqKUTNvRA7kJChKFLRschgBDz ZSBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pMjDtZJP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p25si3957312pff.77.2019.03.07.02.13.37; Thu, 07 Mar 2019 02:13:38 -0800 (PST) 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; dkim=pass header.i=@linaro.org header.s=google header.b=pMjDtZJP; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726360AbfCGKNZ (ORCPT + 31 others); Thu, 7 Mar 2019 05:13:25 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:39941 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726442AbfCGKNW (ORCPT ); Thu, 7 Mar 2019 05:13:22 -0500 Received: by mail-wr1-f65.google.com with SMTP id y6so1563337wrn.7 for ; Thu, 07 Mar 2019 02:13:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QZXoHVQPaXkLWzJQl44F85OjDTIH9iGYQGdOEpv6nuY=; b=pMjDtZJPJQTw0RSw2Ka5bahtRkfV765FB9eL2raft0YXUfyRD7NI7HsQwp3PwWVC8z 5PH6MjR3S88X8GTvDCApUmoebrLIHWKhVliVHwPxFsvxG0V0nfpbok5UKiL3faQZ2DQC OjpxtrGMQI7yoXR2KW2LqFxn7YTiSenp6jyMkxYDt4OgvLBJe3a1fWJp9EskU2WBtjz0 1dnocfoXzTm9I1CBCzj0Xu5N6W5KmXFppVhQZ83lC0q4CwXyAFGIyshkgdRkB4QBm+OZ ZeXUqREKk2Dew0l0wtcnMTSWxR7V4+8CiB5UFbdZrGsq/t1YvfDTmOOIRFfROBXDRpvv OnhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QZXoHVQPaXkLWzJQl44F85OjDTIH9iGYQGdOEpv6nuY=; b=XHUM1c/+J1paIJoekdhoB/h1UA6KeAYJ8MC9sdsiVxdrOKf/SPPrPzJf9I5ASKFvYW wyCdVt0rbEmaGgCPsar3k7IykW0doU+hkZpBkGXUSSiMfE+RqH6ZLIs/Zk7+n0rUrBba rm3a+k1wQKVr51o6Otyzg+Q69Ag2vOtbLAyAcPjNJDKIe1MUCUDG2Rg/XHA0HmY1YAMz tcQvV7D+B8ZyYkteLBXIKkS9DK/4VK8okyf43SKkDApR3TvzQe0ZBcYxDBI6g4vCVtTg 04w7XIzj6XpXxQ4zQZbpoOS1UgxS1zAdoj6qm7ZTKGTDvX57SQaDwymmEKn75EGUb9H0 gG/A== X-Gm-Message-State: APjAAAUttM8XGCELyERtzNgNkQO44thkWwBTRXUe0m+xAj0ukkX5AfkI LtBSMBQdAfvk7qQ0p5Zqrr24TA== X-Received: by 2002:a5d:690d:: with SMTP id t13mr6067865wru.135.1551953600131; Thu, 07 Mar 2019 02:13:20 -0800 (PST) Received: from srini-hackbox.lan (cpc89974-aztw32-2-0-cust43.18-1.cable.virginm.net. [86.30.250.44]) by smtp.gmail.com with ESMTPSA id n9sm3529767wmi.33.2019.03.07.02.13.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 07 Mar 2019 02:13:19 -0800 (PST) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org, arnd@arndb.de Cc: linux-kernel@vger.kernel.org, bjorn.andersson@linaro.org, bkumar@qti.qualcomm.com, linux-arm-msm@vger.kernel.org, ktadakam@qti.qualcomm.com, Srinivas Kandagatla Subject: [PATCH 5/8] misc: fastrpc: consider address offset before sending to DSP Date: Thu, 7 Mar 2019 10:12:26 +0000 Message-Id: <20190307101229.7856-6-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190307101229.7856-1-srinivas.kandagatla@linaro.org> References: <20190307101229.7856-1-srinivas.kandagatla@linaro.org> MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While passing address phy address to DSP, take care of the offset calculated from virtual address vma. Fixes: c68cfb718c8f ("misc: fastrpc: Add support for context Invoke method") Signed-off-by: Srinivas Kandagatla --- drivers/misc/fastrpc.c | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.21.0 diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c index f71b5faae1dd..209f3e63f660 100644 --- a/drivers/misc/fastrpc.c +++ b/drivers/misc/fastrpc.c @@ -679,8 +679,16 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx) pages[i].size = roundup(len, PAGE_SIZE); if (ctx->maps[i]) { + struct vm_area_struct *vma = NULL; + rpra[i].pv = (u64) ctx->args[i].ptr; pages[i].addr = ctx->maps[i]->phys; + + vma = find_vma(current->mm, ctx->args[i].ptr); + if (vma) + pages[i].addr += ctx->args[i].ptr - + vma->vm_start; + } else { rlen -= ALIGN(args, FASTRPC_ALIGN) - args; args = ALIGN(args, FASTRPC_ALIGN);