Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp1822870ybi; Mon, 1 Jul 2019 00:49:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqwn6VUxqCOUV8r38GkEj/2tLghDamCHNeWW4Qt5RAdXFaw9JZT8YUO3QblyI2iVXCR6sd2X X-Received: by 2002:a65:5a44:: with SMTP id z4mr10036204pgs.41.1561967397929; Mon, 01 Jul 2019 00:49:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561967397; cv=none; d=google.com; s=arc-20160816; b=mMIglzT3u3SIsHuIi21HCdf3R2wc+2p0+IKyXb/8r7UB3Cl0Q3xupn49IE9fx3RgaC SdDH+RTMupiKXwnc3E95qkrCtYk1J5xIu5im43MgBhPhwCzImcBtnWPO06IK1MgqspL0 5EfRm0/+Rm3KW2JoPtoNDj1KQh2stxlK91vBh6vzahXKksr4hTOABPT/p6wnwQFPpwLV d0sZtiE6aGJ+4JZBQPk3n6AecB0T5TqDYJ6GO2838aheVmFYNOJPlWtZdSGcw6SJKCCb y1TydZtT7eL+fYV9G4RXZ+OGpRQWtnk4hrx2yKtnnE2cT3lb1y6cV06IZm+Sk/U+KGSU mrQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter; bh=wSZAfZbrMJlDVPr1O1dmSfnavPvFb9TXxfiXUY+sVus=; b=aGzmGSUgAGz+mWDMmPWjquB+lnkq9/d065ui6WZje9razWUkAHxjoGFCBzeHRXZ9Be u9bP4t+t7O/RiWtAlCX+VuDm15C3QxCWjLnEpc2S+wCeaUOqEie0V4OFvI/0QmhtySzX LYJGxCvxBxvGsK0e7Qmeutz8tLaCJ9llNUKvnU+jyzCBPdPWJ+SbaTXmiwUkZO2o8EHz u2vGULJNsw3DTn9RiHgsMp/6iJmjPebXS8UfZ080WIAulW2ynhmdidVLyoFRIJu38X3T InI01XRDmJow+CMduMjzUzeN7bbkwkUsV3S7BUUQXjmcRIZvmoTcSRzrFklCJdmYKEQg 0vVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=DkPYByDw; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 18si10120020pgf.457.2019.07.01.00.49.42; Mon, 01 Jul 2019 00:49:57 -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; dkim=pass header.i=@kalray.eu header.s=32AE1B44-9502-11E5-BA35-3734643DEF29 header.b=DkPYByDw; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=kalray.eu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727566AbfGAHDL (ORCPT + 99 others); Mon, 1 Jul 2019 03:03:11 -0400 Received: from zimbra2.kalray.eu ([92.103.151.219]:53240 "EHLO zimbra2.kalray.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725798AbfGAHDL (ORCPT ); Mon, 1 Jul 2019 03:03:11 -0400 Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id A215B27F0D9E; Mon, 1 Jul 2019 09:03:09 +0200 (CEST) Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id FIyDD2UIwCcz; Mon, 1 Jul 2019 09:03:06 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by zimbra2.kalray.eu (Postfix) with ESMTP id CFDDD27F0A64; Mon, 1 Jul 2019 09:03:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.10.3 zimbra2.kalray.eu CFDDD27F0A64 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kalray.eu; s=32AE1B44-9502-11E5-BA35-3734643DEF29; t=1561964586; bh=wSZAfZbrMJlDVPr1O1dmSfnavPvFb9TXxfiXUY+sVus=; h=From:To:Date:Message-Id; b=DkPYByDwO9eqDglXwWvcI+L3AA1KWbrgWZsV4Me2zCPy+v2XlrRxg3JLQGuDA8lFW R67wwuKKmj7rrsXLiRPxDoJK/qFM1hVLwJY69/TtXpeux+yC6rtRdQ0tLKdEuqaKeH fyzO1WRXC9EHskQYHZQ24pku6jEK8/cDEaZDssE8= X-Virus-Scanned: amavisd-new at zimbra2.kalray.eu Received: from zimbra2.kalray.eu ([127.0.0.1]) by localhost (zimbra2.kalray.eu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id lDS49BBgNBli; Mon, 1 Jul 2019 09:03:06 +0200 (CEST) Received: from triton.lin.mbt.kalray.eu (unknown [192.168.37.25]) by zimbra2.kalray.eu (Postfix) with ESMTPSA id BCA8027F0216; Mon, 1 Jul 2019 09:03:06 +0200 (CEST) From: Clement Leger To: Ohad Ben-Cohen , Bjorn Andersson , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Loic Pallardy , Clement Leger Subject: [PATCH v2] remoteproc: copy parent dma_pfn_offset for vdev Date: Mon, 1 Jul 2019 09:02:45 +0200 Message-Id: <20190701070245.32083-1-cleger@kalray.eu> X-Mailer: git-send-email 2.15.0.276.g89ea799 In-Reply-To: <20190612095521.4703-1-cleger@kalray.eu> References: <20190612095521.4703-1-cleger@kalray.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org When preparing the subdevice for the vdev, also copy dma_pfn_offset since this is used for sub device dma allocations. Without that, there is incoherency between the parent dma settings and the childs one, potentially leading to dma_alloc_coherent failure (due to phys_to_dma using dma_pfn_offset for translation). Fixes: 086d08725d34 ("remoteproc: create vdev subdevice with specific dma memory pool") Signed-off-by: Clement Leger Acked-by: Loic Pallardy --- Changes in v2: - Fix typo in commit message - Add "Fixes" in commit message - Add Signed-off - Add Acked-by Loic Pallardy --- drivers/remoteproc/remoteproc_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index 48feebd6d0a2..06837b1f2d60 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c @@ -520,6 +520,7 @@ static int rproc_handle_vdev(struct rproc *rproc, struct fw_rsc_vdev *rsc, /* Initialise vdev subdevice */ snprintf(name, sizeof(name), "vdev%dbuffer", rvdev->index); rvdev->dev.parent = rproc->dev.parent; + rvdev->dev.dma_pfn_offset = rproc->dev.parent->dma_pfn_offset; rvdev->dev.release = rproc_rvdev_release; dev_set_name(&rvdev->dev, "%s#%s", dev_name(rvdev->dev.parent), name); dev_set_drvdata(&rvdev->dev, rvdev); -- 2.15.0.276.g89ea799