Received: by 10.213.65.68 with SMTP id h4csp1053327imn; Wed, 21 Mar 2018 01:06:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELtPSJdtS8aIn5uQnpOUAQkmANXG0kxcTtMsaPy+Q0XVusQ1vXS7EyFzGn3fhlqyL7rG4efX X-Received: by 10.99.109.72 with SMTP id i69mr14528510pgc.417.1521619564974; Wed, 21 Mar 2018 01:06:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521619564; cv=none; d=google.com; s=arc-20160816; b=Lfn5iymBB2wI6Ag2tTaOt/XgSjOUTy/akSaNnRcWgGFmyz4gS3ddpDDfNglEj003AT oXzfMRdM7HmJw8nzH7+tCYhkx1w/PBtWsncAfrGoWSczT/2Wujyn8YguKbNThxxf7Kq+ LAg9vpwLaeynfh9B661WrsKdEjZrqdHf7q1ylf9ZrfYvakmz3g8jOSkmwPkcOHrcYiF1 1Ry6EWghd1wxKBb0xf+tnm0F11x4eZO0FRvBTNTgXg9hN6te+hgw1J9gHfAuwtu4wpfI 69EX6SawLnCQOYB4xqB7JGvDwUJdQX87a/wh29bztzTSvP7fA/yNsGEQbs/qD8vS6VaS Nmeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=dk3sNsssVuFfZqnQNry9GgReqATE5uId6Int5aEKCMY=; b=dSMFnRshGfNCEjSpfUHqdhwAS5cJiKYz7RR7+4emXFkEmMmtkazWfwhae9X8va6mHJ EylPshB3q2t2q3fRfhImjhW65RC3HxNgg4GhjRDeVOyayV9Bqu1yf6x478b2RSKnQrbh BBHVUnFuDpPuM278odDW2lT7QqDlR+KFDd4KqlANrqr7mx/kwusB3SO5ceyxgWnh+bTK sH84nBSYfTFsAGE0Fd2Y0W54iCQMaFK9HmAz3z2LS+A5wvUDOg9ByWJSuWpyMB20p/lU I8Tb7NGj9tg+QmGOXgDqBtMj5gNnA7bTyp+9QnZNZCjeHKzLjioKFK2atbWmFVHU1cdo PtzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=XiKmBycD; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g4-v6si3346499plb.114.2018.03.21.01.05.50; Wed, 21 Mar 2018 01:06:04 -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=@brainfault-org.20150623.gappssmtp.com header.s=20150623 header.b=XiKmBycD; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751630AbeCUIEb (ORCPT + 99 others); Wed, 21 Mar 2018 04:04:31 -0400 Received: from mail-wr0-f194.google.com ([209.85.128.194]:44029 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbeCUIEV (ORCPT ); Wed, 21 Mar 2018 04:04:21 -0400 Received: by mail-wr0-f194.google.com with SMTP id o1so4172738wro.10 for ; Wed, 21 Mar 2018 01:04:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=brainfault-org.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=dk3sNsssVuFfZqnQNry9GgReqATE5uId6Int5aEKCMY=; b=XiKmBycDHNyZpIZD7IM945unVxOD18nngS38EAJADEbGP9q5HZTNioNV0U8CxnACvt LFTl6Nq8M1iG1A998Nkbeamt3jgbAmM7X2oT6gz4zF5zIeEWhbZXZlWAi0TLT6tJQYqT 6L0cm9Ov4npiisllAudEJgqyETp9EQhLfi2zfzWaGBFDre3p9Q3lUX74ZMELpoYFB9Xh hQxWKUNY+SJAvWFbS5Xr2MD+z7PrvkFZOOQZQYQhK2dgxGVnp92tqiGQuekL81DhBlhk fjvzYPK83LESBY7j8G0cysQ1gdikfpEIBztqWLWJxPACzcU71TcsKgrPWcxfQo4n9BNh 6GCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=dk3sNsssVuFfZqnQNry9GgReqATE5uId6Int5aEKCMY=; b=Cg+39zioyzVaxhdrTrvgwFanXdMOQhZ3T/jOTAN65oOSeScyVeuLfWfG7lBYM2b6Xj dTb6YYg13NC7l9d4Idvz5iyZLSHEhzwRl2UlQNFYqxinZj7LmZc47top/VzLvyq7qF1G /Tlw+m7GWX294V9ujt9Jcf+VYf3ASMDHYYZt05TeKbRv/4P4uaAJ/DcidMK5x7IKxUTE /SBtqERKDzZYsjQlrmbmrZ8alvA1oEESf5NLME7sZD5dV9rlnMwKxg1pwga4FxGTZ2uS j5LhZ0cfZ+VAyM8cbNItDdsHDyGs3ZvKepeg6ZMRszngxofFW67l2V26S38RAxh4vmJe G1Vg== X-Gm-Message-State: AElRT7G1SxIEjv34C5Ji9zjID4/PKn1+DLLdLt+cm3PtWFgp7MS+Rw5r JqkFNQKx/tXEBBaS3bd41xzBD1kHS8jsGOhED09psw== X-Received: by 10.223.169.215 with SMTP id b81mr14864491wrd.48.1521619459435; Wed, 21 Mar 2018 01:04:19 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.154.87 with HTTP; Wed, 21 Mar 2018 01:04:18 -0700 (PDT) In-Reply-To: <20180318224744.GL5626@tuxbook-pro> References: <1515590217-24256-1-git-send-email-anup@brainfault.org> <20180318224744.GL5626@tuxbook-pro> From: Anup Patel Date: Wed, 21 Mar 2018 13:34:18 +0530 Message-ID: Subject: Re: [PATCH RESEND] rpmsg: virtio_rpmsg_bus: fix rpmsg_probe() for virtio-mmio transport To: Bjorn Andersson Cc: Ohad Ben-Cohen , linux-remoteproc@vger.kernel.org, "linux-kernel@vger.kernel.org List" , stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 19, 2018 at 4:17 AM, Bjorn Andersson wrote: > On Wed 10 Jan 05:16 PST 2018, Anup Patel wrote: >> diff --git a/drivers/rpmsg/virtio_rpmsg_bus.c b/drivers/rpmsg/virtio_rpmsg_bus.c > [..] >> @@ -924,9 +925,16 @@ static int rpmsg_probe(struct virtio_device *vdev) >> total_buf_space, &vrp->bufs_dma, >> GFP_KERNEL); >> if (!bufs_va) { >> - err = -ENOMEM; >> - goto vqs_del; >> - } >> + bufs_va = dma_alloc_coherent(vdev->dev.parent, >> + total_buf_space, &vrp->bufs_dma, >> + GFP_KERNEL); >> + if (!bufs_va) { >> + err = -ENOMEM; >> + goto vqs_del; >> + } else >> + vrp->bufs_dev = vdev->dev.parent; >> + } else >> + vrp->bufs_dev = vdev->dev.parent->parent; > > I really don't fancy the idea of us allocating on behalf of our > grandparent here, as you show it's not certain that our grandparent is > what someone originally expected it to be. > > With the purpose of being able to control these allocations there is an > ongoing discussion related to this, which I believe will result in this > being changed to at least vdev->dev.parent.. > > > I do expect that this discussion will be brought up during Linaro > Connect the coming week. > Currently, rpmsg_probe() is broken for virtio-mmio transport hence I send this patch as a stable fix. In general, I am fine if we are eventually going towards vdev->dev.parent usage. Regards, Anup