All of lore.kernel.org
 help / color / mirror / Atom feed
From: Anup Patel <anup@brainfault.org>
To: Bjorn Andersson <bjorn.andersson@linaro.org>
Cc: Ohad Ben-Cohen <ohad@wizery.com>,
	linux-remoteproc@vger.kernel.org,
	"linux-kernel@vger.kernel.org List"
	<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: Wed, 21 Mar 2018 13:34:18 +0530	[thread overview]
Message-ID: <CAAhSdy2JcXTkbtO95yjp4eYQ7cTwS62hh_U1qk3k7taN2ySWgw@mail.gmail.com> (raw)
In-Reply-To: <20180318224744.GL5626@tuxbook-pro>

On Mon, Mar 19, 2018 at 4:17 AM, Bjorn Andersson
<bjorn.andersson@linaro.org> 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

      reply	other threads:[~2018-03-21  8:04 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
2018-03-21  8:04   ` Anup Patel [this message]

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=CAAhSdy2JcXTkbtO95yjp4eYQ7cTwS62hh_U1qk3k7taN2ySWgw@mail.gmail.com \
    --to=anup@brainfault.org \
    --cc=bjorn.andersson@linaro.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.