Skip to content
Snippets Groups Projects
  1. Sep 14, 2021
    • Faizel K B's avatar
      usb: testusb: Fix for showing the connection speed · f81c08f8
      Faizel K B authored
      
      testusb' application which uses 'usbtest' driver reports 'unknown speed'
      from the function 'find_testdev'. The variable 'entry->speed' was not
      updated from  the application. The IOCTL mentioned in the FIXME comment can
      only report whether the connection is low speed or not. Speed is read using
      the IOCTL USBDEVFS_GET_SPEED which reports the proper speed grade.  The
      call is implemented in the function 'handle_testdev' where the file
      descriptor was availble locally. Sample output is given below where 'high
      speed' is printed as the connected speed.
      
      sudo ./testusb -a
      high speed      /dev/bus/usb/001/011    0
      /dev/bus/usb/001/011 test 0,    0.000015 secs
      /dev/bus/usb/001/011 test 1,    0.194208 secs
      /dev/bus/usb/001/011 test 2,    0.077289 secs
      /dev/bus/usb/001/011 test 3,    0.170604 secs
      /dev/bus/usb/001/011 test 4,    0.108335 secs
      /dev/bus/usb/001/011 test 5,    2.788076 secs
      /dev/bus/usb/001/011 test 6,    2.594610 secs
      /dev/bus/usb/001/011 test 7,    2.905459 secs
      /dev/bus/usb/001/011 test 8,    2.795193 secs
      /dev/bus/usb/001/011 test 9,    8.372651 secs
      /dev/bus/usb/001/011 test 10,    6.919731 secs
      /dev/bus/usb/001/011 test 11,   16.372687 secs
      /dev/bus/usb/001/011 test 12,   16.375233 secs
      /dev/bus/usb/001/011 test 13,    2.977457 secs
      /dev/bus/usb/001/011 test 14 --> 22 (Invalid argument)
      /dev/bus/usb/001/011 test 17,    0.148826 secs
      /dev/bus/usb/001/011 test 18,    0.068718 secs
      /dev/bus/usb/001/011 test 19,    0.125992 secs
      /dev/bus/usb/001/011 test 20,    0.127477 secs
      /dev/bus/usb/001/011 test 21 --> 22 (Invalid argument)
      /dev/bus/usb/001/011 test 24,    4.133763 secs
      /dev/bus/usb/001/011 test 27,    2.140066 secs
      /dev/bus/usb/001/011 test 28,    2.120713 secs
      /dev/bus/usb/001/011 test 29,    0.507762 secs
      
      Signed-off-by: default avatarFaizel K B <faizel.kb@dicortech.com>
      Link: https://lore.kernel.org/r/20210902114444.15106-1-faizel.kb@dicortech.com
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f81c08f8
  2. May 07, 2021
  3. Mar 26, 2021
  4. Aug 19, 2020
  5. Jul 15, 2020
  6. Jun 27, 2020
  7. Jun 24, 2020
  8. Mar 25, 2020
  9. Jan 09, 2020
  10. Jan 06, 2020
  11. Nov 07, 2019
  12. Oct 28, 2019
  13. Jul 25, 2019
  14. May 30, 2019
    • Thomas Gleixner's avatar
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 157 · c942fddf
      Thomas Gleixner authored
      
      Based on 3 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [kishon] [vijay] [abraham]
        [i] [kishon]@[ti] [com] this program is distributed in the hope that
        it will be useful but without any warranty without even the implied
        warranty of merchantability or fitness for a particular purpose see
        the gnu general public license for more details
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version [author] [graeme] [gregory]
        [gg]@[slimlogic] [co] [uk] [author] [kishon] [vijay] [abraham] [i]
        [kishon]@[ti] [com] [based] [on] [twl6030]_[usb] [c] [author] [hema]
        [hk] [hemahk]@[ti] [com] this program is distributed in the hope
        that it will be useful but without any warranty without even the
        implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 1105 file(s).
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarAllison Randal <allison@lohutok.net>
      Reviewed-by: default avatarRichard Fontana <rfontana@redhat.com>
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190527070033.202006027@linutronix.de
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c942fddf
    • Thomas Gleixner's avatar
      treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 156 · 1a59d1b8
      Thomas Gleixner authored
      
      Based on 1 normalized pattern(s):
      
        this program is free software you can redistribute it and or modify
        it under the terms of the gnu general public license as published by
        the free software foundation either version 2 of the license or at
        your option any later version this program is distributed in the
        hope that it will be useful but without any warranty without even
        the implied warranty of merchantability or fitness for a particular
        purpose see the gnu general public license for more details you
        should have received a copy of the gnu general public license along
        with this program if not write to the free software foundation inc
        59 temple place suite 330 boston ma 02111 1307 usa
      
      extracted by the scancode license scanner the SPDX license identifier
      
        GPL-2.0-or-later
      
      has been chosen to replace the boilerplate/reference in 1334 file(s).
      
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Reviewed-by: default avatarAllison Randal <allison@lohutok.net>
      Reviewed-by: default avatarRichard Fontana <rfontana@redhat.com>
      Cc: linux-spdx@vger.kernel.org
      Link: https://lkml.kernel.org/r/20190527070033.113240726@linutronix.de
      
      
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1a59d1b8
  15. May 24, 2019
  16. May 21, 2019
  17. Oct 18, 2018
  18. Oct 02, 2018
  19. Jul 17, 2018
    • Peter Senna Tschudin's avatar
      tools: usb: ffs-test: Fix build on big endian systems · a2b22ddd
      Peter Senna Tschudin authored
      
      The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C
      library htole16/32 function calls. However, cpu_to_le16/32 are used when
      initializing structures, i.e in a context where a function call is not
      allowed.
      
      It works fine on little endian systems because htole16/32 are defined by
      the C library as no-ops. But on big-endian systems, they are actually
      doing something, which might involve calling a function, causing build
      failures, such as:
      
         ffs-test.c:48:25: error: initializer element is not constant
          #define cpu_to_le32(x)  htole32(x)
                                  ^~~~~~~
         ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’
            .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
                     ^~~~~~~~~~~
      
      To solve this, we code cpu_to_le16/32 in a way that allows them to be
      used when initializing structures. This fix was imported from
      meta-openembedded/android-tools/fix-big-endian-build.patch written by
      Thomas Petazzoni <thomas.petazzoni@free-electrons.com>.
      
      CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarFelipe Balbi <felipe.balbi@linux.intel.com>
      a2b22ddd
  20. Jul 13, 2018
    • Peter Senna Tschudin's avatar
      tools: usb: ffs-test: Fix build on big endian systems · 8975a68d
      Peter Senna Tschudin authored
      
      The tools/usb/ffs-test.c file defines cpu_to_le16/32 by using the C
      library htole16/32 function calls. However, cpu_to_le16/32 are used when
      initializing structures, i.e in a context where a function call is not
      allowed.
      
      It works fine on little endian systems because htole16/32 are defined by
      the C library as no-ops. But on big-endian systems, they are actually
      doing something, which might involve calling a function, causing build
      failures, such as:
      
         ffs-test.c:48:25: error: initializer element is not constant
          #define cpu_to_le32(x)  htole32(x)
                                  ^~~~~~~
         ffs-test.c:128:12: note: in expansion of macro ‘cpu_to_le32’
            .magic = cpu_to_le32(FUNCTIONFS_DESCRIPTORS_MAGIC_V2),
                     ^~~~~~~~~~~
      
      To solve this, we code cpu_to_le16/32 in a way that allows them to be
      used when initializing structures. This fix was imported from
      meta-openembedded/android-tools/fix-big-endian-build.patch written by
      Thomas Petazzoni <thomas.petazzoni@free-electrons.com>.
      
      CC: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
      Signed-off-by: default avatarPeter Senna Tschudin <peter.senna@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8975a68d
  21. May 31, 2018
  22. Mar 22, 2018
  23. Mar 09, 2018
  24. Feb 21, 2018
    • Martin Kelly's avatar
      tools: fix cross-compile var clobbering · 7ed1c190
      Martin Kelly authored
      Currently a number of Makefiles break when used with toolchains that
      pass extra flags in CC and other cross-compile related variables (such
      as --sysroot).
      
      Thus we get this error when we use a toolchain that puts --sysroot in
      the CC var:
      
        ~/src/linux/tools$ make iio
        [snip]
        iio_event_monitor.c:18:10: fatal error: unistd.h: No such file or directory
          #include <unistd.h>
                   ^~~~~~~~~~
      
      This occurs because we clobber several env vars related to
      cross-compiling with lines like this:
      
        CC = $(CROSS_COMPILE)gcc
      
      Although this will point to a valid cross-compiler, we lose any extra
      flags that might exist in the CC variable, which can break toolchains
      that rely on them (for example, those that use --sysroot).
      
      This easily shows up using a Yocto SDK:
      
        $ . [snip]/sdk/environment-setup-cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CC
        arm-poky-linux-gnueabi-gcc -march=armv7-a -mfpu=neon -mfloat-abi=hard
        -mcpu=cortex-a8
        --sysroot=[snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi
      
        $ echo $CROSS_COMPILE
        arm-poky-linux-gnueabi-
      
        $ echo ${CROSS_COMPILE}gcc
        krm-poky-linux-gnueabi-gcc
      
      Although arm-poky-linux-gnueabi-gcc is a cross-compiler, we've lost the
      --sysroot and other flags that enable us to find the right libraries to
      link against, so we can't find unistd.h and other libraries and headers.
      Normally with the --sysroot flag we would find unistd.h in the sdk
      directory in the sysroot:
      
        $ find [snip]/sdk/sysroots -path '*/usr/include/unistd.h'
        [snip]/sdk/sysroots/cortexa8hf-neon-poky-linux-gnueabi/usr/include/unistd.h
      
      The perf Makefile adds CC = $(CROSS_COMPILE)gcc if and only if CC is not
      already set, and it compiles correctly with the above toolchain.
      
      So, generalize the logic that perf uses in the common Makefile and
      remove the manual CC = $(CROSS_COMPILE)gcc lines from each Makefile.
      
      Note that this patch does not fix cross-compile for all the tools (some
      have other bugs), but it does fix it for all except usb and acpi, which
      still have other unrelated issues.
      
      I tested both with and without the patch on native and cross-build and
      there appear to be no regressions.
      
      Link: http://lkml.kernel.org/r/20180107214028.23771-1-martin@martingkelly.com
      
      
      Signed-off-by: default avatarMartin Kelly <martin@martingkelly.com>
      Acked-by: default avatarMark Brown <broonie@kernel.org>
      Cc: Tejun Heo <tj@kernel.org>
      Cc: Li Zefan <lizefan@huawei.com>
      Cc: Johannes Weiner <hannes@cmpxchg.org>
      Cc: Linus Walleij <linus.walleij@linaro.org>
      Cc: "K. Y. Srinivasan" <kys@microsoft.com>
      Cc: Haiyang Zhang <haiyangz@microsoft.com>
      Cc: Stephen Hemminger <sthemmin@microsoft.com>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: Pali Rohar <pali.rohar@gmail.com>
      Cc: Richard Purdie <rpurdie@rpsys.net>
      Cc: Jacek Anaszewski <jacek.anaszewski@gmail.com>
      Cc: Pavel Machek <pavel@ucw.cz>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Robert Moore <robert.moore@intel.com>
      Cc: Lv Zheng <lv.zheng@intel.com>
      Cc: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
      Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Valentina Manea <valentina.manea.m@gmail.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: Mario Limonciello <mario.limonciello@dell.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      7ed1c190
  25. Jan 22, 2018
  26. Jan 04, 2018
  27. Dec 19, 2017
Loading