All of lore.kernel.org
 help / color / mirror / Atom feed
From: Oliver Neukum <oneukum@suse.com>
To: Vladimir Stankovic <vladimir.stankovic@displaylink.com>,
	Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel <linux-kernel@vger.kernel.org>,
	linux-usb <linux-usb@vger.kernel.org>,
	mausb-host-devel <mausb-host-devel@displaylink.com>
Subject: Re: [PATCH v2 5/8] usb: mausb_host: Introduce PAL processing
Date: Wed, 26 Feb 2020 13:35:33 +0100	[thread overview]
Message-ID: <1582720533.17520.26.camel@suse.com> (raw)
In-Reply-To: <659eab4d-a995-d372-2c46-8b3d72ba13bc@displaylink.com>

Am Mittwoch, den 26.02.2020, 09:58 +0000 schrieb Vladimir Stankovic

+int mausb_enqueue_event_from_user(u8 madev_addr, u16 num_of_events,
+                                 u16 num_of_completed)
+{
+       unsigned long flags;
+       struct mausb_device *dev;
+
+       spin_lock_irqsave(&mss.lock, flags);

You save the flags.

+       dev = mausb_get_dev_from_addr_unsafe(madev_addr);
+
+       if (!dev) {
+               spin_unlock_irqrestore(&mss.lock, flags);
+               return -EINVAL;
+       }
+
+       spin_lock_irqsave(&dev->num_of_user_events_lock, flags);

You overwrite the flags.

+       dev->num_of_user_events += num_of_events;
+       dev->num_of_completed_events += num_of_completed;
+       spin_unlock_irqrestore(&dev->num_of_user_events_lock, flags);

Your restore the flags.

+       queue_work(dev->workq, &dev->work);
+       spin_unlock_irqrestore(&mss.lock, flags);

You restore the overwritten flags.

This cannot be right.

	Regards
		Oliver


  reply	other threads:[~2020-02-26 12:35 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-26  9:58 [PATCH v2 5/8] usb: mausb_host: Introduce PAL processing Vladimir Stankovic
2020-02-26 12:35 ` Oliver Neukum [this message]
2020-02-27  8:50   ` [External] " Vladimir Stankovic
2020-02-26 14:19 ` Oliver Neukum

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=1582720533.17520.26.camel@suse.com \
    --to=oneukum@suse.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=mausb-host-devel@displaylink.com \
    --cc=vladimir.stankovic@displaylink.com \
    /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.