All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bjorn Andersson <bjorn.andersson@linaro.org>
To: Anup Patel <anup@brainfault.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	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
Date: Sun, 18 Mar 2018 15:47:44 -0700	[thread overview]
Message-ID: <20180318224744.GL5626@tuxbook-pro> (raw)
In-Reply-To: <1515590217-24256-1-git-send-email-anup@brainfault.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

  parent reply	other threads:[~2018-03-18 22:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 13:16 [PATCH RESEND] rpmsg: virtio_rpmsg_bus: fix rpmsg_probe() for virtio-mmio transport Anup Patel
2018-01-23 13:46 ` Anup Patel
2018-02-06  4:44 ` Anup Patel
2018-02-21 11:40 ` Anup Patel
2018-03-18 22:47 ` Bjorn Andersson [this message]
2018-03-21  8:04   ` Anup Patel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180318224744.GL5626@tuxbook-pro \
    --to=bjorn.andersson@linaro.org \
    --cc=anup@brainfault.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=ohad@wizery.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.