Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp342105imm; Wed, 3 Oct 2018 17:31:58 -0700 (PDT) X-Google-Smtp-Source: ACcGV607UuphZYUmAIW2B5/rQsnS/pgdvk4PiUQ/BfKyPrvOfOBqqPiO97UQ6uAN0TGWuIlnNBTw X-Received: by 2002:a17:902:b496:: with SMTP id y22-v6mr1459898plr.322.1538613118304; Wed, 03 Oct 2018 17:31:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538613118; cv=none; d=google.com; s=arc-20160816; b=FKROmGO90vFsPOtAXL0SiFsW8fnFkFtZqdZYk6d/7AyMxdWMGc3q3g/ffbchht2KcZ DE+jdQLWvyC57BsfKkn0OieYifXjOjt469VTbXTpixS0cxWWtnGhLAr34SBqwt545oE5 3hRKXqSTkcbrr7jtZNcluMACFp35JlnUjENroJqd7K3tjv4+8YitfEhl7aw1gwPs2abW QX66siqjJuULt1aSrGAWQJucNeecgA3z1rILGaTYw8erqYpfytrH8WGxU+jsArLbIW/T yEKJcfbk4fcoZfSi6zu4X/GuSUR8YJ4WoDk6f8F1A9y20jP5hT9VPVUmzGHbN8a5zhVG Ejog== 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; bh=IR4L5sY3osFQfSsbbpfpMeUP7zquVGvASIBs/79thSQ=; b=zYRCfaJtrmi2JuiItI78sOdJTPgi08pPSrVRZ5PL0X1GitwjuWkg+yEol54BSihX++ ACr38b+qr1qN3zVowo2AlxqoQI7DU5y6sh4NfSauVOHoZmpxkutKuSEz9cx74Xi3qXZa xAYJ1a5OKdZOWwfa2qwG8hvkYg/IEsVt08WQjmC+0y0uYKVFYvkXCtNumM7U4vhGduFN yqkuV1xPQaHU0UTKjkpFbLHyrY5tGXzgjjIY5X/9eDFzEMw215TQ1T5VchMPw/fPJpRP lJchCKgB2hXcOaNv8yLwK+ls+kybCxLf14WJ7YdOkS39RUl55CV8JkU9lqbgiz8nDPIO wugg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=R2RqU4Bk; 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 g20-v6si3234018plq.192.2018.10.03.17.31.42; Wed, 03 Oct 2018 17:31:58 -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=R2RqU4Bk; 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 S1727009AbeJDHWV (ORCPT + 99 others); Thu, 4 Oct 2018 03:22:21 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38629 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726270AbeJDHWV (ORCPT ); Thu, 4 Oct 2018 03:22:21 -0400 Received: by mail-pg1-f194.google.com with SMTP id r77-v6so2304635pgr.5 for ; Wed, 03 Oct 2018 17:31:37 -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=IR4L5sY3osFQfSsbbpfpMeUP7zquVGvASIBs/79thSQ=; b=R2RqU4BkEwcoOhfscl481xlbT6ETjwnXLizQPx6v+9zWSX3hZ0ApslcWbtPQwxRJxe vZ4lR+MXTaM6P7Q517Mydk8l4bmWmQp8nw6vOqzgDUAnF97AJJOvx07dFLnycucrlaMg VJi3ND8tk+ddU2FFGuH301O9tEVUgl/3J37xw= 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=IR4L5sY3osFQfSsbbpfpMeUP7zquVGvASIBs/79thSQ=; b=JUiUvysO2NaYragnP+ZfkxkQG4MHUmNTNetvAzk4G6077DWORm9XDrXBThlpS6z6Qf YjEqKk+7DLH6eZLopgBGvo6cfX/UoLrpYQHN2txjF7hPPxY2LWl0dki1VliAU016rCIg hrF0ncir+ht7KlY/rirA/DAZC2m8Dlp3oFYAqOx14+hCD2jDtKkezwSOBtvASoi3lgV+ 8jKr4FgqKG2Dqfvu5qp3udRBZdWNTrpU40mjjWu6JuCEiftWi34KlAUA8kLoEyKAnt0V 5J662p8MEcAlEw+8/DIq5q/RsX3+/+xsZaZbfoqgKUyDAWpVWwMyJD3ky5eUbF2m/0Xf VZVA== X-Gm-Message-State: ABuFfoiHndCVHD3KvVukCJzNwoHXz9jKEJC9n2fL9Ow7m5ocEkkojixZ P+tP7R47cs01MzIpB4lX68xDmA== X-Received: by 2002:a62:c999:: with SMTP id l25-v6mr4078411pfk.10.1538613097362; Wed, 03 Oct 2018 17:31:37 -0700 (PDT) Received: from minitux (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id c24-v6sm8719102pgn.60.2018.10.03.17.31.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 03 Oct 2018 17:31:36 -0700 (PDT) Date: Wed, 3 Oct 2018 17:31:34 -0700 From: Bjorn Andersson To: Arun Kumar Neelakantam Cc: ohad@wizery.com, clew@codeaurora.org, sricharan@codeaurora.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/5] rpmsg: wakeup poll to notify signal update Message-ID: <20181004003134.GV2523@minitux> References: <1538566463-24627-1-git-send-email-aneela@codeaurora.org> <1538566463-24627-5-git-send-email-aneela@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1538566463-24627-5-git-send-email-aneela@codeaurora.org> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed 03 Oct 04:34 PDT 2018, Arun Kumar Neelakantam wrote: > Add support to wait on poll to get signal notifications. > Send POLLPRI mask to indicate the signal change. > > Signed-off-by: Arun Kumar Neelakantam > --- > drivers/rpmsg/rpmsg_char.c | 14 ++++++++++++++ > 1 file changed, 14 insertions(+) > > diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c > index c983d6c..aee5561 100644 > --- a/drivers/rpmsg/rpmsg_char.c > +++ b/drivers/rpmsg/rpmsg_char.c > @@ -64,6 +64,7 @@ struct rpmsg_ctrldev { > * @queue_lock: synchronization of @queue operations > * @queue: incoming message queue > * @readq: wait object for incoming queue > + * @sig_pending:state of signal notification > */ > struct rpmsg_eptdev { > struct device dev; > @@ -78,6 +79,8 @@ struct rpmsg_eptdev { > spinlock_t queue_lock; > struct sk_buff_head queue; > wait_queue_head_t readq; > + > + atomic_t sig_pending; > }; > > static int rpmsg_eptdev_destroy(struct device *dev, void *data) > @@ -125,6 +128,12 @@ static int rpmsg_ept_cb(struct rpmsg_device *rpdev, void *buf, int len, > static int rpmsg_sigs_cb(struct rpmsg_device *rpdev, void *priv, > u32 old, u32 new) > { > + struct rpmsg_eptdev *eptdev = priv; > + > + atomic_set(&eptdev->sig_pending, 1); > + > + /* wake up any blocking processes, waiting for signal notification */ > + wake_up_interruptible(&eptdev->readq); This will execute a full memory barrier, so you shouldn't need to use atomic_t to carry this information. > return 0; > } > The rest looks good. Regards, Bjorn