From patchwork Thu Jan 31 14:53:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrzej Pietrasiewicz X-Patchwork-Id: 10790729 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EEA6139A for ; Thu, 31 Jan 2019 14:53:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2276830851 for ; Thu, 31 Jan 2019 14:53:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1E8F131099; Thu, 31 Jan 2019 14:53:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9789030851 for ; Thu, 31 Jan 2019 14:53:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732017AbfAaOxw (ORCPT ); Thu, 31 Jan 2019 09:53:52 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:44386 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731978AbfAaOxv (ORCPT ); Thu, 31 Jan 2019 09:53:51 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: andrzej.p) with ESMTPSA id 7AB0827FEDF From: Andrzej Pietrasiewicz To: linux-usb@vger.kernel.org Cc: Felipe Balbi , Michal Nazarewicz , kernel@collabora.com Subject: [PATCH 0/2] wMaxPacketSize handling Date: Thu, 31 Jan 2019 15:53:38 +0100 Message-Id: <20190131145340.9820-1-andrzej.p@collabora.com> X-Mailer: git-send-email 2.17.1 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Dear All, While playing with FunctionFS I have noticed that high speed descriptors passed from userspace get overwritten by usb_ep_autoconfig() function. It happens for bulk endpoints, to be precise. At the time of this writing (5.0-rc4) there are 6 users of usb_ep_autoconfig(), who call it for descriptors which are not fs descriptors: f_fs, f_midi, f_uac1, f_uac1_legacy, f_uvc, legacy/dbgp. All but f_fs either don't use bulk endpoints with usb_ep_autoconfig() or take care to adjust the autoconfigured descriptor. The second patch in this series makes f_fs aware of the fact that autoconfiguration may overwrite wMaxPacketSize. I also simplified the usb_ep_autoconfig_ss() function by moving the non-super speed code to usb_ep_autoconfig(). Rebased onto v5.0-rc4. Andrzej Pietrasiewicz (2): usb: gadget: move non-super speed code out of usb_ep_autoconfig_ss() usb: gadget: f_fs: preserve wMaxPacketSize across usb_ep_autoconfig() call drivers/usb/gadget/epautoconf.c | 41 +++++++++++++++++------------- drivers/usb/gadget/function/f_fs.c | 11 ++++++++ 2 files changed, 35 insertions(+), 17 deletions(-)