[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <55d0673a-fd13-4afe-6dca-a98f058656c3@displaylink.com>
Date: Thu, 27 Feb 2020 08:50:18 +0000
From: Vladimir Stankovic <vladimir.stankovic@...playlink.com>
To: Oliver Neukum <oneukum@...e.com>,
Greg KH <gregkh@...uxfoundation.org>
CC: linux-kernel <linux-kernel@...r.kernel.org>,
linux-usb <linux-usb@...r.kernel.org>,
mausb-host-devel <mausb-host-devel@...playlink.com>
Subject: Re: [External] Re: [PATCH v2 5/8] usb: mausb_host: Introduce PAL
processing
On 26.2.20. 13:35, Oliver Neukum wrote:
> 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
>
You're right. We'll address this issue.
--
Regards,
Vladimir.
Powered by blists - more mailing lists