Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1238464

Re: [PATCH v6.1 1/1] Input: Add userio module

From Dmitry Torokhov <dmitry.torokhov@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH v6.1 1/1] Input: Add userio module
Date 2015-10-02 19:40 +0200
Message-ID <qfctm-1MB-55@gated-at.bofh.it> (permalink)
References <qbWuJ-2YN-7@gated-at.bofh.it> <qbWuJ-2YN-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Sep 23, 2015 at 01:54:59PM -0400, cpaul@redhat.com wrote:
> +static int userio_device_write(struct serio *id, unsigned char val)
> +{
> +	struct userio_device *userio = id->port_data;
> +	unsigned long flags;
> +
> +	if (!userio)
> +		return -1;

I still have the same question: how can this happen? Where do we reset
port data to NULL? What happens if we set to NULL after checking?

> +
> +	spin_lock_irqsave(&userio->buf_lock, flags);
> +
> +	userio->buf[userio->head] = val;
> +	userio->head = (userio->head + 1) % USERIO_BUFSIZE;
> +
> +	if (userio->head == userio->tail)
> +		dev_warn(userio_misc.this_device,
> +			 "Buffer overflowed, userio client isn't keeping up");
> +
> +	spin_unlock_irqrestore(&userio->buf_lock, flags);
> +
> +	wake_up_interruptible(&userio->waitq);
> +
> +	return 0;
> +}

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v6.1 1/1] Input: Add userio module cpaul@redhat.com - 2015-09-23 20:00 +0200
  Re: [PATCH v6.1 1/1] Input: Add userio module Dmitry Torokhov <dmitry.torokhov@gmail.com> - 2015-10-02 19:40 +0200
    Re: [PATCH v6.1 1/1] Input: Add userio module Stephen Chandler Paul <cpaul@redhat.com> - 2015-10-05 16:10 +0200
    [PATCH v7] Input: Add userio module cpaul@redhat.com - 2015-10-05 18:00 +0200

csiph-web