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: <20101118145623.GB16565@kroah.com>
Date:	Thu, 18 Nov 2010 06:56:23 -0800
From:	Greg KH <greg@...ah.com>
To:	Tatyana Brokhman <tlinder@...eaurora.org>
Cc:	gregkh@...e.de, linux-usb@...r.kernel.org,
	linux-arm-msm@...r.kernel.org,
	David Brownell <dbrownell@...rs.sourceforge.net>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 1/4] usb gadget: Add usb_endpoint_descriptor to be
	part of the struct usb_ep

On Thu, Nov 18, 2010 at 02:46:38PM +0200, Tatyana Brokhman wrote:
> Change usb_ep_enable() prototype to use endpoint descriptor from usb_ep.
> This optimization spares the FDs from saving the endpoint chosen
> descriptor.

Why is this a good thing to do?

> This optimization is not full though. To fully exploit this
> change one needs to update all the UDCs as well since in the current
> implementation each of them saves the endpoint descriptor in it's
> internal (and extended) endpoint structure.

Do you do that optimization later on in this patch series?

> diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
> index 006412c..937c8fa 100644
> --- a/include/linux/usb/gadget.h
> +++ b/include/linux/usb/gadget.h
> @@ -131,20 +131,22 @@ struct usb_ep_ops {
>   * @maxpacket:The maximum packet size used on this endpoint.  The initial
>   *	value can sometimes be reduced (hardware allowing), according to
>   *      the endpoint descriptor used to configure the endpoint.
> - * @driver_data:for use by the gadget driver.  all other fields are
> - *	read-only to gadget drivers.
> + * @driver_data:for use by the gadget driver.

Why did you change the "all other fields..." portion?

> + * @desc: endpoint descriptor.  This pointer is set before the endpoint is
> + *	enabled and remains valid until the endpoint is disabled.
>   *
>   * the bus controller driver lists all the general purpose endpoints in
>   * gadget->ep_list.  the control endpoint (gadget->ep0) is not in that list,
>   * and is accessed only in response to a driver setup() callback.
>   */
>  struct usb_ep {
> -	void			*driver_data;
> +	void				*driver_data;
>  
> -	const char		*name;
> -	const struct usb_ep_ops	*ops;
> -	struct list_head	ep_list;
> -	unsigned		maxpacket:16;
> +	const char			*name;
> +	const struct usb_ep_ops		*ops;
> +	struct list_head		ep_list;
> +	unsigned			maxpacket:16;
> +	const struct usb_endpoint_descriptor	*desc;

Please don't reformat, it's hard to see what really was changed here.

thanks,

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ