1. 14 11月, 2018 6 次提交
  2. 18 10月, 2018 1 次提交
  3. 16 10月, 2018 1 次提交
    • A
      USB: fix the usbfs flag sanitization for control transfers · 665c365a
      Alan Stern 提交于
      Commit 7a68d9fb ("USB: usbdevfs: sanitize flags more") checks the
      transfer flags for URBs submitted from userspace via usbfs.  However,
      the check for whether the USBDEVFS_URB_SHORT_NOT_OK flag should be
      allowed for a control transfer was added in the wrong place, before
      the code has properly determined the direction of the control
      transfer.  (Control transfers are special because for them, the
      direction is set by the bRequestType byte of the Setup packet rather
      than direction bit of the endpoint address.)
      
      This patch moves code which sets up the allow_short flag for control
      transfers down after is_in has been set to the correct value.
      Signed-off-by: NAlan Stern <stern@rowland.harvard.edu>
      Reported-and-tested-by: syzbot+24a30223a4b609bb802e@syzkaller.appspotmail.com
      Fixes: 7a68d9fb ("USB: usbdevfs: sanitize flags more")
      CC: Oliver Neukum <oneukum@suse.com>
      CC: <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      665c365a
  4. 09 10月, 2018 6 次提交
  5. 02 10月, 2018 3 次提交
  6. 24 9月, 2018 1 次提交
    • J
      USB: serial: simple: add Motorola Tetra MTP6550 id · f5fad711
      Johan Hovold 提交于
      Add device-id for the Motorola Tetra radio MTP6550.
      
      Bus 001 Device 004: ID 0cad:9012 Motorola CGISS
      Device Descriptor:
        bLength                18
        bDescriptorType         1
        bcdUSB               2.00
        bDeviceClass            0 (Defined at Interface level)
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0        64
        idVendor           0x0cad Motorola CGISS
        idProduct          0x9012
        bcdDevice           24.16
        iManufacturer           1 Motorola Solutions, Inc.
        iProduct                2 TETRA PEI interface
        iSerial                 0
        bNumConfigurations      1
        Configuration Descriptor:
          bLength                 9
          bDescriptorType         2
          wTotalLength           55
          bNumInterfaces          2
          bConfigurationValue     1
          iConfiguration          3 Generic Serial config
          bmAttributes         0x80
            (Bus Powered)
          MaxPower              500mA
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        0
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x81  EP 1 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x01  EP 1 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
          Interface Descriptor:
            bLength                 9
            bDescriptorType         4
            bInterfaceNumber        1
            bAlternateSetting       0
            bNumEndpoints           2
            bInterfaceClass       255 Vendor Specific Class
            bInterfaceSubClass      0
            bInterfaceProtocol      0
            iInterface              0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x82  EP 2 IN
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
            Endpoint Descriptor:
              bLength                 7
              bDescriptorType         5
              bEndpointAddress     0x02  EP 2 OUT
              bmAttributes            2
                Transfer Type            Bulk
                Synch Type               None
                Usage Type               Data
              wMaxPacketSize     0x0200  1x 512 bytes
              bInterval               0
      Device Qualifier (for other device speed):
        bLength                10
        bDescriptorType         6
        bcdUSB               2.00
        bDeviceClass            0 (Defined at Interface level)
        bDeviceSubClass         0
        bDeviceProtocol         0
        bMaxPacketSize0        64
        bNumConfigurations      1
      Device Status:     0x0000
        (Bus Powered)
      Reported-by: NHans Hult <hanshult35@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      f5fad711
  7. 20 9月, 2018 10 次提交
  8. 14 9月, 2018 2 次提交
    • J
      USB: serial: option: add two-endpoints device-id flag · 35aecc02
      Johan Hovold 提交于
      Allow matching on interfaces having two endpoints by adding a new
      device-id flag.
      
      This allows for the handling of devices whose interface numbers can
      change (e.g. Quectel EP06) to be contained in the device-id table.
      Tested-by: NKristian Evensen <kristian.evensen@gmail.com>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      35aecc02
    • K
      USB: serial: option: improve Quectel EP06 detection · 36cae568
      Kristian Evensen 提交于
      The Quectel EP06 (and EM06/EG06) LTE modem supports updating the USB
      configuration, without the VID/PID or configuration number changing.
      When the configuration is updated and interfaces are added/removed, the
      interface numbers are updated. This causes our current code for matching
      EP06 not to work as intended, as the assumption about reserved
      interfaces no longer holds. If for example the diagnostic (first)
      interface is removed, option will (try to) bind to the QMI interface.
      
      This patch improves EP06 detection by replacing the current match with
      two matches, and those matches check class, subclass and protocol as
      well as VID and PID. The diag interface exports class, subclass and
      protocol as 0xff. For the other serial interfaces, class is 0xff and
      subclass and protocol are both 0x0.
      
      The modem can export the following devices and always in this order:
      diag, nmea, at, ppp. qmi and adb. This means that diag can only ever be
      interface 0, and interface numbers 1-5 should be marked as reserved. The
      three other serial devices can have interface numbers 0-3, but I have
      not marked any interfaces as reserved. The reason is that the serial
      devices are the only interfaces exported by the device where subclass
      and protocol is 0x0.
      
      QMI exports the same class, subclass and protocol values as the diag
      interface. However, the two interfaces have different number of
      endpoints, QMI has three and diag two. I have added a check for number
      of interfaces if VID/PID matches the EP06, and we ignore the device if
      number of interfaces equals three (and subclass is set).
      Signed-off-by: NKristian Evensen <kristian.evensen@gmail.com>
      Acked-by: NDan Williams <dcbw@redhat.com>
      [ johan: drop uneeded RSVD(5) for ADB ]
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NJohan Hovold <johan@kernel.org>
      36cae568
  9. 11 9月, 2018 3 次提交
    • O
      Revert "cdc-acm: implement put_char() and flush_chars()" · df3aa13c
      Oliver Neukum 提交于
      This reverts commit a81cf979.
      
      The patch causes a regression, which I cannot find the reason for.
      So let's revert for now, as a revert hurts only performance.
      
      Original report:
      I was trying to resolve the problem with Oliver but we don't get any conclusion
      for 5 months, so I am now sending this to mail list and cdc_acm authors.
      
      I am using simple request-response protocol to obtain the boiller parameters
      in constant intervals.
      
      A simple one transaction is:
      1. opening the /dev/ttyACM0
      2. sending the following 10-bytes request to the device:
         unsigned char req[] = {0x02, 0xfe, 0x01, 0x05, 0x08, 0x02, 0x01, 0x69, 0xab, 0x03};
      3. reading response (frame of 74 bytes length).
      4. closing the descriptor
      I am doing this transaction with 5 seconds intervals.
      
      Before the bad commit everything was working correctly: I've got a requests and
      a responses in a timely manner.
      
      After the bad commit more time I am using the kernel module, more problems I have.
      The graph [2] is showing the problem.
      
      As you can see after module load all seems fine but after about 30 minutes I've got
      a plenty of EAGAINs when doing read()'s and trying to read back the data.
      
      When I rmmod and insmod the cdc_acm module again, then the situation is starting
      over again: running ok shortly after load, and more time it is running, more EAGAINs
      I have when calling read().
      
      As a bonus I can see the problem on the device itself:
      The device is configured as you can see here on this screen [3].
      It has two transmision LEDs: TX and RX. Blink duration is set for 100ms.
      This is a recording before the bad commit when all is working fine: [4]
      And this is with the bad commit: [5]
      As you can see the TX led is blinking wrongly long (indicating transmission?)
      and I have problems doing read() calls (EAGAIN).
      Reported-by: NMariusz Bialonczyk <manio@skyboo.net>
      Signed-off-by: NOliver Neukum <oneukum@suse.com>
      Fixes: a81cf979 ("cdc-acm: implement put_char() and flush_chars()")
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      df3aa13c
    • Y
      usb: Change usb_of_get_companion_dev() place to usb/common · fa827966
      Yoshihiro Shimoda 提交于
      Since renesas_usb3 udc driver calls usb_of_get_companion_dev()
      which is on usb/core/of.c, build error like below happens if we
      disable CONFIG_USB because the usb/core/ needs CONFIG_USB:
      
      ERROR: "usb_of_get_companion_dev" [drivers/usb/gadget/udc/renesas_usb3.ko] undefined!
      
      According to the usb/gadget/Kconfig, "NOTE:  Gadget support
      ** DOES NOT ** depend on host-side CONFIG_USB !!".
      So, to fix the issue, this patch changes the usb_of_get_companion_dev()
      place from usb/core/of.c to usb/common/common.c to be called by both
      host and gadget.
      Reported-by: NJohn Garry <john.garry@huawei.com>
      Fixes: 39facfa0 ("usb: gadget: udc: renesas_usb3: Add register of usb role switch")
      Signed-off-by: NYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
      Acked-by: NArnd Bergmann <arnd@arndb.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      fa827966
    • C
      usb: xhci: fix interrupt transfer error happened on MTK platforms · 0a3b5330
      Chunfeng Yun 提交于
      The MTK xHCI controller use some reserved bytes in endpoint context for
      bandwidth scheduling, so need keep them in xhci_endpoint_copy();
      
      The issue is introduced by:
      commit f5249461 ("xhci: Clear the host side toggle manually when
      endpoint is soft reset")
      It resets endpoints and will drop bandwidth scheduling parameters used
      by interrupt or isochronous endpoints on MTK xHCI controller.
      Fixes: f5249461 ("xhci: Clear the host side toggle manually when
      endpoint is soft reset")
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NChunfeng Yun <chunfeng.yun@mediatek.com>
      Tested-by: NSean Wang <sean.wang@mediatek.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0a3b5330
  10. 05 9月, 2018 7 次提交