Received: by 10.213.65.68 with SMTP id h4csp1128926imn; Sun, 18 Mar 2018 16:02:46 -0700 (PDT) X-Google-Smtp-Source: AG47ELughtGnPRt9YSbgUD8lb85SeBljX5/8Fic89OmNGhWJoGZlsuiNgHvvmEMkOYm2UHNw6jLP X-Received: by 2002:a17:902:b901:: with SMTP id bf1-v6mr10001113plb.175.1521414166067; Sun, 18 Mar 2018 16:02:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521414166; cv=none; d=google.com; s=arc-20160816; b=Ucaew7iX4zvqHw84GBfQcwwBVgd+Rv0M1/wletdAG9pmm6nwIKNHx+98FwseKp7AJS JgfGP9sb+cGGqjQdQRT5D54PcmCqRVroexW1iQE1Ue5ELjdFuoYcQtXNOR+MEifUA0NC NYAPahD8+S4KPglwkaTyvFB9nEzEhgJj/Jzq2WN+PwPlhA5mM3cTgopX1h382tsHuvBw yoZanc6eILcJnetFGl1VDay76RInt7W4uZVwUY4YpCDYDpbuq20nlFZy+Hpzs+u93cWR e4rpsVVM+w0qy63dSlXbH9jFb5MgSPJAQf7YrgZE9fHMt/OfJrm/+x62AabVZi51bTPM O6QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=ctq3JDsmXvdyy8n49xng7XzVXqwwHz3hqLEPdB5Jhxg=; b=btWUy8SvAvKFii7heEXps+ixh78IBbFduUkogOLVJsE9GVzEs83DISge7XxRQTadO2 nDUsBSR98TcvjSm43oGVUNZUbruDaVn2wB+d1KFfJMatLaIwtRNSonzYQ+b3Lm4bEyXR fBjimWiShuhn1foEVKOnU6Nvag9ktq3Cph+6Tkfhie/87utrdSaqsfI+LfYXPiOPSYrL DWVHd2Lo3kJzsDRcEVA0/m7a0X5OPEcKrP29dI5bw1OQ32w9qsyI8eFT+ifsccZaWuQv 5Mvq+V5VkydeJ77IovrD6o7BnjHFL8XA1O1YYA3bnVvCCMb3zpl5AiMHveXHJa/nxY82 9o/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ctqA1Lwb; 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 o19-v6si3906180pli.88.2018.03.18.16.02.32; Sun, 18 Mar 2018 16:02:46 -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=@linaro.org header.s=google header.b=ctqA1Lwb; 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 S1754956AbeCRWrq (ORCPT + 99 others); Sun, 18 Mar 2018 18:47:46 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:45544 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754698AbeCRWrn (ORCPT ); Sun, 18 Mar 2018 18:47:43 -0400 Received: by mail-pl0-f67.google.com with SMTP id n15-v6so1365682plp.12 for ; Sun, 18 Mar 2018 15:47:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=ctq3JDsmXvdyy8n49xng7XzVXqwwHz3hqLEPdB5Jhxg=; b=ctqA1LwbfpR6yhbWR3GYMA3m0KPwVy5768OizA2JL1d+Rr40eRItlF7jb2PtG4FkSn s8fdGS9Xy4BuiEgKTu0xWN+h8g22OhxBXQfnEQ6LYL0mVOBRci6Cc3RwNWUcYP0peJzj 3YNQ/FkMkhw+qTo/cVZWg/fOvIpIohLa2OHUk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=ctq3JDsmXvdyy8n49xng7XzVXqwwHz3hqLEPdB5Jhxg=; b=kf2fe5XWm+VzRagRI5oirB4wsl3sSR+3T2uRItfNY+gOzXS8Qpa0WNYXN/jMvtzxio PWLtYUQFf467ttVb0NxcPtASPRoAVHVea0IUf2puBRWAqH2abVlm1lzZGgN6G28lTFoK 7bOxvLqUS/w6qy7iazbxl5E5XX0igNGfPms6A41ERveZJ57KPsUWlW55R5kagc7V+ClI CaVI5ef6C3p6cJqBUHFvwE5fcDeQ6Y0kT5E92sY90PKz+zJKoKUxWyNU7veXpkiQ75TG X8Mx8dd1rQcXA9EIDoGpKI2EKqZc1sB8pHHM/RoVvBWL+Up0kHFu1qFStiWejiS4NuMc 6cNQ== X-Gm-Message-State: AElRT7FLU/2Z37ufvJazBhTzjdDPpHptmWYaY3ZQwokrMOsmAmgqDU7+ WYhSVyIemf25RAbl0LFw3ymS9Q== X-Received: by 2002:a17:902:8602:: with SMTP id f2-v6mr10104001plo.6.1521413262901; Sun, 18 Mar 2018 15:47:42 -0700 (PDT) Received: from tuxbook-pro (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id 2sm27980436pfo.70.2018.03.18.15.47.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 18 Mar 2018 15:47:42 -0700 (PDT) Date: Sun, 18 Mar 2018 15:47:44 -0700 From: Bjorn Andersson To: Anup Patel Cc: Ohad Ben-Cohen , linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH RESEND] rpmsg: virtio_rpmsg_bus: fix rpmsg_probe() for virtio-mmio transport Message-ID: <20180318224744.GL5626@tuxbook-pro> References: <1515590217-24256-1-git-send-email-anup@brainfault.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1515590217-24256-1-git-send-email-anup@brainfault.org> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Regards, Bjorn