lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <87poqfgpmm.fsf@linux.intel.com>
Date:	Fri, 15 Jul 2016 13:30:25 +0300
From:	Felipe Balbi <felipe.balbi@...ux.intel.com>
To:	Oliver Neukum <oneukum@...e.com>
Cc:	Bin Gao <bin.gao@...ux.intel.com>,
	Heikki Krogerus <heikki.krogerus@...ux.intel.com>,
	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	linux-kernel@...r.kernel.org, linux-usb@...r.kernel.org,
	Bin Gao <bin.gao@...el.com>,
	Chandra Sekhar Anagani <chandra.sekhar.anagani@...el.com>
Subject: Re: [PATCH 1/2] usb: typec: Add USB Power Delivery sink port support


Hi,

Oliver Neukum <oneukum@...e.com> writes:
> On Fri, 2016-07-15 at 10:25 +0300, Felipe Balbi wrote:
>> > +int pd_sink_queue_msg(struct pd_sink_msg *msg)
>> > +{
>> > +     unsigned long flags;
>> > +     struct pd_sink_port *port;
>> > +
>> > +     if (msg->port < 0 || msg->port >= MAX_NR_SINK_PORTS) {
>> > +             pr_err("Invalid port number\n");
>> > +             return -EINVAL;
>> > +     }
>> > +
>> > +     port = sink_ports[msg->port];
>> > +
>> > +     spin_lock_irqsave(&port->rx_lock, flags);
>> > +     list_add_tail(&msg->list, &port->rx_list);
>> > +     spin_unlock_irqrestore(&port->rx_lock, flags);
>> > +
>> > +     queue_work(port->rx_wq, &port->rx_work);
>> 
>> can we really queue several messages at a time? It seems unfeasible to
>> me. It's not like we can queue several power request in a role. Why do
>> you need this workqueue? Why don't you process message here, in place?
>
> A reset can come at any time.

right, but that's not how this is being used. IMHO, rx_work is a
misnomer. If you look at how typec_wcove (patch 2 in this series) uses
it, you'll see that pd_sink_queue_msg() is called to queue a reply to a
message that was *already* received. We can't have two replies, right?

In any case, this is a minor problem.

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (819 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ