Skip to content
Snippets Groups Projects
  1. Aug 04, 2023
  2. Dec 06, 2022
  3. Nov 09, 2022
  4. Jul 13, 2022
  5. Nov 04, 2021
  6. Feb 09, 2021
  7. Jan 29, 2021
    • Lyude Paul's avatar
      drm/nouveau/kms/nv50-: Fix locking for audio callbacks · 9125e242
      Lyude Paul authored
      
      Noticed that I wasn't paying close enough attention the last time I looked
      at our audio callbacks, as I completely missed the fact that we were
      figuring out which audio-enabled connector goes to each encoder by checking
      it's state, but without grabbing any of the appropriate modesetting locks
      to do so.
      
      That being said however: trying to grab modesetting locks in our audio
      callbacks would be very painful due to the potential for locking inversion
      between HDA and DRM. So, let's instead just copy what i915 does again - add
      our own audio lock to protect audio related state, and store each audio
      enabled connector in each nouveau_encoder struct so that we don't need to
      check any atomic states.
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      9125e242
  8. Jan 21, 2021
  9. Dec 01, 2020
  10. Oct 29, 2020
  11. Sep 03, 2020
  12. Aug 31, 2020
  13. Aug 06, 2020
  14. Jul 24, 2020
  15. Apr 07, 2020
    • Karol Herbst's avatar
      drm/nouveau: workaround runpm fail by disabling PCI power management on certain intel bridges · 434fdb51
      Karol Herbst authored
      
      Fixes the infamous 'runtime PM' bug many users are facing on Laptops with
      Nvidia Pascal GPUs by skipping said PCI power state changes on the GPU.
      
      Depending on the used kernel there might be messages like those in demsg:
      
      "nouveau 0000:01:00.0: Refused to change power state, currently in D3"
      "nouveau 0000:01:00.0: can't change power state from D3cold to D0 (config
      space inaccessible)"
      followed by backtraces of kernel crashes or timeouts within nouveau.
      
      It's still unkown why this issue exists, but this is a reliable workaround
      and solves a very annoying issue for user having to choose between a
      crashing kernel or higher power consumption of their Laptops.
      
      Signed-off-by: default avatarKarol Herbst <kherbst@redhat.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Lyude Paul <lyude@redhat.com>
      Cc: Rafael J. Wysocki <rjw@rjwysocki.net>
      Cc: Mika Westerberg <mika.westerberg@intel.com>
      Cc: linux-pci@vger.kernel.org
      Cc: linux-pm@vger.kernel.org
      Cc: dri-devel@lists.freedesktop.org
      Cc: nouveau@lists.freedesktop.org
      Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=205623
      
      
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      434fdb51
  16. Jan 29, 2020
    • Takashi Iwai's avatar
      drm/nouveau: Add HD-audio component notifier support · 742db30c
      Takashi Iwai authored
      This patch adds the support for the notification of HD-audio hotplug
      via the already existing drm_audio_component framework.  This allows
      us more reliable hotplug notification and ELD transfer without
      accessing HD-audio bus; it's more efficient, and more importantly, it
      works without waking up the runtime PM.
      
      The implementation is rather simplistic: nouveau driver provides the
      get_eld ops for HD-audio, and it notifies the audio hotplug via
      pin_eld_notify callback upon each nv50_audio_enable() and _disable()
      call.  As the HD-audio pin assignment seems corresponding to the CRTC,
      the crtc->index number is passed directly as the zero-based port
      number.
      
      The bind and unbind callbacks handle the device-link so that it
      assures the PM call order.
      
      Link: https://lore.kernel.org/r/20190722143815.7339-3-tiwai@suse.de
      
      
      Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
      Cc: Jaroslav Kysela <perex@perex.cz>
      Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      742db30c
  17. Nov 14, 2019
  18. Aug 23, 2019
  19. Jul 19, 2019
  20. Mar 19, 2019
  21. Feb 19, 2019
  22. Nov 05, 2018
  23. Oct 10, 2018
    • Lyude Paul's avatar
      drm/nouveau: Move backlight device into nouveau_connector · 6d757753
      Lyude Paul authored
      
      Currently module unloading is broken in nouveau due to a rather annoying
      race condition resulting from nouveau_backlight.c having gone a bit
      stale over time:
      
      [ 1960.791143] ==================================================================
      [ 1960.791394] BUG: KASAN: use-after-free in nouveau_backlight_exit+0x112/0x150 [nouveau]
      [ 1960.791460] Read of size 4 at addr ffff88075accf350 by task zsh/11185
      [ 1960.791521]
      [ 1960.791545] CPU: 7 PID: 11185 Comm: zsh Kdump: loaded Tainted: G           O      4.18.0Lyude-Test+ #4
      [ 1960.791580] Hardware name: LENOVO 20EQS64N0B/20EQS64N0B, BIOS N1EET79W (1.52 ) 07/13/2018
      [ 1960.791628] Call Trace:
      [ 1960.791680]  dump_stack+0xa4/0xfd
      [ 1960.791721]  print_address_description+0x71/0x239
      [ 1960.791833]  ? nouveau_backlight_exit+0x112/0x150 [nouveau]
      [ 1960.791877]  kasan_report.cold.6+0x242/0x2fe
      [ 1960.791919]  __asan_report_load4_noabort+0x19/0x20
      [ 1960.792012]  nouveau_backlight_exit+0x112/0x150 [nouveau]
      [ 1960.792081]  nouveau_display_destroy+0x76/0x150 [nouveau]
      [ 1960.792150]  nouveau_drm_device_fini+0xb7/0x190 [nouveau]
      [ 1960.792265]  nouveau_drm_device_remove+0x14b/0x1d0 [nouveau]
      [ 1960.792347]  ? nouveau_cli_work_queue+0x2e0/0x2e0 [nouveau]
      [ 1960.792378]  ? trace_hardirqs_on_caller+0x38b/0x570
      [ 1960.792406]  ? trace_hardirqs_on+0xd/0x10
      [ 1960.792472]  nouveau_drm_remove+0x37/0x50 [nouveau]
      [ 1960.792502]  pci_device_remove+0x112/0x2d0
      [ 1960.792530]  ? pcibios_free_irq+0x10/0x10
      [ 1960.792558]  ? kasan_check_write+0x14/0x20
      [ 1960.792587]  device_release_driver_internal+0x35c/0x650
      [ 1960.792617]  device_release_driver+0x12/0x20
      [ 1960.792643]  pci_stop_bus_device+0x172/0x1e0
      [ 1960.792671]  pci_stop_and_remove_bus_device_locked+0x1a/0x30
      [ 1960.792715]  remove_store+0xcb/0xe0
      [ 1960.792753]  ? sriov_numvfs_store+0x2e0/0x2e0
      [ 1960.792779]  ? __lock_is_held+0xb5/0x140
      [ 1960.792808]  ? component_add+0x530/0x530
      [ 1960.792834]  dev_attr_store+0x3f/0x70
      [ 1960.792859]  ? sysfs_file_ops+0x11d/0x170
      [ 1960.792885]  sysfs_kf_write+0x104/0x150
      [ 1960.792915]  ? sysfs_file_ops+0x170/0x170
      [ 1960.792940]  kernfs_fop_write+0x24f/0x400
      [ 1960.792978]  ? __lock_acquire+0x6ea/0x47f0
      [ 1960.793021]  __vfs_write+0xeb/0x760
      [ 1960.793048]  ? kernel_read+0x130/0x130
      [ 1960.793076]  ? __lock_is_held+0xb5/0x140
      [ 1960.793107]  ? rcu_read_lock_sched_held+0xdd/0x110
      [ 1960.793135]  ? rcu_sync_lockdep_assert+0x78/0xb0
      [ 1960.793162]  ? __sb_start_write+0x183/0x220
      [ 1960.793189]  vfs_write+0x14d/0x4a0
      [ 1960.793229]  ksys_write+0xd2/0x1b0
      [ 1960.793255]  ? __ia32_sys_read+0xb0/0xb0
      [ 1960.793298]  ? fput+0x1d/0x120
      [ 1960.793324]  ? filp_close+0xf3/0x130
      [ 1960.793349]  ? entry_SYSCALL_64_after_hwframe+0x59/0xbe
      [ 1960.793380]  __x64_sys_write+0x73/0xb0
      [ 1960.793407]  do_syscall_64+0xaa/0x400
      [ 1960.793433]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [ 1960.793460] RIP: 0033:0x7f59df433164
      [ 1960.793486] Code: 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 8d 05 81 38 2d 00 8b 00 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 41 54 49 89 d4 55 48 89 f5 53
      [ 1960.793541] RSP: 002b:00007ffd70ee2fb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [ 1960.793576] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f59df433164
      [ 1960.793620] RDX: 0000000000000002 RSI: 00005578088640c0 RDI: 0000000000000001
      [ 1960.793665] RBP: 00005578088640c0 R08: 00007f59df7038c0 R09: 00007f59e0995b80
      [ 1960.793696] R10: 000000000000000a R11: 0000000000000246 R12: 00007f59df702760
      [ 1960.793730] R13: 0000000000000002 R14: 00007f59df6fd760 R15: 0000000000000002
      [ 1960.793768]
      [ 1960.793790] Allocated by task 11167:
      [ 1960.793816]  save_stack+0x43/0xd0
      [ 1960.793841]  kasan_kmalloc+0xc4/0xe0
      [ 1960.793880]  kasan_slab_alloc+0x11/0x20
      [ 1960.793905]  kmem_cache_alloc+0xd7/0x270
      [ 1960.793944]  getname_flags+0xbd/0x520
      [ 1960.793969]  user_path_at_empty+0x23/0x50
      [ 1960.793994]  do_faccessat+0x1fc/0x5d0
      [ 1960.794018]  __x64_sys_access+0x59/0x80
      [ 1960.794043]  do_syscall_64+0xaa/0x400
      [ 1960.794067]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [ 1960.794093]
      [ 1960.794127] Freed by task 11167:
      [ 1960.794152]  save_stack+0x43/0xd0
      [ 1960.794190]  __kasan_slab_free+0x139/0x190
      [ 1960.794215]  kasan_slab_free+0xe/0x10
      [ 1960.794239]  kmem_cache_free+0xcb/0x2c0
      [ 1960.794264]  putname+0xad/0xe0
      [ 1960.794287]  filename_lookup.part.59+0x1f1/0x360
      [ 1960.794313]  user_path_at_empty+0x3e/0x50
      [ 1960.794338]  do_faccessat+0x1fc/0x5d0
      [ 1960.794362]  __x64_sys_access+0x59/0x80
      [ 1960.794393]  do_syscall_64+0xaa/0x400
      [ 1960.794421]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [ 1960.794461]
      [ 1960.794483] The buggy address belongs to the object at ffff88075acceac0
      [ 1960.794483]  which belongs to the cache names_cache of size 4096
      [ 1960.794540] The buggy address is located 2192 bytes inside of
      [ 1960.794540]  4096-byte region [ffff88075acceac0, ffff88075accfac0)
      [ 1960.794581] The buggy address belongs to the page:
      [ 1960.794609] page:ffffea001d6b3200 count:1 mapcount:0 mapping:ffff880778e4b1c0 index:0x0 compound_mapcount: 0
      [ 1960.794651] flags: 0x8000000000008100(slab|head)
      [ 1960.794679] raw: 8000000000008100 ffffea001d39e808 ffffea001d39ea08 ffff880778e4b1c0
      [ 1960.794739] raw: 0000000000000000 0000000000070007 00000001ffffffff 0000000000000000
      [ 1960.794785] page dumped because: kasan: bad access detected
      [ 1960.794813]
      [ 1960.794834] Memory state around the buggy address:
      [ 1960.794861]  ffff88075accf200: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [ 1960.794894]  ffff88075accf280: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [ 1960.794925] >ffff88075accf300: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [ 1960.794956]                                                  ^
      [ 1960.794985]  ffff88075accf380: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [ 1960.795017]  ffff88075accf400: fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb fb
      [ 1960.795061] ==================================================================
      [ 1960.795106] Disabling lock debugging due to kernel taint
      [ 1960.795131] ------------[ cut here ]------------
      [ 1960.795148] ida_remove called for id=1802201963 which is not allocated.
      [ 1960.795193] WARNING: CPU: 7 PID: 11185 at lib/idr.c:521 ida_remove+0x184/0x210
      [ 1960.795213] Modules linked in: nouveau(O) mxm_wmi ttm i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops drm joydev vfat fat intel_rapl x86_pkg_temp_thermal coretemp crc32_pclmul iTCO_wdt psmouse wmi_bmof mei_me tpm_tis mei tpm_tis_core tpm i2c_i801 thinkpad_acpi pcc_cpufreq crc32c_intel serio_raw xhci_pci xhci_hcd wmi video i2c_dev i2c_core
      [ 1960.795305] CPU: 7 PID: 11185 Comm: zsh Kdump: loaded Tainted: G    B      O      4.18.0Lyude-Test+ #4
      [ 1960.795330] Hardware name: LENOVO 20EQS64N0B/20EQS64N0B, BIOS N1EET79W (1.52 ) 07/13/2018
      [ 1960.795352] RIP: 0010:ida_remove+0x184/0x210
      [ 1960.795370] Code: 4c 89 f7 e8 ae c8 00 00 eb 22 41 83 c4 02 4c 89 e8 41 83 fc 3f 0f 86 64 ff ff ff 44 89 fe 48 c7 c7 20 94 1e 83 e8 54 ed 81 fe <0f> 0b 48 b8 00 00 00 00 00 fc ff df 48 01 c3 c7 03 00 00 00 00 c7
      [ 1960.795402] RSP: 0018:ffff88074d4df7b8 EFLAGS: 00010082
      [ 1960.795421] RAX: 0000000000000000 RBX: 1ffff100e9a9befa RCX: ffffffff81479975
      [ 1960.795440] RDX: 0000000000000000 RSI: 0000000000000008 RDI: ffff88077c1de690
      [ 1960.795460] RBP: ffff88074d4df878 R08: ffffed00ef83bcd3 R09: ffffed00ef83bcd2
      [ 1960.795479] R10: ffffed00ef83bcd2 R11: ffff88077c1de697 R12: 000000000000036b
      [ 1960.795498] R13: 0000000000000202 R14: ffffffffa0aa7fa0 R15: 000000006b6b6b6b
      [ 1960.795518] FS:  00007f59e0995b80(0000) GS:ffff88077c1c0000(0000) knlGS:0000000000000000
      [ 1960.795553] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [ 1960.795571] CR2: 00007f59e09a2010 CR3: 00000004a1a70005 CR4: 00000000003606e0
      [ 1960.795596] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [ 1960.795629] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [ 1960.795649] Call Trace:
      [ 1960.795667]  ? ida_destroy+0x1d0/0x1d0
      [ 1960.795686]  ? kasan_check_write+0x14/0x20
      [ 1960.795704]  ? do_raw_spin_lock+0xc2/0x1c0
      [ 1960.795724]  ida_simple_remove+0x26/0x40
      [ 1960.795794]  nouveau_backlight_exit+0x9d/0x150 [nouveau]
      [ 1960.795867]  nouveau_display_destroy+0x76/0x150 [nouveau]
      [ 1960.795930]  nouveau_drm_device_fini+0xb7/0x190 [nouveau]
      [ 1960.795989]  nouveau_drm_device_remove+0x14b/0x1d0 [nouveau]
      [ 1960.796047]  ? nouveau_cli_work_queue+0x2e0/0x2e0 [nouveau]
      [ 1960.796067]  ? trace_hardirqs_on_caller+0x38b/0x570
      [ 1960.796089]  ? trace_hardirqs_on+0xd/0x10
      [ 1960.796146]  nouveau_drm_remove+0x37/0x50 [nouveau]
      [ 1960.796167]  pci_device_remove+0x112/0x2d0
      [ 1960.796186]  ? pcibios_free_irq+0x10/0x10
      [ 1960.796218]  ? kasan_check_write+0x14/0x20
      [ 1960.796237]  device_release_driver_internal+0x35c/0x650
      [ 1960.796257]  device_release_driver+0x12/0x20
      [ 1960.796289]  pci_stop_bus_device+0x172/0x1e0
      [ 1960.796308]  pci_stop_and_remove_bus_device_locked+0x1a/0x30
      [ 1960.796328]  remove_store+0xcb/0xe0
      [ 1960.796345]  ? sriov_numvfs_store+0x2e0/0x2e0
      [ 1960.796364]  ? __lock_is_held+0xb5/0x140
      [ 1960.796383]  ? component_add+0x530/0x530
      [ 1960.796401]  dev_attr_store+0x3f/0x70
      [ 1960.796419]  ? sysfs_file_ops+0x11d/0x170
      [ 1960.796436]  sysfs_kf_write+0x104/0x150
      [ 1960.796454]  ? sysfs_file_ops+0x170/0x170
      [ 1960.796471]  kernfs_fop_write+0x24f/0x400
      [ 1960.796488]  ? __lock_acquire+0x6ea/0x47f0
      [ 1960.796520]  __vfs_write+0xeb/0x760
      [ 1960.796538]  ? kernel_read+0x130/0x130
      [ 1960.796556]  ? __lock_is_held+0xb5/0x140
      [ 1960.796590]  ? rcu_read_lock_sched_held+0xdd/0x110
      [ 1960.796608]  ? rcu_sync_lockdep_assert+0x78/0xb0
      [ 1960.796626]  ? __sb_start_write+0x183/0x220
      [ 1960.796648]  vfs_write+0x14d/0x4a0
      [ 1960.796666]  ksys_write+0xd2/0x1b0
      [ 1960.796684]  ? __ia32_sys_read+0xb0/0xb0
      [ 1960.796701]  ? fput+0x1d/0x120
      [ 1960.796732]  ? filp_close+0xf3/0x130
      [ 1960.796749]  ? entry_SYSCALL_64_after_hwframe+0x59/0xbe
      [ 1960.796768]  __x64_sys_write+0x73/0xb0
      [ 1960.796800]  do_syscall_64+0xaa/0x400
      [ 1960.796818]  entry_SYSCALL_64_after_hwframe+0x49/0xbe
      [ 1960.796836] RIP: 0033:0x7f59df433164
      [ 1960.796854] Code: 89 02 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 66 90 48 8d 05 81 38 2d 00 8b 00 85 c0 75 13 b8 01 00 00 00 0f 05 <48> 3d 00 f0 ff ff 77 54 c3 0f 1f 00 41 54 49 89 d4 55 48 89 f5 53
      [ 1960.796884] RSP: 002b:00007ffd70ee2fb8 EFLAGS: 00000246 ORIG_RAX: 0000000000000001
      [ 1960.796906] RAX: ffffffffffffffda RBX: 0000000000000002 RCX: 00007f59df433164
      [ 1960.796926] RDX: 0000000000000002 RSI: 00005578088640c0 RDI: 0000000000000001
      [ 1960.796946] RBP: 00005578088640c0 R08: 00007f59df7038c0 R09: 00007f59e0995b80
      [ 1960.796966] R10: 000000000000000a R11: 0000000000000246 R12: 00007f59df702760
      [ 1960.796985] R13: 0000000000000002 R14: 00007f59df6fd760 R15: 0000000000000002
      [ 1960.797008] irq event stamp: 509990
      [ 1960.797026] hardirqs last  enabled at (509989): [<ffffffff8119ff78>] flush_work+0x4b8/0x6d0
      [ 1960.797063] hardirqs last disabled at (509990): [<ffffffff8297c395>] _raw_spin_lock_irqsave+0x25/0x60
      [ 1960.797085] softirqs last  enabled at (509744): [<ffffffff82c005ad>] __do_softirq+0x5ad/0x8c0
      [ 1960.797121] softirqs last disabled at (509735): [<ffffffff8115aa15>] irq_exit+0x1a5/0x1e0
      [ 1960.797142] ---[ end trace fb1342325f1846b8 ]---
      
      While I haven't actually gone into the details of what's causing this to
      happen (maybe the kernel removes the backlight device in the device core
      before we get to it?), it doesn't really matter anyway because the way
      nouveau handles backlights has long since been deprecated.
      
      According to the documentation on the drm_connector->late_register()
      hook, the ->late_register() hook should be used for adding extra
      connector-related devices. Vice versa, the ->early_unregister() hook is
      meant to be used for removing those devices.
      
      So: gut nouveau_drm->bl_list and nouveau_drm->backlight, and replace
      them with per-connector backlight structures. Additionally, move
      backlight registration/teardown into the ->late_register() and
      ->early_unregister() hooks so that DRM can give us a chance to remove
      the backlight before the connector is even removed. This appears to fix
      the problem once and for all.
      
      Changes since v2:
      - Use NV_INFO_ONCE for printing GMUX information, since otherwise this
        will end up printing that message for as many times as we have
        connectors
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Reviewed-by: default avatarKarol Herbst <kherbst@redhat.com>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      6d757753
    • Lyude Paul's avatar
      drm/nouveau: Add NV_PRINTK_ONCE and variants · 4c497075
      Lyude Paul authored
      
      Since we're about to use this in nouveau_backlight.c. Same thing as
      DRM_WARN_ONCE, DRM_INFO_ONCE, etc...
      
      Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
      Cc: Karol Herbst <kherbst@redhat.com>
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      4c497075
  24. May 18, 2018
  25. Mar 13, 2018
  26. Dec 19, 2017
  27. Nov 02, 2017
    • Greg Kroah-Hartman's avatar
      License cleanup: add SPDX GPL-2.0 license identifier to files with no license · b2441318
      Greg Kroah-Hartman authored
      
      Many source files in the tree are missing licensing information, which
      makes it harder for compliance tools to determine the correct license.
      
      By default all files without license information are under the default
      license of the kernel, which is GPL version 2.
      
      Update the files which contain no license information with the 'GPL-2.0'
      SPDX license identifier.  The SPDX identifier is a legally binding
      shorthand, which can be used instead of the full boiler plate text.
      
      This patch is based on work done by Thomas Gleixner and Kate Stewart and
      Philippe Ombredanne.
      
      How this work was done:
      
      Patches were generated and checked against linux-4.14-rc6 for a subset of
      the use cases:
       - file had no licensing information it it.
       - file was a */uapi/* one with no licensing information in it,
       - file was a */uapi/* one with existing licensing information,
      
      Further patches will be generated in subsequent months to fix up cases
      where non-standard license headers were used, and references to license
      had to be inferred by heuristics based on keywords.
      
      The analysis to determine which SPDX License Identifier to be applied to
      a file was done in a spreadsheet of side by side results from of the
      output of two independent scanners (ScanCode & Windriver) producing SPDX
      tag:value files created by Philippe Ombredanne.  Philippe prepared the
      base worksheet, and did an initial spot review of a few 1000 files.
      
      The 4.13 kernel was the starting point of the analysis with 60,537 files
      assessed.  Kate Stewart did a file by file comparison of the scanner
      results in the spreadsheet to determine which SPDX license identifier(s)
      to be applied to the file. She confirmed any determination that was not
      immediately clear with lawyers working with the Linux Foundation.
      
      Criteria used to select files for SPDX license identifier tagging was:
       - Files considered eligible had to be source code files.
       - Make and config files were included as candidates if they contained >5
         lines of source
       - File already had some variant of a license header in it (even if <5
         lines).
      
      All documentation files were explicitly excluded.
      
      The following heuristics were used to determine which SPDX license
      identifiers to apply.
      
       - when both scanners couldn't find any license traces, file was
         considered to have no license information in it, and the top level
         COPYING file license applied.
      
         For non */uapi/* files that summary was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0                                              11139
      
         and resulted in the first patch in this series.
      
         If that file was a */uapi/* path one, it was "GPL-2.0 WITH
         Linux-syscall-note" otherwise it was "GPL-2.0".  Results of that was:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|-------
         GPL-2.0 WITH Linux-syscall-note                        930
      
         and resulted in the second patch in this series.
      
       - if a file had some form of licensing information in it, and was one
         of the */uapi/* ones, it was denoted with the Linux-syscall-note if
         any GPL family license was found in the file or had no licensing in
         it (per prior point).  Results summary:
      
         SPDX license identifier                            # files
         ---------------------------------------------------|------
         GPL-2.0 WITH Linux-syscall-note                       270
         GPL-2.0+ WITH Linux-syscall-note                      169
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-2-Clause)    21
         ((GPL-2.0 WITH Linux-syscall-note) OR BSD-3-Clause)    17
         LGPL-2.1+ WITH Linux-syscall-note                      15
         GPL-1.0+ WITH Linux-syscall-note                       14
         ((GPL-2.0+ WITH Linux-syscall-note) OR BSD-3-Clause)    5
         LGPL-2.0+ WITH Linux-syscall-note                       4
         LGPL-2.1 WITH Linux-syscall-note                        3
         ((GPL-2.0 WITH Linux-syscall-note) OR MIT)              3
         ((GPL-2.0 WITH Linux-syscall-note) AND MIT)             1
      
         and that resulted in the third patch in this series.
      
       - when the two scanners agreed on the detected license(s), that became
         the concluded license(s).
      
       - when there was disagreement between the two scanners (one detected a
         license but the other didn't, or they both detected different
         licenses) a manual inspection of the file occurred.
      
       - In most cases a manual inspection of the information in the file
         resulted in a clear resolution of the license that should apply (and
         which scanner probably needed to revisit its heuristics).
      
       - When it was not immediately clear, the license identifier was
         confirmed with lawyers working with the Linux Foundation.
      
       - If there was any question as to the appropriate license identifier,
         the file was flagged for further research and to be revisited later
         in time.
      
      In total, over 70 hours of logged manual review was done on the
      spreadsheet to determine the SPDX license identifiers to apply to the
      source files by Kate, Philippe, Thomas and, in some cases, confirmation
      by lawyers working with the Linux Foundation.
      
      Kate also obtained a third independent scan of the 4.13 code base from
      FOSSology, and compared selected files where the other two scanners
      disagreed against that SPDX file, to see if there was new insights.  The
      Windriver scanner is based on an older version of FOSSology in part, so
      they are related.
      
      Thomas did random spot checks in about 500 files from the spreadsheets
      for the uapi headers and agreed with SPDX license identifier in the
      files he inspected. For the non-uapi files Thomas did random spot checks
      in about 15000 files.
      
      In initial set of patches against 4.14-rc6, 3 files were found to have
      copy/paste license identifier errors, and have been fixed to reflect the
      correct identifier.
      
      Additionally Philippe spent 10 hours this week doing a detailed manual
      inspection and review of the 12,461 patched files from the initial patch
      version early this week with:
       - a full scancode scan run, collecting the matched texts, detected
         license ids and scores
       - reviewing anything where there was a license detected (about 500+
         files) to ensure that the applied SPDX license was correct
       - reviewing anything where there was no detection but the patch license
         was not GPL-2.0 WITH Linux-syscall-note to ensure that the applied
         SPDX license was correct
      
      This produced a worksheet with 20 files needing minor correction.  This
      worksheet was then exported into 3 different .csv files for the
      different types of files to be modified.
      
      These .csv files were then reviewed by Greg.  Thomas wrote a script to
      parse the csv files and add the proper SPDX tag to the file, in the
      format that the file expected.  This script was further refined by Greg
      based on the output to detect more types of files automatically and to
      distinguish between header and source .c files (which need different
      comment types.)  Finally Greg ran the script using the .csv files to
      generate the patches.
      
      Reviewed-by: default avatarKate Stewart <kstewart@linuxfoundation.org>
      Reviewed-by: default avatarPhilippe Ombredanne <pombredanne@nexb.com>
      Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b2441318
    • Ben Skeggs's avatar
      drm/nouveau/mmu: remove old vmm frontend · 632b740c
      Ben Skeggs authored
      
      Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
      632b740c
Loading