[drm/nouveau] GeForce 8600 GT boot/suspend grumbling

2017-07-14 Thread Mike Galbraith
Greetings,

box: bog standard [tc]rusty old Nvidia equipped Q6600 Medion (Aldi) deskside
kernel: master.today (v4.12-11690-gccd5d1b91f22)

lspci -nn -d 10de:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G84 [GeForce 8600 
GT] [10de:0402] (rev a1)

abreviated dmesg:
...
[3.720990] fb: switching to nouveaufb from VESA VGA
[3.744489] Console: switching to colour dummy device 80x25
[3.744966] nouveau :01:00.0: NVIDIA G84 (084200a2)
...
[3.846963] usbcore: registered new interface driver uas
[3.849938] nouveau :01:00.0: bios: version 60.84.6e.00.12
[3.870769] hid-generic 0003:04CA:002B.0002: input,hidraw1: USB HID v1.11 
Keyboard [Liteon Wireless keyboard and mouse] on usb-:00:1d.0-1/input0
[3.870773] nouveau :01:00.0: bios: M0203T not found
[3.870774] nouveau :01:00.0: bios: M0203E not matched!
[3.870777] nouveau :01:00.0: fb: 256 MiB DDR2
[3.871168] input: Liteon Wireless keyboard and mouse as 
/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.1/0003:04CA:002B.0003/input/input7
[3.896090] usb 3-2: new low-speed USB device number 3 using uhci_hcd
[3.919101] [TTM] Zone  kernel: Available graphics memory: 3881208 kiB
[3.919106] [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[3.919110] [TTM] Initializing pool allocator
[3.919120] [TTM] Initializing DMA pool allocator
[3.919141] nouveau :01:00.0: DRM: VRAM: 256 MiB
[3.919146] nouveau :01:00.0: DRM: GART: 1048576 MiB
[3.919152] nouveau :01:00.0: DRM: TMDS table version 2.0
[3.919157] nouveau :01:00.0: DRM: DCB version 4.0
[3.919162] nouveau :01:00.0: DRM: DCB outp 00: 04000310 0028
[3.919167] nouveau :01:00.0: DRM: DCB outp 01: 02011300 0028
[3.919171] nouveau :01:00.0: DRM: DCB outp 02: 01011302 0030
[3.919176] nouveau :01:00.0: DRM: DCB outp 03: 02022322 00020010
[3.919180] nouveau :01:00.0: DRM: DCB outp 04: 010333f1 00c0c083
[3.919185] nouveau :01:00.0: DRM: DCB conn 00: 
[3.919189] nouveau :01:00.0: DRM: DCB conn 01: 1130
[3.919194] nouveau :01:00.0: DRM: DCB conn 02: 2261
[3.919198] nouveau :01:00.0: DRM: DCB conn 03: 0310
[3.919202] nouveau :01:00.0: DRM: DCB conn 04: 0311
[3.919206] nouveau :01:00.0: DRM: DCB conn 05: 0313
[3.919258] [ cut here ]
[3.919316] WARNING: CPU: 3 PID: 224 at 
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c:83 
nvkm_outp_xlat.isra.0+0x26/0x80 [nouveau]
[3.919322] Modules linked in: uas(E) usb_storage(E) hid_generic(E+) 
usbhid(E) nouveau(E+) wmi(E) video(E) i2c_algo_bit(E) ahci(E+) 
drm_kms_helper(E) syscopyarea(E) sysfillrect(E) libahci(E) sysimgblt(E) 
fb_sys_fops(E) firewire_ohci(E) libata(E) firewire_core(E) crc_itu_t(E) 
ehci_pci(E+) serio_raw(E) ttm(E) button(E) drm(E) uhci_hcd(E) ehci_hcd(E) 
usbcore(E) sg(E) dm_multipath(E) dm_mod(E) scsi_dh_rdac(E) scsi_dh_emc(E) 
scsi_dh_alua(E) scsi_mod(E) autofs4(E)
[3.919360] CPU: 3 PID: 224 Comm: systemd-udevd Tainted: GE   
4.12.0.gccd5d1b-master #186
[3.919366] Hardware name: MEDIONPC MS-7502/MS-7502, BIOS 6.00 PG 12/26/2007
[3.919370] task: 880211cd3d40 task.stack: c9714000
[3.919412] RIP: 0010:nvkm_outp_xlat.isra.0+0x26/0x80 [nouveau]
[3.919417] RSP: 0018:c97177b0 EFLAGS: 00010202
[3.919421] RAX: 88021128fc08 RBX: 880211c0aa80 RCX: c9717870
[3.919425] RDX: c97177fc RSI:  RDI: 0001
[3.919429] RBP: 88021128fc10 R08: 880211c0aa80 R09: 880211c0aa80
[3.919433] R10:  R11: ea00084cf980 R12: 8802130f5500
[3.919437] R13: 880211c0a9d0 R14: 0003 R15: 0004
[3.919442] FS:  7fe2035b68c0() GS:88022fd8() 
knlGS:
[3.919448] CS:  0010 DS:  ES:  CR0: 80050033
[3.919452] CR2: 7fe203586000 CR3: 0002133e3000 CR4: 06e0
[3.919456] Call Trace:
[3.919500]  nvkm_outp_ctor+0x105/0x130 [nouveau]
[3.919508]  ? kmem_cache_alloc_trace+0x135/0x140
[3.919550]  nvkm_disp_oneinit+0x132/0x510 [nouveau]
[3.919583]  nvkm_engine_init+0x74/0x1d0 [nouveau]
[3.919617]  nvkm_subdev_init+0xaf/0x200 [nouveau]
[3.919648]  nvkm_engine_ref+0x4a/0x70 [nouveau]
[3.919681]  nvkm_ioctl_new+0x118/0x280 [nouveau]
[3.919705]  ? drm_property_create+0x100/0x150 [drm]
[3.919746]  ? nvkm_udevice_map+0x40/0x40 [nouveau]
[3.919779]  nvkm_ioctl+0x13c/0x230 [nouveau]
[3.919785]  ? try_to_grab_pending+0xa7/0x130
[3.919816]  nvif_object_init+0xc0/0x130 [nouveau]
[3.919859]  nouveau_display_create+0x13e/0x630 [nouveau]
[3.919903]  nouveau_drm_load+0x1e2/0x8d0 [nouveau]
[3.919910]  ? sysfs_do_create_link_sd.isra.2+0x6b/0xb0
[3.919924]  drm_dev_register+0x139/0x1d0 [drm]
[3.919930]  ? pci_read_config_word.part.9+0x47/0x60
[

[drm/nouveau] GeForce 8600 GT boot/suspend grumbling

2017-07-14 Thread Mike Galbraith
Greetings,

box: bog standard [tc]rusty old Nvidia equipped Q6600 Medion (Aldi) deskside
kernel: master.today (v4.12-11690-gccd5d1b91f22)

lspci -nn -d 10de:
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation G84 [GeForce 8600 
GT] [10de:0402] (rev a1)

abreviated dmesg:
...
[3.720990] fb: switching to nouveaufb from VESA VGA
[3.744489] Console: switching to colour dummy device 80x25
[3.744966] nouveau :01:00.0: NVIDIA G84 (084200a2)
...
[3.846963] usbcore: registered new interface driver uas
[3.849938] nouveau :01:00.0: bios: version 60.84.6e.00.12
[3.870769] hid-generic 0003:04CA:002B.0002: input,hidraw1: USB HID v1.11 
Keyboard [Liteon Wireless keyboard and mouse] on usb-:00:1d.0-1/input0
[3.870773] nouveau :01:00.0: bios: M0203T not found
[3.870774] nouveau :01:00.0: bios: M0203E not matched!
[3.870777] nouveau :01:00.0: fb: 256 MiB DDR2
[3.871168] input: Liteon Wireless keyboard and mouse as 
/devices/pci:00/:00:1d.0/usb4/4-1/4-1:1.1/0003:04CA:002B.0003/input/input7
[3.896090] usb 3-2: new low-speed USB device number 3 using uhci_hcd
[3.919101] [TTM] Zone  kernel: Available graphics memory: 3881208 kiB
[3.919106] [TTM] Zone   dma32: Available graphics memory: 2097152 kiB
[3.919110] [TTM] Initializing pool allocator
[3.919120] [TTM] Initializing DMA pool allocator
[3.919141] nouveau :01:00.0: DRM: VRAM: 256 MiB
[3.919146] nouveau :01:00.0: DRM: GART: 1048576 MiB
[3.919152] nouveau :01:00.0: DRM: TMDS table version 2.0
[3.919157] nouveau :01:00.0: DRM: DCB version 4.0
[3.919162] nouveau :01:00.0: DRM: DCB outp 00: 04000310 0028
[3.919167] nouveau :01:00.0: DRM: DCB outp 01: 02011300 0028
[3.919171] nouveau :01:00.0: DRM: DCB outp 02: 01011302 0030
[3.919176] nouveau :01:00.0: DRM: DCB outp 03: 02022322 00020010
[3.919180] nouveau :01:00.0: DRM: DCB outp 04: 010333f1 00c0c083
[3.919185] nouveau :01:00.0: DRM: DCB conn 00: 
[3.919189] nouveau :01:00.0: DRM: DCB conn 01: 1130
[3.919194] nouveau :01:00.0: DRM: DCB conn 02: 2261
[3.919198] nouveau :01:00.0: DRM: DCB conn 03: 0310
[3.919202] nouveau :01:00.0: DRM: DCB conn 04: 0311
[3.919206] nouveau :01:00.0: DRM: DCB conn 05: 0313
[3.919258] [ cut here ]
[3.919316] WARNING: CPU: 3 PID: 224 at 
drivers/gpu/drm/nouveau/nvkm/engine/disp/outp.c:83 
nvkm_outp_xlat.isra.0+0x26/0x80 [nouveau]
[3.919322] Modules linked in: uas(E) usb_storage(E) hid_generic(E+) 
usbhid(E) nouveau(E+) wmi(E) video(E) i2c_algo_bit(E) ahci(E+) 
drm_kms_helper(E) syscopyarea(E) sysfillrect(E) libahci(E) sysimgblt(E) 
fb_sys_fops(E) firewire_ohci(E) libata(E) firewire_core(E) crc_itu_t(E) 
ehci_pci(E+) serio_raw(E) ttm(E) button(E) drm(E) uhci_hcd(E) ehci_hcd(E) 
usbcore(E) sg(E) dm_multipath(E) dm_mod(E) scsi_dh_rdac(E) scsi_dh_emc(E) 
scsi_dh_alua(E) scsi_mod(E) autofs4(E)
[3.919360] CPU: 3 PID: 224 Comm: systemd-udevd Tainted: GE   
4.12.0.gccd5d1b-master #186
[3.919366] Hardware name: MEDIONPC MS-7502/MS-7502, BIOS 6.00 PG 12/26/2007
[3.919370] task: 880211cd3d40 task.stack: c9714000
[3.919412] RIP: 0010:nvkm_outp_xlat.isra.0+0x26/0x80 [nouveau]
[3.919417] RSP: 0018:c97177b0 EFLAGS: 00010202
[3.919421] RAX: 88021128fc08 RBX: 880211c0aa80 RCX: c9717870
[3.919425] RDX: c97177fc RSI:  RDI: 0001
[3.919429] RBP: 88021128fc10 R08: 880211c0aa80 R09: 880211c0aa80
[3.919433] R10:  R11: ea00084cf980 R12: 8802130f5500
[3.919437] R13: 880211c0a9d0 R14: 0003 R15: 0004
[3.919442] FS:  7fe2035b68c0() GS:88022fd8() 
knlGS:
[3.919448] CS:  0010 DS:  ES:  CR0: 80050033
[3.919452] CR2: 7fe203586000 CR3: 0002133e3000 CR4: 06e0
[3.919456] Call Trace:
[3.919500]  nvkm_outp_ctor+0x105/0x130 [nouveau]
[3.919508]  ? kmem_cache_alloc_trace+0x135/0x140
[3.919550]  nvkm_disp_oneinit+0x132/0x510 [nouveau]
[3.919583]  nvkm_engine_init+0x74/0x1d0 [nouveau]
[3.919617]  nvkm_subdev_init+0xaf/0x200 [nouveau]
[3.919648]  nvkm_engine_ref+0x4a/0x70 [nouveau]
[3.919681]  nvkm_ioctl_new+0x118/0x280 [nouveau]
[3.919705]  ? drm_property_create+0x100/0x150 [drm]
[3.919746]  ? nvkm_udevice_map+0x40/0x40 [nouveau]
[3.919779]  nvkm_ioctl+0x13c/0x230 [nouveau]
[3.919785]  ? try_to_grab_pending+0xa7/0x130
[3.919816]  nvif_object_init+0xc0/0x130 [nouveau]
[3.919859]  nouveau_display_create+0x13e/0x630 [nouveau]
[3.919903]  nouveau_drm_load+0x1e2/0x8d0 [nouveau]
[3.919910]  ? sysfs_do_create_link_sd.isra.2+0x6b/0xb0
[3.919924]  drm_dev_register+0x139/0x1d0 [drm]
[3.919930]  ? pci_read_config_word.part.9+0x47/0x60
[

Re: [PATCH 5/5] sched: Accumulate vtime on top of nsec clocksource

2017-07-14 Thread Wanpeng Li
2017-07-15 11:37 GMT+08:00 Levin, Alexander (Sasha Levin)
<alexander.le...@verizon.com>:
> On Thu, Jun 29, 2017 at 07:15:11PM +0200, Frederic Weisbecker wrote:
>>From: Wanpeng Li <kernel...@gmail.com>
>>
>>Currently the cputime source used by vtime is jiffies. When we cross
>>a context boundary and jiffies have changed since the last snapshot, the
>>pending cputime is accounted to the switching out context.
>>
>>This system works ok if the ticks are not aligned across CPUs. If they
>>instead are aligned (ie: all fire at the same time) and the CPUs run in
>>userspace, the jiffies change is only observed on tick exit and therefore
>>the user cputime is accounted as system cputime. This is because the
>>CPU that maintains timekeeping fires its tick at the same time as the
>>others. It updates jiffies in the middle of the tick and the other CPUs
>>see that update on IRQ exit:
>>
>>CPU 0 (timekeeper)  CPU 1
>>---  -
>>  jiffies = N
>>...  run in userspace for a jiffy
>>tick entry   tick entry (sees jiffies = N)
>>set jiffies = N + 1
>>tick exittick exit (sees jiffies = N + 1)
>>account 1 jiffy as stime
>>
>>Fix this with using a nanosec clock source instead of jiffies. The
>>cputime is then accumulated and flushed everytime the pending delta
>>reaches a jiffy in order to mitigate the accounting overhead.
>>
>>[fweisbec: changelog, rebase on struct vtime, field renames, add delta
>>on cputime readers, keep idle vtime as-is (low overhead accounting),
>>harmonize clock sources]
>>
>>Reported-by: Luiz Capitulino <lcapitul...@redhat.com>
>>Suggested-by: Thomas Gleixner <t...@linutronix.de>
>>Not-Yet-Signed-off-by: Wanpeng Li <kernel...@gmail.com>
>>Cc: Rik van Riel <r...@redhat.com>
>>Cc: Peter Zijlstra <pet...@infradead.org>
>>Cc: Thomas Gleixner <t...@linutronix.de>
>>Cc: Wanpeng Li <kernel...@gmail.com>
>>Cc: Ingo Molnar <mi...@kernel.org>
>>Cc: Luiz Capitulino <lcapitul...@redhat.com>
>>Signed-off-by: Frederic Weisbecker <fweis...@gmail.com>
>
> Hi all,
>
> This patch seems to be causing this:

Yeah, there is a patch to fix it.
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=0e4097c3354e2f5a5ad8affd9dc7f7f7d00bb6b9

Regards,
Wanpeng Li

>
> BUG: using smp_processor_id() in preemptible [] code: kworker/u9:0/6
> caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
> CPU: 1 PID: 6 Comm: kworker/u9:0 Not tainted 4.12.0-next-20170714 #187
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
> 04/01/2014
> Workqueue: events_unbound call_usermodehelper_exec_work
> Call Trace:
>  __dump_stack lib/dump_stack.c:16 [inline]
>  dump_stack+0x11d/0x1ef lib/dump_stack.c:52
>  check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
>  debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
>  vtime_delta.isra.6+0x11/0x60 kernel/sched/cputime.c:686
>  task_cputime+0x3ca/0x790 kernel/sched/cputime.c:882
>  thread_group_cputime+0x51a/0xaa0 kernel/sched/cputime.c:327
>  thread_group_cputime_adjusted+0x73/0xf0 kernel/sched/cputime.c:676
>  wait_task_zombie kernel/exit.c:1114 [inline]
>  wait_consider_task+0x1c82/0x37f0 kernel/exit.c:1389
>  do_wait_thread kernel/exit.c:1452 [inline]
>  do_wait+0x457/0xb00 kernel/exit.c:1523
>  kernel_wait4+0x1fd/0x380 kernel/exit.c:1665
>  SYSC_wait4+0x145/0x160 kernel/exit.c:1677
>  SyS_wait4+0x2c/0x40 kernel/exit.c:1673
>  call_usermodehelper_exec_sync kernel/kmod.c:286 [inline]
>  call_usermodehelper_exec_work+0x1fc/0x2c0 kernel/kmod.c:323
>  process_one_work+0xae7/0x1a00 kernel/workqueue.c:2097
>  worker_thread+0x221/0x1860 kernel/workqueue.c:2231
>  kthread+0x35f/0x430 kernel/kthread.c:231
>  ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:425
> capability: warning: `syz-executor5' uses 32-bit capabilities (legacy support 
> in use)
> BUG: using smp_processor_id() in preemptible [] code: 
> syz-executor6/7013
> caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
> CPU: 3 PID: 7013 Comm: syz-executor6 Not tainted 4.12.0-next-20170714 #187
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
> 04/01/2014
> Call Trace:
>  __dump_stack lib/dump_stack.c:16 [inline]
>  dump_stack+0x11d/0x1ef lib/dump_stack.c:52
>  check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
>  debug_smp_processo

Re: [PATCH 5/5] sched: Accumulate vtime on top of nsec clocksource

2017-07-14 Thread Wanpeng Li
2017-07-15 11:37 GMT+08:00 Levin, Alexander (Sasha Levin)
:
> On Thu, Jun 29, 2017 at 07:15:11PM +0200, Frederic Weisbecker wrote:
>>From: Wanpeng Li 
>>
>>Currently the cputime source used by vtime is jiffies. When we cross
>>a context boundary and jiffies have changed since the last snapshot, the
>>pending cputime is accounted to the switching out context.
>>
>>This system works ok if the ticks are not aligned across CPUs. If they
>>instead are aligned (ie: all fire at the same time) and the CPUs run in
>>userspace, the jiffies change is only observed on tick exit and therefore
>>the user cputime is accounted as system cputime. This is because the
>>CPU that maintains timekeeping fires its tick at the same time as the
>>others. It updates jiffies in the middle of the tick and the other CPUs
>>see that update on IRQ exit:
>>
>>CPU 0 (timekeeper)  CPU 1
>>---  -
>>  jiffies = N
>>...  run in userspace for a jiffy
>>tick entry   tick entry (sees jiffies = N)
>>set jiffies = N + 1
>>tick exittick exit (sees jiffies = N + 1)
>>account 1 jiffy as stime
>>
>>Fix this with using a nanosec clock source instead of jiffies. The
>>cputime is then accumulated and flushed everytime the pending delta
>>reaches a jiffy in order to mitigate the accounting overhead.
>>
>>[fweisbec: changelog, rebase on struct vtime, field renames, add delta
>>on cputime readers, keep idle vtime as-is (low overhead accounting),
>>harmonize clock sources]
>>
>>Reported-by: Luiz Capitulino 
>>Suggested-by: Thomas Gleixner 
>>Not-Yet-Signed-off-by: Wanpeng Li 
>>Cc: Rik van Riel 
>>Cc: Peter Zijlstra 
>>Cc: Thomas Gleixner 
>>Cc: Wanpeng Li 
>>Cc: Ingo Molnar 
>>Cc: Luiz Capitulino 
>>Signed-off-by: Frederic Weisbecker 
>
> Hi all,
>
> This patch seems to be causing this:

Yeah, there is a patch to fix it.
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=0e4097c3354e2f5a5ad8affd9dc7f7f7d00bb6b9

Regards,
Wanpeng Li

>
> BUG: using smp_processor_id() in preemptible [] code: kworker/u9:0/6
> caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
> CPU: 1 PID: 6 Comm: kworker/u9:0 Not tainted 4.12.0-next-20170714 #187
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
> 04/01/2014
> Workqueue: events_unbound call_usermodehelper_exec_work
> Call Trace:
>  __dump_stack lib/dump_stack.c:16 [inline]
>  dump_stack+0x11d/0x1ef lib/dump_stack.c:52
>  check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
>  debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
>  vtime_delta.isra.6+0x11/0x60 kernel/sched/cputime.c:686
>  task_cputime+0x3ca/0x790 kernel/sched/cputime.c:882
>  thread_group_cputime+0x51a/0xaa0 kernel/sched/cputime.c:327
>  thread_group_cputime_adjusted+0x73/0xf0 kernel/sched/cputime.c:676
>  wait_task_zombie kernel/exit.c:1114 [inline]
>  wait_consider_task+0x1c82/0x37f0 kernel/exit.c:1389
>  do_wait_thread kernel/exit.c:1452 [inline]
>  do_wait+0x457/0xb00 kernel/exit.c:1523
>  kernel_wait4+0x1fd/0x380 kernel/exit.c:1665
>  SYSC_wait4+0x145/0x160 kernel/exit.c:1677
>  SyS_wait4+0x2c/0x40 kernel/exit.c:1673
>  call_usermodehelper_exec_sync kernel/kmod.c:286 [inline]
>  call_usermodehelper_exec_work+0x1fc/0x2c0 kernel/kmod.c:323
>  process_one_work+0xae7/0x1a00 kernel/workqueue.c:2097
>  worker_thread+0x221/0x1860 kernel/workqueue.c:2231
>  kthread+0x35f/0x430 kernel/kthread.c:231
>  ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:425
> capability: warning: `syz-executor5' uses 32-bit capabilities (legacy support 
> in use)
> BUG: using smp_processor_id() in preemptible [] code: 
> syz-executor6/7013
> caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
> CPU: 3 PID: 7013 Comm: syz-executor6 Not tainted 4.12.0-next-20170714 #187
> Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
> 04/01/2014
> Call Trace:
>  __dump_stack lib/dump_stack.c:16 [inline]
>  dump_stack+0x11d/0x1ef lib/dump_stack.c:52
>  check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
>  debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
>  vtime_delta.isra.6+0x11/0x60 kernel/sched/cputime.c:686
>  task_cputime+0x3ca/0x790 kernel/sched/cputime.c:882
>  thread_group_cputime+0x51a/0xaa0 kernel/sched/cputime.c:327
>  thread_group_cputime_adjusted+0x73/0xf0 kernel/sched/cputime.c:676
>  wait_task_zombie kern

Re: [RFC V2 1/6] cpufreq: Replace "max_transition_latency" with "dynamic_switching"

2017-07-14 Thread Dominik Brodowski
On Sat, Jul 15, 2017 at 12:06:24AM +0200, Rafael J. Wysocki wrote:
> On Friday, July 14, 2017 01:11:58 PM Rafael J. Wysocki wrote:
> > On Fri, Jul 14, 2017 at 9:01 AM, Dominik Brodowski
> >  wrote:
> > > On Thu, Jul 13, 2017 at 06:19:53PM +0200, Rafael J. Wysocki wrote:
> > >> On Thu, Jul 13, 2017 at 7:40 AM, Viresh Kumar  
> > >> wrote:
> > >> > There is no limitation in the ondemand or conservative governors which
> > >> > disallow the transition_latency to be greater than 10 ms.
> > >> >
> > >> > The max_transition_latency field is rather used to disallow automatic
> > >> > dynamic frequency switching for platforms which didn't wanted these
> > >> > governors to run.
> > >> >
> > >> > Replace max_transition_latency with a boolean (dynamic_switching) and
> > >> > check for transition_latency == CPUFREQ_ETERNAL along with that. This
> > >> > makes it pretty straight forward to read/understand now.
> > >>
> > >> Well, using CPUFREQ_ETERNAL for that on the driver side is still not
> > >> particularly straightforward IMO, so maybe add a
> > >> "no_dynamic_switching" to the driver structure and set it to "true"
> > >> for the one driver in question?
> > >
> > > IIRC it's not just one driver which sets the latency to CPUFREQ_ETERNAL, 
> > > and
> > > where dynamic switching might be harmful or at least lead to undefined
> > > behavior.
> > 
> > OK
> > 
> > Still, though, using CPUFREQ_ETERNAL to indicate the "no dynamic
> > switching" condition is somewhat convoluted, so why don't we have a
> > flag to *explicitly* say that instead?
> > 
> > Do you know which drivers they are or is it just all drivers that use
> > CPUFREQ_ETERNAL?
> 
> Well, after the $subject patch it effectively is all drivers that use
> CPUFREQ_ETERNAL anyway, so it looks like we actually can do a complete
> switch-over.

Exactly. But lets take a quick look at the drivers ussing CPUFREQ_ETERNAL:

Using CPUFREQ_ETERNAL, as policy-setting drivers:

- intel_pstate.c - for the intel_pstate driver, which defers to the hardware
  to do frequency selection.

- longrun.c - hardware-based frequency selection.

=> Those drivers are not interested in kernel-based dynamic frequency
selection anyway.


Using CPUFREQ_ETERNAL as a fallback if transition_latency is unknown:
- arm_big_little.c
- arm_big_little_dt.c
- cpufreq-dt.c
- imx6q-cpufreq.c
- spear_cpufreq.c

=> As it seems to be an error case, it seems best to bail out on the
safe side and disallow dynamic frequency scaling. Platform experts might
know better, though.


Using CPUFREQ_ETERNAL unconditionally:
- cpufreq-nforce2.c - over a decade old driver; has a commented-out hack
  to mdelay(10ms) after each frequency transition. This smells like it might
  be unsafe to do dynamic switching more often than that.

- elanfreq.c - Has udelay(1ms+10ms) in transition path, so the same terms
  and conditions seem to apply.

- gx-suspmod.c - works by a mechanism which reminds me of CPU frequency
  throttling, but chipset- and not CPU-based.

- pmac32-cpufreq.c - for some models, it sets latency to ETERNAL. In some
  frequency switchign code, it has mdelay(10ms) calls.

- speedsstep-smi.c - this case was discussed previously.

=> For those drivers, dynamic frequency scaling should not be enabled IMO.


- sa1100-cpufreq.c and
- sa1110-cpufreq.c - If I remember correctly, those drivers were used for
  fast user-space based frequency scaling in the past. 

=> For these two drivers, enabling DFVS might be an option.


- sh-cpufreq.c - looks fast, but I have no clue.

- unicore2-cpufreq.c - same.

=> For those drivers, I have no clue. So to be on the safe side, I'd opt for
dynamic frequency scaling to be set to off.


To summarize: At first, I'd propose a *complete* switch-over from
CPUFREQ_ETERNAL to setting the flag "no DVFS" you have proposed. Then, one
might discuss with the maintainers of individual drivers/platforms on
whether to relax this rule for a few of those drivers (sa11x0, sh-cpufreq,
unicore2-cpufreq and the drivers using CPUFREQ_ETERNAL as a fallback).

Best,
Dominik


signature.asc
Description: PGP signature


Re: [RFC V2 1/6] cpufreq: Replace "max_transition_latency" with "dynamic_switching"

2017-07-14 Thread Dominik Brodowski
On Sat, Jul 15, 2017 at 12:06:24AM +0200, Rafael J. Wysocki wrote:
> On Friday, July 14, 2017 01:11:58 PM Rafael J. Wysocki wrote:
> > On Fri, Jul 14, 2017 at 9:01 AM, Dominik Brodowski
> >  wrote:
> > > On Thu, Jul 13, 2017 at 06:19:53PM +0200, Rafael J. Wysocki wrote:
> > >> On Thu, Jul 13, 2017 at 7:40 AM, Viresh Kumar  
> > >> wrote:
> > >> > There is no limitation in the ondemand or conservative governors which
> > >> > disallow the transition_latency to be greater than 10 ms.
> > >> >
> > >> > The max_transition_latency field is rather used to disallow automatic
> > >> > dynamic frequency switching for platforms which didn't wanted these
> > >> > governors to run.
> > >> >
> > >> > Replace max_transition_latency with a boolean (dynamic_switching) and
> > >> > check for transition_latency == CPUFREQ_ETERNAL along with that. This
> > >> > makes it pretty straight forward to read/understand now.
> > >>
> > >> Well, using CPUFREQ_ETERNAL for that on the driver side is still not
> > >> particularly straightforward IMO, so maybe add a
> > >> "no_dynamic_switching" to the driver structure and set it to "true"
> > >> for the one driver in question?
> > >
> > > IIRC it's not just one driver which sets the latency to CPUFREQ_ETERNAL, 
> > > and
> > > where dynamic switching might be harmful or at least lead to undefined
> > > behavior.
> > 
> > OK
> > 
> > Still, though, using CPUFREQ_ETERNAL to indicate the "no dynamic
> > switching" condition is somewhat convoluted, so why don't we have a
> > flag to *explicitly* say that instead?
> > 
> > Do you know which drivers they are or is it just all drivers that use
> > CPUFREQ_ETERNAL?
> 
> Well, after the $subject patch it effectively is all drivers that use
> CPUFREQ_ETERNAL anyway, so it looks like we actually can do a complete
> switch-over.

Exactly. But lets take a quick look at the drivers ussing CPUFREQ_ETERNAL:

Using CPUFREQ_ETERNAL, as policy-setting drivers:

- intel_pstate.c - for the intel_pstate driver, which defers to the hardware
  to do frequency selection.

- longrun.c - hardware-based frequency selection.

=> Those drivers are not interested in kernel-based dynamic frequency
selection anyway.


Using CPUFREQ_ETERNAL as a fallback if transition_latency is unknown:
- arm_big_little.c
- arm_big_little_dt.c
- cpufreq-dt.c
- imx6q-cpufreq.c
- spear_cpufreq.c

=> As it seems to be an error case, it seems best to bail out on the
safe side and disallow dynamic frequency scaling. Platform experts might
know better, though.


Using CPUFREQ_ETERNAL unconditionally:
- cpufreq-nforce2.c - over a decade old driver; has a commented-out hack
  to mdelay(10ms) after each frequency transition. This smells like it might
  be unsafe to do dynamic switching more often than that.

- elanfreq.c - Has udelay(1ms+10ms) in transition path, so the same terms
  and conditions seem to apply.

- gx-suspmod.c - works by a mechanism which reminds me of CPU frequency
  throttling, but chipset- and not CPU-based.

- pmac32-cpufreq.c - for some models, it sets latency to ETERNAL. In some
  frequency switchign code, it has mdelay(10ms) calls.

- speedsstep-smi.c - this case was discussed previously.

=> For those drivers, dynamic frequency scaling should not be enabled IMO.


- sa1100-cpufreq.c and
- sa1110-cpufreq.c - If I remember correctly, those drivers were used for
  fast user-space based frequency scaling in the past. 

=> For these two drivers, enabling DFVS might be an option.


- sh-cpufreq.c - looks fast, but I have no clue.

- unicore2-cpufreq.c - same.

=> For those drivers, I have no clue. So to be on the safe side, I'd opt for
dynamic frequency scaling to be set to off.


To summarize: At first, I'd propose a *complete* switch-over from
CPUFREQ_ETERNAL to setting the flag "no DVFS" you have proposed. Then, one
might discuss with the maintainers of individual drivers/platforms on
whether to relax this rule for a few of those drivers (sa11x0, sh-cpufreq,
unicore2-cpufreq and the drivers using CPUFREQ_ETERNAL as a fallback).

Best,
Dominik


signature.asc
Description: PGP signature


[PATCH] debug: fix WARN_ON_ONCE() for modules

2017-07-14 Thread Josh Poimboeuf
Mike Galbraith reported a situation where a WARN_ON_ONCE() call in DRM
code turned into an oops.  As it turns out, WARN_ON_ONCE() seems to be
completely broken when called from a module.

The bug was introduced with the following commit:

  19d436268dde ("debug: Add _ONCE() logic to report_bug()")

That commit changed WARN_ON_ONCE() to move its 'once' logic into the bug
trap handler.  It requires a writable bug table so that the BUGFLAG_DONE
bit can be written to the flags to indicate the first warning has
occurred.

The bug table was made writable for vmlinux, which relies on
vmlinux.lds.S and vmlinux.lds.h for laying out the sections.  However,
it wasn't made writable for modules, which rely on the ELF section
header flags.

Reported-by: Mike Galbraith 
Fixes: 19d436268dde ("debug: Add _ONCE() logic to report_bug()")
Signed-off-by: Josh Poimboeuf 
---
 arch/arm/include/asm/bug.h  | 2 +-
 arch/arm64/include/asm/bug.h| 2 +-
 arch/blackfin/include/asm/bug.h | 4 ++--
 arch/mn10300/include/asm/bug.h  | 2 +-
 arch/parisc/include/asm/bug.h   | 6 +++---
 arch/powerpc/include/asm/bug.h  | 8 
 arch/s390/include/asm/bug.h | 4 ++--
 arch/sh/include/asm/bug.h   | 4 ++--
 arch/x86/include/asm/bug.h  | 4 ++--
 9 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 4e6e88a..2244a94e 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -37,7 +37,7 @@ do {  
\
".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \
"2:\t.asciz " #__file "\n"  \
".popsection\n" \
-   ".pushsection __bug_table,\"a\"\n"  \
+   ".pushsection __bug_table,\"aw\"\n" \
".align 2\n"\
"3:\t.word 1b, 2b\n"\
"\t.hword " #__line ", 0\n" \
diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
index 366448e..a02a571 100644
--- a/arch/arm64/include/asm/bug.h
+++ b/arch/arm64/include/asm/bug.h
@@ -36,7 +36,7 @@
 #ifdef CONFIG_GENERIC_BUG
 
 #define __BUG_ENTRY(flags) \
-   ".pushsection __bug_table,\"a\"\n\t"\
+   ".pushsection __bug_table,\"aw\"\n\t"   \
".align 2\n\t"  \
"0: .long 1f - 0b\n\t"  \
 _BUGVERBOSE_LOCATION(__FILE__, __LINE__)   \
diff --git a/arch/blackfin/include/asm/bug.h b/arch/blackfin/include/asm/bug.h
index 8d9b1eb..76b2e82 100644
--- a/arch/blackfin/include/asm/bug.h
+++ b/arch/blackfin/include/asm/bug.h
@@ -21,7 +21,7 @@
 #define _BUG_OR_WARN(flags)\
asm volatile(   \
"1: .hword  %0\n"   \
-   "   .section __bug_table,\"a\",@progbits\n" \
+   "   .section __bug_table,\"aw\",@progbits\n"\
"2: .long   1b\n"   \
"   .long   %1\n"   \
"   .short  %2\n"   \
@@ -38,7 +38,7 @@
 #define _BUG_OR_WARN(flags)\
asm volatile(   \
"1: .hword  %0\n"   \
-   "   .section __bug_table,\"a\",@progbits\n" \
+   "   .section __bug_table,\"aw\",@progbits\n"\
"2: .long   1b\n"   \
"   .short  %1\n"   \
"   .org2b + %2\n"  \
diff --git a/arch/mn10300/include/asm/bug.h b/arch/mn10300/include/asm/bug.h
index aa6a388..811414f 100644
--- a/arch/mn10300/include/asm/bug.h
+++ b/arch/mn10300/include/asm/bug.h
@@ -21,7 +21,7 @@ do {  
\
asm volatile(   \
"   syscall 15  \n" \
"0: \n" \
-   "   .section __bug_table,\"a\"  \n" \
+   "   .section __bug_table,\"aw\" \n" \
"   .long 0b,%0,%1  \n" \
"   .previous   \n" \
:   \
diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug.h
index d274227..07ea467 100644
--- 

[PATCH] debug: fix WARN_ON_ONCE() for modules

2017-07-14 Thread Josh Poimboeuf
Mike Galbraith reported a situation where a WARN_ON_ONCE() call in DRM
code turned into an oops.  As it turns out, WARN_ON_ONCE() seems to be
completely broken when called from a module.

The bug was introduced with the following commit:

  19d436268dde ("debug: Add _ONCE() logic to report_bug()")

That commit changed WARN_ON_ONCE() to move its 'once' logic into the bug
trap handler.  It requires a writable bug table so that the BUGFLAG_DONE
bit can be written to the flags to indicate the first warning has
occurred.

The bug table was made writable for vmlinux, which relies on
vmlinux.lds.S and vmlinux.lds.h for laying out the sections.  However,
it wasn't made writable for modules, which rely on the ELF section
header flags.

Reported-by: Mike Galbraith 
Fixes: 19d436268dde ("debug: Add _ONCE() logic to report_bug()")
Signed-off-by: Josh Poimboeuf 
---
 arch/arm/include/asm/bug.h  | 2 +-
 arch/arm64/include/asm/bug.h| 2 +-
 arch/blackfin/include/asm/bug.h | 4 ++--
 arch/mn10300/include/asm/bug.h  | 2 +-
 arch/parisc/include/asm/bug.h   | 6 +++---
 arch/powerpc/include/asm/bug.h  | 8 
 arch/s390/include/asm/bug.h | 4 ++--
 arch/sh/include/asm/bug.h   | 4 ++--
 arch/x86/include/asm/bug.h  | 4 ++--
 9 files changed, 18 insertions(+), 18 deletions(-)

diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
index 4e6e88a..2244a94e 100644
--- a/arch/arm/include/asm/bug.h
+++ b/arch/arm/include/asm/bug.h
@@ -37,7 +37,7 @@ do {  
\
".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \
"2:\t.asciz " #__file "\n"  \
".popsection\n" \
-   ".pushsection __bug_table,\"a\"\n"  \
+   ".pushsection __bug_table,\"aw\"\n" \
".align 2\n"\
"3:\t.word 1b, 2b\n"\
"\t.hword " #__line ", 0\n" \
diff --git a/arch/arm64/include/asm/bug.h b/arch/arm64/include/asm/bug.h
index 366448e..a02a571 100644
--- a/arch/arm64/include/asm/bug.h
+++ b/arch/arm64/include/asm/bug.h
@@ -36,7 +36,7 @@
 #ifdef CONFIG_GENERIC_BUG
 
 #define __BUG_ENTRY(flags) \
-   ".pushsection __bug_table,\"a\"\n\t"\
+   ".pushsection __bug_table,\"aw\"\n\t"   \
".align 2\n\t"  \
"0: .long 1f - 0b\n\t"  \
 _BUGVERBOSE_LOCATION(__FILE__, __LINE__)   \
diff --git a/arch/blackfin/include/asm/bug.h b/arch/blackfin/include/asm/bug.h
index 8d9b1eb..76b2e82 100644
--- a/arch/blackfin/include/asm/bug.h
+++ b/arch/blackfin/include/asm/bug.h
@@ -21,7 +21,7 @@
 #define _BUG_OR_WARN(flags)\
asm volatile(   \
"1: .hword  %0\n"   \
-   "   .section __bug_table,\"a\",@progbits\n" \
+   "   .section __bug_table,\"aw\",@progbits\n"\
"2: .long   1b\n"   \
"   .long   %1\n"   \
"   .short  %2\n"   \
@@ -38,7 +38,7 @@
 #define _BUG_OR_WARN(flags)\
asm volatile(   \
"1: .hword  %0\n"   \
-   "   .section __bug_table,\"a\",@progbits\n" \
+   "   .section __bug_table,\"aw\",@progbits\n"\
"2: .long   1b\n"   \
"   .short  %1\n"   \
"   .org2b + %2\n"  \
diff --git a/arch/mn10300/include/asm/bug.h b/arch/mn10300/include/asm/bug.h
index aa6a388..811414f 100644
--- a/arch/mn10300/include/asm/bug.h
+++ b/arch/mn10300/include/asm/bug.h
@@ -21,7 +21,7 @@ do {  
\
asm volatile(   \
"   syscall 15  \n" \
"0: \n" \
-   "   .section __bug_table,\"a\"  \n" \
+   "   .section __bug_table,\"aw\" \n" \
"   .long 0b,%0,%1  \n" \
"   .previous   \n" \
:   \
diff --git a/arch/parisc/include/asm/bug.h b/arch/parisc/include/asm/bug.h
index d274227..07ea467 100644
--- a/arch/parisc/include/asm/bug.h
+++ 

Re: [PATCH 0/2] Avoid crashes by early (boot) consoles using init memory

2017-07-14 Thread Fabio M. Di Nitto
On 7/14/2017 4:37 PM, Petr Mladek wrote:
> On Fri 2017-07-14 14:57:45, Fabio M. Di Nitto wrote:
>> Hi Petr,
>>
>> On 7/14/2017 2:51 PM, Petr Mladek wrote:
>>> Some early consoles have code and data in the init section. It makes some
>>> sense but this might cause problems when they are not replaced by
>>> the real console in time. The two patches fix the safequard and
>>> help to avoid the problems.
>>>
>>> I though about removing keep_bootcon option completely. But it is useful
>>> at least for now.
>>
>> Let´s just keep in mind that keep_bootcon was introduced only to debug
>> issues (read crashes or hangs) that could happen between disabling
>> bootconsole and enabling the real console. It shouldn´t be used for
>> anything else really.
> 
> This was my initial replay as well. But then I realized that
> it was a bad idea to use a freed code and data to debug any other
> issue. It would just create crazy issues on its own.

Perhaps some changes that were made later in the code introduced this
behavior. I honestly didn´t check. It´s been just so long ago :-)

> 
> I tried to google 'keep_bootcon'. It found several links to strange
> crashes related to this option. Maybe I was not patient enough but
> I did not find any page where this option was suggested and helped.

It´s in Documentation/admin-guide/kernel-parameters.txt. It´s also rare
that consoles are not working or something is crashing in that small
window, so I am not entirely surprised that there are few to none
references of users using it.

> 
> I still think that the option makes some sense but only when
> it does not cause more breakages on its own.

agreed.

Cheers
Fabio

> 
>> If the new code can replace keep_bootcon, by all mean, go for it :-)
> 
> keep_bootcon stays usable for most early consoles. We print a warning
> when an unusable console is disabled too early. Also there is a
> comment how to fix it.
> 
> Best Regards,
> Petr
> 



Re: [PATCH 0/2] Avoid crashes by early (boot) consoles using init memory

2017-07-14 Thread Fabio M. Di Nitto
On 7/14/2017 4:37 PM, Petr Mladek wrote:
> On Fri 2017-07-14 14:57:45, Fabio M. Di Nitto wrote:
>> Hi Petr,
>>
>> On 7/14/2017 2:51 PM, Petr Mladek wrote:
>>> Some early consoles have code and data in the init section. It makes some
>>> sense but this might cause problems when they are not replaced by
>>> the real console in time. The two patches fix the safequard and
>>> help to avoid the problems.
>>>
>>> I though about removing keep_bootcon option completely. But it is useful
>>> at least for now.
>>
>> Let´s just keep in mind that keep_bootcon was introduced only to debug
>> issues (read crashes or hangs) that could happen between disabling
>> bootconsole and enabling the real console. It shouldn´t be used for
>> anything else really.
> 
> This was my initial replay as well. But then I realized that
> it was a bad idea to use a freed code and data to debug any other
> issue. It would just create crazy issues on its own.

Perhaps some changes that were made later in the code introduced this
behavior. I honestly didn´t check. It´s been just so long ago :-)

> 
> I tried to google 'keep_bootcon'. It found several links to strange
> crashes related to this option. Maybe I was not patient enough but
> I did not find any page where this option was suggested and helped.

It´s in Documentation/admin-guide/kernel-parameters.txt. It´s also rare
that consoles are not working or something is crashing in that small
window, so I am not entirely surprised that there are few to none
references of users using it.

> 
> I still think that the option makes some sense but only when
> it does not cause more breakages on its own.

agreed.

Cheers
Fabio

> 
>> If the new code can replace keep_bootcon, by all mean, go for it :-)
> 
> keep_bootcon stays usable for most early consoles. We print a warning
> when an unusable console is disabled too early. Also there is a
> comment how to fix it.
> 
> Best Regards,
> Petr
> 



Re: [HMM 12/15] mm/migrate: new memory migration helper for use with device memory v4

2017-07-14 Thread Evgeny Baskakov

On 7/14/17 5:55 PM, Jerome Glisse wrote:

So pushed an updated hmm-next branch this should fix all issues you had.
Thought i am not sure about the test in this mail, all i see is that it
continously spit error messages but it does not hang (i let it run 20min
or so). Dunno if that is what expected. Let me know if this is still an
issue and if so what should be the expected output of this test program.

Cheers,
Jérôme


Thanks, Jerome. The kernel hang indeed seems to be fixed.

Regarding the last issue I reported. It still persists. The test program 
should eventually exit. Instead, it loops indefinitely (sorry, I was not 
clear when I called it 'app-side hang').


This is what's expected. The number of error messages can be random, but 
must be finite; the program must print "OK" at the end:


$ ./run.sh
&&& 1 migrate threads: STARTING
iteration 0
thread 0 is migrating 1 pages starting from 0x7f6abce79000
migrate_thread_func:87: failed to migrate pages at 0x7f6abce79000 
(migrate.npages (tid 0): 9725 != npages: 1)

thread 0 is migrating 1 pages starting from 0x7f6abce79000
thread 0 is migrating 1 pages starting from 0x7f6abce79000
&&& 1 migrate threads: PASSED
(OK)[./sanity_rmem004] anon migration read test

Thanks,

--
Evgeny Baskakov
NVIDIA



Re: [HMM 12/15] mm/migrate: new memory migration helper for use with device memory v4

2017-07-14 Thread Evgeny Baskakov

On 7/14/17 5:55 PM, Jerome Glisse wrote:

So pushed an updated hmm-next branch this should fix all issues you had.
Thought i am not sure about the test in this mail, all i see is that it
continously spit error messages but it does not hang (i let it run 20min
or so). Dunno if that is what expected. Let me know if this is still an
issue and if so what should be the expected output of this test program.

Cheers,
Jérôme


Thanks, Jerome. The kernel hang indeed seems to be fixed.

Regarding the last issue I reported. It still persists. The test program 
should eventually exit. Instead, it loops indefinitely (sorry, I was not 
clear when I called it 'app-side hang').


This is what's expected. The number of error messages can be random, but 
must be finite; the program must print "OK" at the end:


$ ./run.sh
&&& 1 migrate threads: STARTING
iteration 0
thread 0 is migrating 1 pages starting from 0x7f6abce79000
migrate_thread_func:87: failed to migrate pages at 0x7f6abce79000 
(migrate.npages (tid 0): 9725 != npages: 1)

thread 0 is migrating 1 pages starting from 0x7f6abce79000
thread 0 is migrating 1 pages starting from 0x7f6abce79000
&&& 1 migrate threads: PASSED
(OK)[./sanity_rmem004] anon migration read test

Thanks,

--
Evgeny Baskakov
NVIDIA



[PATCH] firewire: nosy: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   5796 389   061851829 drivers/firewire/nosy.o

File size After adding 'const':
   textdata bss dec hex filename
   5860 325   061851829 drivers/firewire/nosy.o

Signed-off-by: Arvind Yadav 
---
 drivers/firewire/nosy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index 180f0a9..d16a9dc9 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -694,7 +694,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id 
*unused)
return ret;
 }
 
-static struct pci_device_id pci_table[] = {
+static const struct pci_device_id pci_table[] = {
{
.vendor =PCI_VENDOR_ID_TI,
.device =PCI_DEVICE_ID_TI_PCILYNX,
-- 
2.7.4



[PATCH] firewire: nosy: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   5796 389   061851829 drivers/firewire/nosy.o

File size After adding 'const':
   textdata bss dec hex filename
   5860 325   061851829 drivers/firewire/nosy.o

Signed-off-by: Arvind Yadav 
---
 drivers/firewire/nosy.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/firewire/nosy.c b/drivers/firewire/nosy.c
index 180f0a9..d16a9dc9 100644
--- a/drivers/firewire/nosy.c
+++ b/drivers/firewire/nosy.c
@@ -694,7 +694,7 @@ add_card(struct pci_dev *dev, const struct pci_device_id 
*unused)
return ret;
 }
 
-static struct pci_device_id pci_table[] = {
+static const struct pci_device_id pci_table[] = {
{
.vendor =PCI_VENDOR_ID_TI,
.device =PCI_DEVICE_ID_TI_PCILYNX,
-- 
2.7.4



Re: [PATCH 5/5] dt-bindings: Document the Rockchip RGA bindings

2017-07-14 Thread Jacob Chen
Hi rob,

2017-06-29 6:29 GMT+08:00 Rob Herring :
> On Mon, Jun 26, 2017 at 10:53:22PM +0800, Jacob Chen wrote:
>> Add DT bindings documentation for Rockchip RGA
>>
>> Signed-off-by: Yakir Yang 
>> Signed-off-by: Jacob Chen 
>> ---
>>  .../devicetree/bindings/media/rockchip-rga.txt | 36 
>> ++
>
> Should be under bindings/gpu/
>
>>  1 file changed, 36 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/media/rockchip-rga.txt
>>
>> diff --git a/Documentation/devicetree/bindings/media/rockchip-rga.txt 
>> b/Documentation/devicetree/bindings/media/rockchip-rga.txt
>> new file mode 100644
>> index 000..48a260e5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/rockchip-rga.txt
>> @@ -0,0 +1,36 @@
>> +device-tree bindings for rockchip 2D raster graphic acceleration controller 
>> (RGA)
>> +
>> +RGA is a separate 2D raster graphic acceleration unit. It accelerates 2D
>> +graphics operations, such as point/line drawing, image scaling, rotation,
>> +BitBLT, alpha blending and image blur/sharpness.
>> +
>> +Required properties:
>> +- compatible: value should be one of the following
>> + "rockchip,rk3228-rga";
>> + "rockchip,rk3288-rga";
>> + "rockchip,rk3399-rga";
>> +
>> +- interrupts: RGA interrupt number.
>> +
>> +- clocks: phandle to RGA sclk/hclk/aclk clocks
>> +
>> +- clock-names: should be "aclk" "hclk" and "sclk"
>> +
>> +- resets: Must contain an entry for each entry in reset-names.
>> +  See ../reset/reset.txt for details.
>> +- reset-names: should be "core" "axi" and "ahb"
>> +
>> +Example:
>> +SoC specific DT entry:
>> + rga: rga@ff68 {
>
> gpu@...
>

It's used for v4l2 drvier, should i move it bindings/gpu/?

>> + compatible = "rockchip,rk3399-rga";
>> + reg = <0xff68 0x1>;
>> + interrupts = ;
>> + interrupt-names = "rga";
>> + clocks = < ACLK_RGA>, < HCLK_RGA>, < 
>> SCLK_RGA_CORE>;
>> + clock-names = "aclk", "hclk", "sclk";
>> +
>> + resets = < SRST_RGA_CORE>, < SRST_A_RGA>, < 
>> SRST_H_RGA>;
>> + reset-names = "core, "axi", "ahb";
>> + status = "disabled";
>
> Don't show status in examples.
>
>> + };
>> --
>> 2.7.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 5/5] dt-bindings: Document the Rockchip RGA bindings

2017-07-14 Thread Jacob Chen
Hi rob,

2017-06-29 6:29 GMT+08:00 Rob Herring :
> On Mon, Jun 26, 2017 at 10:53:22PM +0800, Jacob Chen wrote:
>> Add DT bindings documentation for Rockchip RGA
>>
>> Signed-off-by: Yakir Yang 
>> Signed-off-by: Jacob Chen 
>> ---
>>  .../devicetree/bindings/media/rockchip-rga.txt | 36 
>> ++
>
> Should be under bindings/gpu/
>
>>  1 file changed, 36 insertions(+)
>>  create mode 100644 Documentation/devicetree/bindings/media/rockchip-rga.txt
>>
>> diff --git a/Documentation/devicetree/bindings/media/rockchip-rga.txt 
>> b/Documentation/devicetree/bindings/media/rockchip-rga.txt
>> new file mode 100644
>> index 000..48a260e5
>> --- /dev/null
>> +++ b/Documentation/devicetree/bindings/media/rockchip-rga.txt
>> @@ -0,0 +1,36 @@
>> +device-tree bindings for rockchip 2D raster graphic acceleration controller 
>> (RGA)
>> +
>> +RGA is a separate 2D raster graphic acceleration unit. It accelerates 2D
>> +graphics operations, such as point/line drawing, image scaling, rotation,
>> +BitBLT, alpha blending and image blur/sharpness.
>> +
>> +Required properties:
>> +- compatible: value should be one of the following
>> + "rockchip,rk3228-rga";
>> + "rockchip,rk3288-rga";
>> + "rockchip,rk3399-rga";
>> +
>> +- interrupts: RGA interrupt number.
>> +
>> +- clocks: phandle to RGA sclk/hclk/aclk clocks
>> +
>> +- clock-names: should be "aclk" "hclk" and "sclk"
>> +
>> +- resets: Must contain an entry for each entry in reset-names.
>> +  See ../reset/reset.txt for details.
>> +- reset-names: should be "core" "axi" and "ahb"
>> +
>> +Example:
>> +SoC specific DT entry:
>> + rga: rga@ff68 {
>
> gpu@...
>

It's used for v4l2 drvier, should i move it bindings/gpu/?

>> + compatible = "rockchip,rk3399-rga";
>> + reg = <0xff68 0x1>;
>> + interrupts = ;
>> + interrupt-names = "rga";
>> + clocks = < ACLK_RGA>, < HCLK_RGA>, < 
>> SCLK_RGA_CORE>;
>> + clock-names = "aclk", "hclk", "sclk";
>> +
>> + resets = < SRST_RGA_CORE>, < SRST_A_RGA>, < 
>> SRST_H_RGA>;
>> + reset-names = "core, "axi", "ahb";
>> + status = "disabled";
>
> Don't show status in examples.
>
>> + };
>> --
>> 2.7.4
>>
>> --
>> To unsubscribe from this list: send the line "unsubscribe devicetree" in
>> the body of a message to majord...@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 02/10] isdn: hisax: hfc4s8s_l1: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  10512 536   4   110522b2c drivers/isdn/hisax/hfc4s8s_l1.o

File size After adding 'const':
   textdata bss dec hex filename
  10672 376   4   110522b2c drivers/isdn/hisax/hfc4s8s_l1.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hisax/hfc4s8s_l1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index 90f051c..9090cc1 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -86,7 +86,7 @@ typedef struct {
char *device_name;
 } hfc4s8s_param;
 
-static struct pci_device_id hfc4s8s_ids[] = {
+static const struct pci_device_id hfc4s8s_ids[] = {
{.vendor = PCI_VENDOR_ID_CCD,
 .device = PCI_DEVICE_ID_4S,
 .subvendor = 0x1397,
-- 
2.7.4



[PATCH 02/10] isdn: hisax: hfc4s8s_l1: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  10512 536   4   110522b2c drivers/isdn/hisax/hfc4s8s_l1.o

File size After adding 'const':
   textdata bss dec hex filename
  10672 376   4   110522b2c drivers/isdn/hisax/hfc4s8s_l1.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hisax/hfc4s8s_l1.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/hfc4s8s_l1.c b/drivers/isdn/hisax/hfc4s8s_l1.c
index 90f051c..9090cc1 100644
--- a/drivers/isdn/hisax/hfc4s8s_l1.c
+++ b/drivers/isdn/hisax/hfc4s8s_l1.c
@@ -86,7 +86,7 @@ typedef struct {
char *device_name;
 } hfc4s8s_param;
 
-static struct pci_device_id hfc4s8s_ids[] = {
+static const struct pci_device_id hfc4s8s_ids[] = {
{.vendor = PCI_VENDOR_ID_CCD,
 .device = PCI_DEVICE_ID_4S,
 .subvendor = 0x1397,
-- 
2.7.4



[PATCH 01/10] isdn: hisax: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  1368620644416   201664ec6 drivers/isdn/hisax/config.o

File size After adding 'const':
   textdata bss dec hex filename
  15030 7204416   201664ec6 drivers/isdn/hisax/config.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hisax/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index c7d6867..7108bdb8 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1909,7 +1909,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
 #ifdef CONFIG_PCI
 #include 
 
-static struct pci_device_id hisax_pci_tbl[] __used = {
+static const struct pci_device_id hisax_pci_tbl[] __used = {
 #ifdef CONFIG_HISAX_FRITZPCI
{PCI_VDEVICE(AVM,  PCI_DEVICE_ID_AVM_A1)},
 #endif
-- 
2.7.4



[PATCH 01/10] isdn: hisax: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  1368620644416   201664ec6 drivers/isdn/hisax/config.o

File size After adding 'const':
   textdata bss dec hex filename
  15030 7204416   201664ec6 drivers/isdn/hisax/config.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hisax/config.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/config.c b/drivers/isdn/hisax/config.c
index c7d6867..7108bdb8 100644
--- a/drivers/isdn/hisax/config.c
+++ b/drivers/isdn/hisax/config.c
@@ -1909,7 +1909,7 @@ static void EChannel_proc_rcv(struct hisax_d_if *d_if)
 #ifdef CONFIG_PCI
 #include 
 
-static struct pci_device_id hisax_pci_tbl[] __used = {
+static const struct pci_device_id hisax_pci_tbl[] __used = {
 #ifdef CONFIG_HISAX_FRITZPCI
{PCI_VDEVICE(AVM,  PCI_DEVICE_ID_AVM_A1)},
 #endif
-- 
2.7.4



[PATCH 06/10] isdn: mISDN: hfcmulti: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  6345015361492   66478   103ae isdn/hardware/mISDN/hfcmulti.o

File size After adding 'const':
   textdata bss dec hex filename
  64698 2881492   66478   103ae isdn/hardware/mISDN/hfcmulti.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/hfcmulti.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c 
b/drivers/isdn/hardware/mISDN/hfcmulti.c
index aea0c96..3cf07b8 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -5348,7 +5348,7 @@ static const struct hm_map hfcm_map[] = {
 
 #undef H
 #define H(x)   ((unsigned long)_map[x])
-static struct pci_device_id hfmultipci_ids[] = {
+static const struct pci_device_id hfmultipci_ids[] = {
 
/* Cards with HFC-4S Chip */
{ PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_VENDOR_ID_CCD,
-- 
2.7.4



[PATCH 06/10] isdn: mISDN: hfcmulti: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  6345015361492   66478   103ae isdn/hardware/mISDN/hfcmulti.o

File size After adding 'const':
   textdata bss dec hex filename
  64698 2881492   66478   103ae isdn/hardware/mISDN/hfcmulti.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/hfcmulti.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcmulti.c 
b/drivers/isdn/hardware/mISDN/hfcmulti.c
index aea0c96..3cf07b8 100644
--- a/drivers/isdn/hardware/mISDN/hfcmulti.c
+++ b/drivers/isdn/hardware/mISDN/hfcmulti.c
@@ -5348,7 +5348,7 @@ static const struct hm_map hfcm_map[] = {
 
 #undef H
 #define H(x)   ((unsigned long)_map[x])
-static struct pci_device_id hfmultipci_ids[] = {
+static const struct pci_device_id hfmultipci_ids[] = {
 
/* Cards with HFC-4S Chip */
{ PCI_VENDOR_ID_CCD, PCI_DEVICE_ID_CCD_HFC4S, PCI_VENDOR_ID_CCD,
-- 
2.7.4



[PATCH 04/10] isdn: eicon: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   6224 655   868871ae7 isdn/hardware/eicon/divasmain.o

File size After adding 'const':
   textdata bss dec hex filename
   6608 271   868871ae7 isdn/hardware/eicon/divasmain.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/eicon/divasmain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/eicon/divasmain.c 
b/drivers/isdn/hardware/eicon/divasmain.c
index 8b7ad4f..b2023e0 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -110,7 +110,7 @@ typedef struct _diva_os_thread_dpc {
 /*
   This table should be sorted by PCI device ID
 */
-static struct pci_device_id divas_pci_tbl[] = {
+static const struct pci_device_id divas_pci_tbl[] = {
/* Diva Server BRI-2M PCI 0xE010 */
{ PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_MAESTRA),
  CARDTYPE_MAESTRA_PCI },
-- 
2.7.4



[PATCH 04/10] isdn: eicon: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   6224 655   868871ae7 isdn/hardware/eicon/divasmain.o

File size After adding 'const':
   textdata bss dec hex filename
   6608 271   868871ae7 isdn/hardware/eicon/divasmain.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/eicon/divasmain.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/eicon/divasmain.c 
b/drivers/isdn/hardware/eicon/divasmain.c
index 8b7ad4f..b2023e0 100644
--- a/drivers/isdn/hardware/eicon/divasmain.c
+++ b/drivers/isdn/hardware/eicon/divasmain.c
@@ -110,7 +110,7 @@ typedef struct _diva_os_thread_dpc {
 /*
   This table should be sorted by PCI device ID
 */
-static struct pci_device_id divas_pci_tbl[] = {
+static const struct pci_device_id divas_pci_tbl[] = {
/* Diva Server BRI-2M PCI 0xE010 */
{ PCI_VDEVICE(EICON, PCI_DEVICE_ID_EICON_MAESTRA),
  CARDTYPE_MAESTRA_PCI },
-- 
2.7.4



[PATCH 08/10] isdn: mISDN: avmfritz: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   99631936  16   119152e8b isdn/hardware/mISDN/avmfritz.o

File size After adding 'const':
   textdata bss dec hex filename
  100911808  16   119152e8b isdn/hardware/mISDN/avmfritz.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/avmfritz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c 
b/drivers/isdn/hardware/mISDN/avmfritz.c
index e3fa1cd..dce6632 100644
--- a/drivers/isdn/hardware/mISDN/avmfritz.c
+++ b/drivers/isdn/hardware/mISDN/avmfritz.c
@@ -1142,7 +1142,7 @@ fritz_remove_pci(struct pci_dev *pdev)
pr_info("%s: drvdata already removed\n", __func__);
 }
 
-static struct pci_device_id fcpci_ids[] = {
+static const struct pci_device_id fcpci_ids[] = {
{ PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID,
  0, 0, (unsigned long) "Fritz!Card PCI"},
{ PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
-- 
2.7.4



[PATCH 08/10] isdn: mISDN: avmfritz: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   99631936  16   119152e8b isdn/hardware/mISDN/avmfritz.o

File size After adding 'const':
   textdata bss dec hex filename
  100911808  16   119152e8b isdn/hardware/mISDN/avmfritz.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/avmfritz.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/avmfritz.c 
b/drivers/isdn/hardware/mISDN/avmfritz.c
index e3fa1cd..dce6632 100644
--- a/drivers/isdn/hardware/mISDN/avmfritz.c
+++ b/drivers/isdn/hardware/mISDN/avmfritz.c
@@ -1142,7 +1142,7 @@ fritz_remove_pci(struct pci_dev *pdev)
pr_info("%s: drvdata already removed\n", __func__);
 }
 
-static struct pci_device_id fcpci_ids[] = {
+static const struct pci_device_id fcpci_ids[] = {
{ PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1, PCI_ANY_ID, PCI_ANY_ID,
  0, 0, (unsigned long) "Fritz!Card PCI"},
{ PCI_VENDOR_ID_AVM, PCI_DEVICE_ID_AVM_A1_V2, PCI_ANY_ID, PCI_ANY_ID,
-- 
2.7.4



[PATCH 09/10] isdn: mISDN: hfcpci: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  216561024  96   2277658f8 isdn/hardware/mISDN/hfcpci.o

File size After adding 'const':
   textdata bss dec hex filename
  22424 256  96   2277658f8 isdn/hardware/mISDN/hfcpci.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/hfcpci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c 
b/drivers/isdn/hardware/mISDN/hfcpci.c
index 5dc246d..d2e401a 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -2161,7 +2161,7 @@ static const struct _hfc_map hfc_map[] =
{},
 };
 
-static struct pci_device_id hfc_ids[] =
+static const struct pci_device_id hfc_ids[] =
 {
{ PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_2BD0),
  (unsigned long) _map[0] },
-- 
2.7.4



[PATCH 10/10] isdn: avm: c4: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  11803 544   1   12348303c isdn/hardware/avm/c4.o

File size After adding 'const':
   textdata bss dec hex filename
  11931 416   1   12348303c isdn/hardware/avm/c4.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/avm/c4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
index 40c7e2c..034caba 100644
--- a/drivers/isdn/hardware/avm/c4.c
+++ b/drivers/isdn/hardware/avm/c4.c
@@ -42,7 +42,7 @@ static char *revision = "$Revision: 1.1.2.2 $";
 
 static bool suppress_pollack;
 
-static struct pci_device_id c4_pci_tbl[] = {
+static const struct pci_device_id c4_pci_tbl[] = {
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, 
PCI_DEVICE_ID_AVM_C4, 0, 0, (unsigned long)4 },
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, 
PCI_DEVICE_ID_AVM_C2, 0, 0, (unsigned long)2 },
{ } /* Terminating entry */
-- 
2.7.4



[PATCH 03/10] isdn: hisax: hisax_fcpcipnp: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   5989 576   0656519a5 isdn/hisax/hisax_fcpcipnp.o

File size After adding 'const':
   textdata bss dec hex filename
   6085 480   0656519a5 isdn/hisax/hisax_fcpcipnp.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hisax/hisax_fcpcipnp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c 
b/drivers/isdn/hisax/hisax_fcpcipnp.c
index 5a9f39e..e4f7573 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -52,7 +52,7 @@ module_param(debug, int, 0);
 MODULE_AUTHOR("Kai Germaschewski /Karsten Keil 
");
 MODULE_DESCRIPTION("AVM Fritz!PCI/PnP ISDN driver");
 
-static struct pci_device_id fcpci_ids[] = {
+static const struct pci_device_id fcpci_ids[] = {
{ .vendor  = PCI_VENDOR_ID_AVM,
  .device  = PCI_DEVICE_ID_AVM_A1,
  .subvendor   = PCI_ANY_ID,
-- 
2.7.4



[PATCH 09/10] isdn: mISDN: hfcpci: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  216561024  96   2277658f8 isdn/hardware/mISDN/hfcpci.o

File size After adding 'const':
   textdata bss dec hex filename
  22424 256  96   2277658f8 isdn/hardware/mISDN/hfcpci.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/hfcpci.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c 
b/drivers/isdn/hardware/mISDN/hfcpci.c
index 5dc246d..d2e401a 100644
--- a/drivers/isdn/hardware/mISDN/hfcpci.c
+++ b/drivers/isdn/hardware/mISDN/hfcpci.c
@@ -2161,7 +2161,7 @@ static const struct _hfc_map hfc_map[] =
{},
 };
 
-static struct pci_device_id hfc_ids[] =
+static const struct pci_device_id hfc_ids[] =
 {
{ PCI_VDEVICE(CCD, PCI_DEVICE_ID_CCD_2BD0),
  (unsigned long) _map[0] },
-- 
2.7.4



[PATCH 10/10] isdn: avm: c4: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  11803 544   1   12348303c isdn/hardware/avm/c4.o

File size After adding 'const':
   textdata bss dec hex filename
  11931 416   1   12348303c isdn/hardware/avm/c4.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/avm/c4.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/avm/c4.c b/drivers/isdn/hardware/avm/c4.c
index 40c7e2c..034caba 100644
--- a/drivers/isdn/hardware/avm/c4.c
+++ b/drivers/isdn/hardware/avm/c4.c
@@ -42,7 +42,7 @@ static char *revision = "$Revision: 1.1.2.2 $";
 
 static bool suppress_pollack;
 
-static struct pci_device_id c4_pci_tbl[] = {
+static const struct pci_device_id c4_pci_tbl[] = {
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, 
PCI_DEVICE_ID_AVM_C4, 0, 0, (unsigned long)4 },
{ PCI_VENDOR_ID_DEC, PCI_DEVICE_ID_DEC_21285, PCI_VENDOR_ID_AVM, 
PCI_DEVICE_ID_AVM_C2, 0, 0, (unsigned long)2 },
{ } /* Terminating entry */
-- 
2.7.4



[PATCH 03/10] isdn: hisax: hisax_fcpcipnp: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
   5989 576   0656519a5 isdn/hisax/hisax_fcpcipnp.o

File size After adding 'const':
   textdata bss dec hex filename
   6085 480   0656519a5 isdn/hisax/hisax_fcpcipnp.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hisax/hisax_fcpcipnp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hisax/hisax_fcpcipnp.c 
b/drivers/isdn/hisax/hisax_fcpcipnp.c
index 5a9f39e..e4f7573 100644
--- a/drivers/isdn/hisax/hisax_fcpcipnp.c
+++ b/drivers/isdn/hisax/hisax_fcpcipnp.c
@@ -52,7 +52,7 @@ module_param(debug, int, 0);
 MODULE_AUTHOR("Kai Germaschewski /Karsten Keil 
");
 MODULE_DESCRIPTION("AVM Fritz!PCI/PnP ISDN driver");
 
-static struct pci_device_id fcpci_ids[] = {
+static const struct pci_device_id fcpci_ids[] = {
{ .vendor  = PCI_VENDOR_ID_AVM,
  .device  = PCI_DEVICE_ID_AVM_A1,
  .subvendor   = PCI_ANY_ID,
-- 
2.7.4



[PATCH 07/10] isdn: mISDN: w6692: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  139594080  24   18063468f isdn/hardware/mISDN/w6692.o

File size After adding 'const':
   textdata bss dec hex filename
  140873952  24   18063468f isdn/hardware/mISDN/w6692.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/w6692.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/w6692.c 
b/drivers/isdn/hardware/mISDN/w6692.c
index 3052c83..d80072f 100644
--- a/drivers/isdn/hardware/mISDN/w6692.c
+++ b/drivers/isdn/hardware/mISDN/w6692.c
@@ -1398,7 +1398,7 @@ w6692_remove_pci(struct pci_dev *pdev)
pr_notice("%s: drvdata already removed\n", __func__);
 }
 
-static struct pci_device_id w6692_ids[] = {
+static const struct pci_device_id w6692_ids[] = {
{ PCI_VENDOR_ID_DYNALINK, PCI_DEVICE_ID_DYNALINK_IS64PH,
  PCI_ANY_ID, PCI_ANY_ID, 0, 0, (ulong)_map[0]},
{ PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692,
-- 
2.7.4



[PATCH 05/10] isdn: mISDN: netjet: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  109411776  16   1273331bd isdn/hardware/mISDN/netjet.o

File size After adding 'const':
   textdata bss dec hex filename
  110051712  16   1273331bd isdn/hardware/mISDN/netjet.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/netjet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/netjet.c 
b/drivers/isdn/hardware/mISDN/netjet.c
index afde4ed..6a6d848 100644
--- a/drivers/isdn/hardware/mISDN/netjet.c
+++ b/drivers/isdn/hardware/mISDN/netjet.c
@@ -1137,7 +1137,7 @@ static void nj_remove(struct pci_dev *pdev)
 /* We cannot select cards with PCI_SUB... IDs, since here are cards with
  * SUB IDs set to PCI_ANY_ID, so we need to match all and reject
  * known other cards which not work with this driver - see probe function */
-static struct pci_device_id nj_pci_ids[] = {
+static const struct pci_device_id nj_pci_ids[] = {
{ PCI_VENDOR_ID_TIGERJET, PCI_DEVICE_ID_TIGERJET_300,
  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ }
-- 
2.7.4



[PATCH 07/10] isdn: mISDN: w6692: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  139594080  24   18063468f isdn/hardware/mISDN/w6692.o

File size After adding 'const':
   textdata bss dec hex filename
  140873952  24   18063468f isdn/hardware/mISDN/w6692.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/w6692.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/w6692.c 
b/drivers/isdn/hardware/mISDN/w6692.c
index 3052c83..d80072f 100644
--- a/drivers/isdn/hardware/mISDN/w6692.c
+++ b/drivers/isdn/hardware/mISDN/w6692.c
@@ -1398,7 +1398,7 @@ w6692_remove_pci(struct pci_dev *pdev)
pr_notice("%s: drvdata already removed\n", __func__);
 }
 
-static struct pci_device_id w6692_ids[] = {
+static const struct pci_device_id w6692_ids[] = {
{ PCI_VENDOR_ID_DYNALINK, PCI_DEVICE_ID_DYNALINK_IS64PH,
  PCI_ANY_ID, PCI_ANY_ID, 0, 0, (ulong)_map[0]},
{ PCI_VENDOR_ID_WINBOND2, PCI_DEVICE_ID_WINBOND2_6692,
-- 
2.7.4



[PATCH 05/10] isdn: mISDN: netjet: constify pci_device_id.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

File size before:
   textdata bss dec hex filename
  109411776  16   1273331bd isdn/hardware/mISDN/netjet.o

File size After adding 'const':
   textdata bss dec hex filename
  110051712  16   1273331bd isdn/hardware/mISDN/netjet.o

Signed-off-by: Arvind Yadav 
---
 drivers/isdn/hardware/mISDN/netjet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/isdn/hardware/mISDN/netjet.c 
b/drivers/isdn/hardware/mISDN/netjet.c
index afde4ed..6a6d848 100644
--- a/drivers/isdn/hardware/mISDN/netjet.c
+++ b/drivers/isdn/hardware/mISDN/netjet.c
@@ -1137,7 +1137,7 @@ static void nj_remove(struct pci_dev *pdev)
 /* We cannot select cards with PCI_SUB... IDs, since here are cards with
  * SUB IDs set to PCI_ANY_ID, so we need to match all and reject
  * known other cards which not work with this driver - see probe function */
-static struct pci_device_id nj_pci_ids[] = {
+static const struct pci_device_id nj_pci_ids[] = {
{ PCI_VENDOR_ID_TIGERJET, PCI_DEVICE_ID_TIGERJET_300,
  PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0},
{ }
-- 
2.7.4



[PATCH 00/10] Constify isdn pci_device_id's.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

Arvind Yadav (10):
  [PATCH 01/10] isdn: hisax: constify pci_device_id.
  [PATCH 02/10] isdn: hisax: hfc4s8s_l1: constify pci_device_id.
  [PATCH 03/10] isdn: hisax: hisax_fcpcipnp: constify pci_device_id.
  [PATCH 04/10] isdn: eicon: constify pci_device_id.
  [PATCH 05/10] isdn: mISDN: netjet: constify pci_device_id.
  [PATCH 06/10] isdn: mISDN: hfcmulti: constify pci_device_id.
  [PATCH 07/10] isdn: mISDN: w6692: constify pci_device_id.
  [PATCH 08/10] isdn: mISDN: avmfritz: constify pci_device_id.
  [PATCH 09/10] isdn: mISDN: hfcpci: constify pci_device_id.
  [PATCH 10/10] isdn: avm: c4: constify pci_device_id.

 drivers/isdn/hardware/avm/c4.c  | 2 +-
 drivers/isdn/hardware/eicon/divasmain.c | 2 +-
 drivers/isdn/hardware/mISDN/avmfritz.c  | 2 +-
 drivers/isdn/hardware/mISDN/hfcmulti.c  | 2 +-
 drivers/isdn/hardware/mISDN/hfcpci.c| 2 +-
 drivers/isdn/hardware/mISDN/netjet.c| 2 +-
 drivers/isdn/hardware/mISDN/w6692.c | 2 +-
 drivers/isdn/hisax/config.c | 2 +-
 drivers/isdn/hisax/hfc4s8s_l1.c | 2 +-
 drivers/isdn/hisax/hisax_fcpcipnp.c | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.7.4



[PATCH 00/10] Constify isdn pci_device_id's.

2017-07-14 Thread Arvind Yadav
pci_device_id are not supposed to change at runtime. All functions
working with pci_device_id provided by  work with
const pci_device_id. So mark the non-const structs as const.

Arvind Yadav (10):
  [PATCH 01/10] isdn: hisax: constify pci_device_id.
  [PATCH 02/10] isdn: hisax: hfc4s8s_l1: constify pci_device_id.
  [PATCH 03/10] isdn: hisax: hisax_fcpcipnp: constify pci_device_id.
  [PATCH 04/10] isdn: eicon: constify pci_device_id.
  [PATCH 05/10] isdn: mISDN: netjet: constify pci_device_id.
  [PATCH 06/10] isdn: mISDN: hfcmulti: constify pci_device_id.
  [PATCH 07/10] isdn: mISDN: w6692: constify pci_device_id.
  [PATCH 08/10] isdn: mISDN: avmfritz: constify pci_device_id.
  [PATCH 09/10] isdn: mISDN: hfcpci: constify pci_device_id.
  [PATCH 10/10] isdn: avm: c4: constify pci_device_id.

 drivers/isdn/hardware/avm/c4.c  | 2 +-
 drivers/isdn/hardware/eicon/divasmain.c | 2 +-
 drivers/isdn/hardware/mISDN/avmfritz.c  | 2 +-
 drivers/isdn/hardware/mISDN/hfcmulti.c  | 2 +-
 drivers/isdn/hardware/mISDN/hfcpci.c| 2 +-
 drivers/isdn/hardware/mISDN/netjet.c| 2 +-
 drivers/isdn/hardware/mISDN/w6692.c | 2 +-
 drivers/isdn/hisax/config.c | 2 +-
 drivers/isdn/hisax/hfc4s8s_l1.c | 2 +-
 drivers/isdn/hisax/hisax_fcpcipnp.c | 2 +-
 10 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.7.4



Re: [PATCH 05/14] isdn: isdnloop: suppress a gcc-7 warning

2017-07-14 Thread Kevin Easton
On Fri, Jul 14, 2017 at 12:37:05PM +0200, Arnd Bergmann wrote:
> On Fri, Jul 14, 2017 at 12:08 PM, Joe Perches  wrote:
> > On Fri, 2017-07-14 at 11:25 +0200, Arnd Bergmann wrote:
> >> We test whether a bit is set in a mask here, which is correct
> >> but gcc warns about it as it thinks it might be confusing:
> >>
> >> drivers/isdn/isdnloop/isdnloop.c:412:37: error: ?: using integer constants 
> >> in boolean context, the expression will always evaluate to 'true' 
> >> [-Werror=int-in-bool-context]

...

> > Perhaps this is a logic defect and should be:
> >
> > if (!(card->flags & ((channel) ? ISDNLOOP_FLAGS_B2ACTIVE : 
> > ISDNLOOP_FLAGS_B1ACTIVE)))
> 
> Yes, good catch. I had thought about it for a bit whether that would be
> the answer, but come to the wrong conclusion on my own.
> 
> Note that the version you suggested will still have the warning, so I think
> it needs to be

It shouldn't - the warning is for using an integer *constant* in boolean
context, but the result of & isn't a constant and should be fine.

!(flags & mask) is a very common idiom.

- Kevin 


Re: [PATCH 05/14] isdn: isdnloop: suppress a gcc-7 warning

2017-07-14 Thread Kevin Easton
On Fri, Jul 14, 2017 at 12:37:05PM +0200, Arnd Bergmann wrote:
> On Fri, Jul 14, 2017 at 12:08 PM, Joe Perches  wrote:
> > On Fri, 2017-07-14 at 11:25 +0200, Arnd Bergmann wrote:
> >> We test whether a bit is set in a mask here, which is correct
> >> but gcc warns about it as it thinks it might be confusing:
> >>
> >> drivers/isdn/isdnloop/isdnloop.c:412:37: error: ?: using integer constants 
> >> in boolean context, the expression will always evaluate to 'true' 
> >> [-Werror=int-in-bool-context]

...

> > Perhaps this is a logic defect and should be:
> >
> > if (!(card->flags & ((channel) ? ISDNLOOP_FLAGS_B2ACTIVE : 
> > ISDNLOOP_FLAGS_B1ACTIVE)))
> 
> Yes, good catch. I had thought about it for a bit whether that would be
> the answer, but come to the wrong conclusion on my own.
> 
> Note that the version you suggested will still have the warning, so I think
> it needs to be

It shouldn't - the warning is for using an integer *constant* in boolean
context, but the result of & isn't a constant and should be fine.

!(flags & mask) is a very common idiom.

- Kevin 


Re: [PATCH 3/3] fat: fix quoted string splits

2017-07-14 Thread Joe Perches
On Sat, 2017-07-15 at 04:20 +0300, Andy Shevchenko wrote:
> On Sat, Jul 15, 2017 at 2:05 AM, Carlos Palminha
>  wrote:
> > corrects quoted string split across lines, based on checkpatch.
> 
> At some point you may switch
> 
> fat_msg(sb, KERN_ERR, ...)
> 
> to
> 
> fat_fs_error(sb, ...)

The output would be different.



Re: [PATCH 3/3] fat: fix quoted string splits

2017-07-14 Thread Joe Perches
On Sat, 2017-07-15 at 04:20 +0300, Andy Shevchenko wrote:
> On Sat, Jul 15, 2017 at 2:05 AM, Carlos Palminha
>  wrote:
> > corrects quoted string split across lines, based on checkpatch.
> 
> At some point you may switch
> 
> fat_msg(sb, KERN_ERR, ...)
> 
> to
> 
> fat_fs_error(sb, ...)

The output would be different.



Re: [ANNOUNCE] Git v2.14.0-rc0

2017-07-14 Thread Christian Couder
On Sat, Jul 15, 2017 at 1:17 AM, Ævar Arnfjörð Bjarmason
 wrote:
>
> On Thu, Jul 13 2017, Junio C. Hamano jotted:

>>  * "git send-email" learned to overcome some SMTP server limitation
>>that does not allow many pieces of e-mails to be sent over a single
>>session.
>
> Makes it sound like it does that automatically, also "pieces of e-mails"
> and "sent over" is odd, maybe:
>
> * "git send-email" now has --batch-size and --relogin-delay options
>which can be used to overcome limitations on SMTP servers that have
>limits on how many of e-mails can be sent in a single session.

Maybe s/that have limits on how/that restrict how/


Re: [ANNOUNCE] Git v2.14.0-rc0

2017-07-14 Thread Christian Couder
On Sat, Jul 15, 2017 at 1:17 AM, Ævar Arnfjörð Bjarmason
 wrote:
>
> On Thu, Jul 13 2017, Junio C. Hamano jotted:

>>  * "git send-email" learned to overcome some SMTP server limitation
>>that does not allow many pieces of e-mails to be sent over a single
>>session.
>
> Makes it sound like it does that automatically, also "pieces of e-mails"
> and "sent over" is odd, maybe:
>
> * "git send-email" now has --batch-size and --relogin-delay options
>which can be used to overcome limitations on SMTP servers that have
>limits on how many of e-mails can be sent in a single session.

Maybe s/that have limits on how/that restrict how/


Re: [PATCH 5/5] sched: Accumulate vtime on top of nsec clocksource

2017-07-14 Thread Levin, Alexander (Sasha Levin)
On Thu, Jun 29, 2017 at 07:15:11PM +0200, Frederic Weisbecker wrote:
>From: Wanpeng Li <kernel...@gmail.com>
>
>Currently the cputime source used by vtime is jiffies. When we cross
>a context boundary and jiffies have changed since the last snapshot, the
>pending cputime is accounted to the switching out context.
>
>This system works ok if the ticks are not aligned across CPUs. If they
>instead are aligned (ie: all fire at the same time) and the CPUs run in
>userspace, the jiffies change is only observed on tick exit and therefore
>the user cputime is accounted as system cputime. This is because the
>CPU that maintains timekeeping fires its tick at the same time as the
>others. It updates jiffies in the middle of the tick and the other CPUs
>see that update on IRQ exit:
>
>CPU 0 (timekeeper)  CPU 1
>---  -
>  jiffies = N
>...  run in userspace for a jiffy
>tick entry   tick entry (sees jiffies = N)
>set jiffies = N + 1
>tick exittick exit (sees jiffies = N + 1)
>account 1 jiffy as stime
>
>Fix this with using a nanosec clock source instead of jiffies. The
>cputime is then accumulated and flushed everytime the pending delta
>reaches a jiffy in order to mitigate the accounting overhead.
>
>[fweisbec: changelog, rebase on struct vtime, field renames, add delta
>on cputime readers, keep idle vtime as-is (low overhead accounting),
>harmonize clock sources]
>
>Reported-by: Luiz Capitulino <lcapitul...@redhat.com>
>Suggested-by: Thomas Gleixner <t...@linutronix.de>
>Not-Yet-Signed-off-by: Wanpeng Li <kernel...@gmail.com>
>Cc: Rik van Riel <r...@redhat.com>
>Cc: Peter Zijlstra <pet...@infradead.org>
>Cc: Thomas Gleixner <t...@linutronix.de>
>Cc: Wanpeng Li <kernel...@gmail.com>
>Cc: Ingo Molnar <mi...@kernel.org>
>Cc: Luiz Capitulino <lcapitul...@redhat.com>
>Signed-off-by: Frederic Weisbecker <fweis...@gmail.com>

Hi all,

This patch seems to be causing this:

BUG: using smp_processor_id() in preemptible [] code: kworker/u9:0/6
caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
CPU: 1 PID: 6 Comm: kworker/u9:0 Not tainted 4.12.0-next-20170714 #187
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
04/01/2014
Workqueue: events_unbound call_usermodehelper_exec_work
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x11d/0x1ef lib/dump_stack.c:52
 check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
 debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
 vtime_delta.isra.6+0x11/0x60 kernel/sched/cputime.c:686
 task_cputime+0x3ca/0x790 kernel/sched/cputime.c:882
 thread_group_cputime+0x51a/0xaa0 kernel/sched/cputime.c:327
 thread_group_cputime_adjusted+0x73/0xf0 kernel/sched/cputime.c:676
 wait_task_zombie kernel/exit.c:1114 [inline]
 wait_consider_task+0x1c82/0x37f0 kernel/exit.c:1389
 do_wait_thread kernel/exit.c:1452 [inline]
 do_wait+0x457/0xb00 kernel/exit.c:1523
 kernel_wait4+0x1fd/0x380 kernel/exit.c:1665
 SYSC_wait4+0x145/0x160 kernel/exit.c:1677
 SyS_wait4+0x2c/0x40 kernel/exit.c:1673
 call_usermodehelper_exec_sync kernel/kmod.c:286 [inline]
 call_usermodehelper_exec_work+0x1fc/0x2c0 kernel/kmod.c:323
 process_one_work+0xae7/0x1a00 kernel/workqueue.c:2097
 worker_thread+0x221/0x1860 kernel/workqueue.c:2231
 kthread+0x35f/0x430 kernel/kthread.c:231
 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:425
capability: warning: `syz-executor5' uses 32-bit capabilities (legacy support 
in use)
BUG: using smp_processor_id() in preemptible [] code: syz-executor6/7013
caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
CPU: 3 PID: 7013 Comm: syz-executor6 Not tainted 4.12.0-next-20170714 #187
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
04/01/2014
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x11d/0x1ef lib/dump_stack.c:52
 check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
 debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
 vtime_delta.isra.6+0x11/0x60 kernel/sched/cputime.c:686
 task_cputime+0x3ca/0x790 kernel/sched/cputime.c:882
 thread_group_cputime+0x51a/0xaa0 kernel/sched/cputime.c:327
 thread_group_cputime_adjusted+0x73/0xf0 kernel/sched/cputime.c:676
 wait_task_zombie kernel/exit.c:1114 [inline]
 wait_consider_task+0x1c82/0x37f0 kernel/exit.c:1389
 do_wait_thread kernel/exit.c:1452 [inline]
 do_wait+0x457/0xb00 kernel/exit.c:1523
 kernel_wait4+0x1fd/0x380 kernel/exit.c:1665
 SYSC_wait4+0x145/0x160 kernel/exit.c:1677
 SyS_wait4+0x2c/0x40 kernel/exit.c:1673
 do_syscall_64+0x267/0x740 arch/x86/entry/common.c:284
 entry_

Re: [PATCH 5/5] sched: Accumulate vtime on top of nsec clocksource

2017-07-14 Thread Levin, Alexander (Sasha Levin)
On Thu, Jun 29, 2017 at 07:15:11PM +0200, Frederic Weisbecker wrote:
>From: Wanpeng Li 
>
>Currently the cputime source used by vtime is jiffies. When we cross
>a context boundary and jiffies have changed since the last snapshot, the
>pending cputime is accounted to the switching out context.
>
>This system works ok if the ticks are not aligned across CPUs. If they
>instead are aligned (ie: all fire at the same time) and the CPUs run in
>userspace, the jiffies change is only observed on tick exit and therefore
>the user cputime is accounted as system cputime. This is because the
>CPU that maintains timekeeping fires its tick at the same time as the
>others. It updates jiffies in the middle of the tick and the other CPUs
>see that update on IRQ exit:
>
>CPU 0 (timekeeper)  CPU 1
>---  -
>  jiffies = N
>...  run in userspace for a jiffy
>tick entry   tick entry (sees jiffies = N)
>set jiffies = N + 1
>tick exittick exit (sees jiffies = N + 1)
>account 1 jiffy as stime
>
>Fix this with using a nanosec clock source instead of jiffies. The
>cputime is then accumulated and flushed everytime the pending delta
>reaches a jiffy in order to mitigate the accounting overhead.
>
>[fweisbec: changelog, rebase on struct vtime, field renames, add delta
>on cputime readers, keep idle vtime as-is (low overhead accounting),
>harmonize clock sources]
>
>Reported-by: Luiz Capitulino 
>Suggested-by: Thomas Gleixner 
>Not-Yet-Signed-off-by: Wanpeng Li 
>Cc: Rik van Riel 
>Cc: Peter Zijlstra 
>Cc: Thomas Gleixner 
>Cc: Wanpeng Li 
>Cc: Ingo Molnar 
>Cc: Luiz Capitulino 
>Signed-off-by: Frederic Weisbecker 

Hi all,

This patch seems to be causing this:

BUG: using smp_processor_id() in preemptible [] code: kworker/u9:0/6
caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
CPU: 1 PID: 6 Comm: kworker/u9:0 Not tainted 4.12.0-next-20170714 #187
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
04/01/2014
Workqueue: events_unbound call_usermodehelper_exec_work
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x11d/0x1ef lib/dump_stack.c:52
 check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
 debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
 vtime_delta.isra.6+0x11/0x60 kernel/sched/cputime.c:686
 task_cputime+0x3ca/0x790 kernel/sched/cputime.c:882
 thread_group_cputime+0x51a/0xaa0 kernel/sched/cputime.c:327
 thread_group_cputime_adjusted+0x73/0xf0 kernel/sched/cputime.c:676
 wait_task_zombie kernel/exit.c:1114 [inline]
 wait_consider_task+0x1c82/0x37f0 kernel/exit.c:1389
 do_wait_thread kernel/exit.c:1452 [inline]
 do_wait+0x457/0xb00 kernel/exit.c:1523
 kernel_wait4+0x1fd/0x380 kernel/exit.c:1665
 SYSC_wait4+0x145/0x160 kernel/exit.c:1677
 SyS_wait4+0x2c/0x40 kernel/exit.c:1673
 call_usermodehelper_exec_sync kernel/kmod.c:286 [inline]
 call_usermodehelper_exec_work+0x1fc/0x2c0 kernel/kmod.c:323
 process_one_work+0xae7/0x1a00 kernel/workqueue.c:2097
 worker_thread+0x221/0x1860 kernel/workqueue.c:2231
 kthread+0x35f/0x430 kernel/kthread.c:231
 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:425
capability: warning: `syz-executor5' uses 32-bit capabilities (legacy support 
in use)
BUG: using smp_processor_id() in preemptible [] code: syz-executor6/7013
caller is debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
CPU: 3 PID: 7013 Comm: syz-executor6 Not tainted 4.12.0-next-20170714 #187
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.1-1ubuntu1 
04/01/2014
Call Trace:
 __dump_stack lib/dump_stack.c:16 [inline]
 dump_stack+0x11d/0x1ef lib/dump_stack.c:52
 check_preemption_disabled+0x1f4/0x200 lib/smp_processor_id.c:46
 debug_smp_processor_id+0x1c/0x20 lib/smp_processor_id.c:56
 vtime_delta.isra.6+0x11/0x60 kernel/sched/cputime.c:686
 task_cputime+0x3ca/0x790 kernel/sched/cputime.c:882
 thread_group_cputime+0x51a/0xaa0 kernel/sched/cputime.c:327
 thread_group_cputime_adjusted+0x73/0xf0 kernel/sched/cputime.c:676
 wait_task_zombie kernel/exit.c:1114 [inline]
 wait_consider_task+0x1c82/0x37f0 kernel/exit.c:1389
 do_wait_thread kernel/exit.c:1452 [inline]
 do_wait+0x457/0xb00 kernel/exit.c:1523
 kernel_wait4+0x1fd/0x380 kernel/exit.c:1665
 SYSC_wait4+0x145/0x160 kernel/exit.c:1677
 SyS_wait4+0x2c/0x40 kernel/exit.c:1673
 do_syscall_64+0x267/0x740 arch/x86/entry/common.c:284
 entry_SYSCALL64_slow_path+0x25/0x25
RIP: 0033:0x40bd8a
RSP: 002b:7ffdbdf67b08 EFLAGS: 0246 ORIG_RAX: 003d
RAX: ffda RBX: 00b22914 RCX: 0040bd8a
RDX: 4001 RSI: 7ffdbdf67b4c RDI: 
RBP: 2243 R08: 000

Re:

2017-07-14 Thread Saif Al-Islam
I need your assistance in a transaction that will benefit you details
will be disclosed to you once i receive your reply.

Regards,
Saif.


Re:

2017-07-14 Thread Saif Al-Islam
I need your assistance in a transaction that will benefit you details
will be disclosed to you once i receive your reply.

Regards,
Saif.


[PATCH] drm/vgem: add compat_ioctl support

2017-07-14 Thread Brian Norris
DRM drivers should supply a compat version if they're going to provide
an ioctl implementation at all. This can confuse 32-bit user space on a
64-bit system.

Signed-off-by: Brian Norris 
---
 drivers/gpu/drm/vgem/vgem_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 9fee38a942c4..3835656e2baf 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -220,6 +220,7 @@ static const struct file_operations vgem_driver_fops = {
.poll   = drm_poll,
.read   = drm_read,
.unlocked_ioctl = drm_ioctl,
+   .compat_ioctl   = drm_compat_ioctl,
.release= drm_release,
 };
 
-- 
2.13.2.932.g7449e964c-goog



[PATCH] drm/vgem: add compat_ioctl support

2017-07-14 Thread Brian Norris
DRM drivers should supply a compat version if they're going to provide
an ioctl implementation at all. This can confuse 32-bit user space on a
64-bit system.

Signed-off-by: Brian Norris 
---
 drivers/gpu/drm/vgem/vgem_drv.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c
index 9fee38a942c4..3835656e2baf 100644
--- a/drivers/gpu/drm/vgem/vgem_drv.c
+++ b/drivers/gpu/drm/vgem/vgem_drv.c
@@ -220,6 +220,7 @@ static const struct file_operations vgem_driver_fops = {
.poll   = drm_poll,
.read   = drm_read,
.unlocked_ioctl = drm_ioctl,
+   .compat_ioctl   = drm_compat_ioctl,
.release= drm_release,
 };
 
-- 
2.13.2.932.g7449e964c-goog



Re: [regression drm/noveau] suspend to ram -> BOOM: exception RIP: drm_calc_vbltimestamp_from_scanoutpos+335

2017-07-14 Thread Mike Galbraith
On Fri, 2017-07-14 at 14:42 -0500, Josh Poimboeuf wrote:
> 
> Does this fix it?

Yup, both READONLY __bug_table and "extra stern" warning are gone.

> diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
> index 39e702d..aa6b202 100644
> --- a/arch/x86/include/asm/bug.h
> +++ b/arch/x86/include/asm/bug.h
> @@ -35,7 +35,7 @@
>  #define _BUG_FLAGS(ins, flags)   
> \
>  do { \
>   asm volatile("1:\t" ins "\n"\
> -  ".pushsection __bug_table,\"a\"\n" \
> +  ".pushsection __bug_table,\"aw\"\n"\
>"2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n"   \
>"\t"  __BUG_REL(%c0) "\t# bug_entry::file\n"   \
>"\t.word %c1""\t# bug_entry::line\n"   \
> @@ -52,7 +52,7 @@ do {
> \
>  #define _BUG_FLAGS(ins, flags)   
> \
>  do { \
>   asm volatile("1:\t" ins "\n"\
> -  ".pushsection __bug_table,\"a\"\n" \
> +  ".pushsection __bug_table,\"aw\"\n"\
>"2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n"   \
>"\t.word %c0""\t# bug_entry::flags\n"  \
>"\t.org 2b+%c1\n"  \


Re: [regression drm/noveau] suspend to ram -> BOOM: exception RIP: drm_calc_vbltimestamp_from_scanoutpos+335

2017-07-14 Thread Mike Galbraith
On Fri, 2017-07-14 at 14:42 -0500, Josh Poimboeuf wrote:
> 
> Does this fix it?

Yup, both READONLY __bug_table and "extra stern" warning are gone.

> diff --git a/arch/x86/include/asm/bug.h b/arch/x86/include/asm/bug.h
> index 39e702d..aa6b202 100644
> --- a/arch/x86/include/asm/bug.h
> +++ b/arch/x86/include/asm/bug.h
> @@ -35,7 +35,7 @@
>  #define _BUG_FLAGS(ins, flags)   
> \
>  do { \
>   asm volatile("1:\t" ins "\n"\
> -  ".pushsection __bug_table,\"a\"\n" \
> +  ".pushsection __bug_table,\"aw\"\n"\
>"2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n"   \
>"\t"  __BUG_REL(%c0) "\t# bug_entry::file\n"   \
>"\t.word %c1""\t# bug_entry::line\n"   \
> @@ -52,7 +52,7 @@ do {
> \
>  #define _BUG_FLAGS(ins, flags)   
> \
>  do { \
>   asm volatile("1:\t" ins "\n"\
> -  ".pushsection __bug_table,\"a\"\n" \
> +  ".pushsection __bug_table,\"aw\"\n"\
>"2:\t" __BUG_REL(1b) "\t# bug_entry::bug_addr\n"   \
>"\t.word %c0""\t# bug_entry::flags\n"  \
>"\t.org 2b+%c1\n"  \


[PATCH] pinctrl: sprd: fix platform_no_drv_owner.cocci warnings

2017-07-14 Thread kbuild test robot
drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c:950:3-8: No need to set .owner here. 
The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Fixes: c4e438f44054 ("pinctrl: sprd: Add Spreadtrum pin control driver")
CC: Baolin Wang 
Signed-off-by: Fengguang Wu 
---

 pinctrl-sprd-sc9860.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
@@ -947,7 +947,6 @@ MODULE_DEVICE_TABLE(of, sprd_pinctrl_of_
 static struct platform_driver sprd_pinctrl_driver = {
.driver = {
.name = "sprd-pinctrl",
-   .owner = THIS_MODULE,
.of_match_table = sprd_pinctrl_of_match,
},
.probe = sprd_pinctrl_probe,


[PATCH] pinctrl: sprd: fix platform_no_drv_owner.cocci warnings

2017-07-14 Thread kbuild test robot
drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c:950:3-8: No need to set .owner here. 
The core will do it.

 Remove .owner field if calls are used which set it automatically

Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci

Fixes: c4e438f44054 ("pinctrl: sprd: Add Spreadtrum pin control driver")
CC: Baolin Wang 
Signed-off-by: Fengguang Wu 
---

 pinctrl-sprd-sc9860.c |1 -
 1 file changed, 1 deletion(-)

--- a/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
+++ b/drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c
@@ -947,7 +947,6 @@ MODULE_DEVICE_TABLE(of, sprd_pinctrl_of_
 static struct platform_driver sprd_pinctrl_driver = {
.driver = {
.name = "sprd-pinctrl",
-   .owner = THIS_MODULE,
.of_match_table = sprd_pinctrl_of_match,
},
.probe = sprd_pinctrl_probe,


Re: [PATCH v5 3/3] pinctrl: sprd: Add Spreadtrum pin control driver

2017-07-14 Thread kbuild test robot
Hi Baolin,

[auto build test WARNING on v4.12]
[cannot apply to pinctrl/devel robh/for-next next-20170714]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Baolin-Wang/pinctrl-Add-sleep-related-state-to-indicate-sleep-related-configs/20170715-021507


coccinelle warnings: (new ones prefixed by >>)

>> drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c:950:3-8: No need to set .owner 
>> here. The core will do it.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


Re: [PATCH v5 3/3] pinctrl: sprd: Add Spreadtrum pin control driver

2017-07-14 Thread kbuild test robot
Hi Baolin,

[auto build test WARNING on v4.12]
[cannot apply to pinctrl/devel robh/for-next next-20170714]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Baolin-Wang/pinctrl-Add-sleep-related-state-to-indicate-sleep-related-configs/20170715-021507


coccinelle warnings: (new ones prefixed by >>)

>> drivers/pinctrl/sprd/pinctrl-sprd-sc9860.c:950:3-8: No need to set .owner 
>> here. The core will do it.

Please review and possibly fold the followup patch.

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


Re: [PATCH RFC] scripts/sphinx-pre-install: add a script to check Sphinx install

2017-07-14 Thread Mauro Carvalho Chehab
Em Fri, 14 Jul 2017 19:35:59 +0200
Markus Heiser  escreveu:

> > Am 14.07.2017 um 18:49 schrieb Mauro Carvalho Chehab 
> > :
> > 
> > Solving Sphinx dependencies can be painful. Add a script to
> > check if everything is ok.  
> 
> just my 5cent:
> 
> What we need is a "requirements.txt" file to define a
> **reference environment**. E.g. to stick Sphinx 1.4.9 in
> such a reference environment::
> 
>  ---
> Sphinx==1.4.9
> sphinx_rtd_theme
>  -
> 
> The rest is similarly to what you wrote in doc-guide/sphinx.rst ...
> 
> The ref-environment can be build with virtualenv & pip::
> 
> $ virtualenv --python=python3 docenv
> (doc-env) $ source ./docenv/bin/activate
> (doc-env) $ pip install -r requirements.txt
> 
> From now we can start our build as usual. If not already done,
> first activate the environment::
> 
> $ . ./docenv/bin/activate
> (doc-env) $ make htmldocs
> 
> This (requirements.txt) is the way python packaging goes.


The above assumes that the user wants to use virtenv and
have python3, virtualenv3 and pip3 already installed.

I agree that a virtual environment works better than using
distro-specific packaging, as Sphinx toolchain is really
fragile. But we should give an option for the developer to
use whatever he wants.

I'm actually thinking that the final version of this script
is to have a command line parameter to would allow selecting
between virtenv or package install for Sphinx.

IMHO, virtenv should be the default.

> Ok, this won't solve TeX installation problems of Linux distros,
> for this a script like the one here in your RFC is helpful.

Your proposal doesn't solve Python, TeX, GraphViz nor 
ImageMagick dependencies.

The TeX dependencies are the hardest ones, and, whatever
solution we take, this should be taken into account.

Thanks,
Mauro


Re: [PATCH RFC] scripts/sphinx-pre-install: add a script to check Sphinx install

2017-07-14 Thread Mauro Carvalho Chehab
Em Fri, 14 Jul 2017 19:35:59 +0200
Markus Heiser  escreveu:

> > Am 14.07.2017 um 18:49 schrieb Mauro Carvalho Chehab 
> > :
> > 
> > Solving Sphinx dependencies can be painful. Add a script to
> > check if everything is ok.  
> 
> just my 5cent:
> 
> What we need is a "requirements.txt" file to define a
> **reference environment**. E.g. to stick Sphinx 1.4.9 in
> such a reference environment::
> 
>  ---
> Sphinx==1.4.9
> sphinx_rtd_theme
>  -
> 
> The rest is similarly to what you wrote in doc-guide/sphinx.rst ...
> 
> The ref-environment can be build with virtualenv & pip::
> 
> $ virtualenv --python=python3 docenv
> (doc-env) $ source ./docenv/bin/activate
> (doc-env) $ pip install -r requirements.txt
> 
> From now we can start our build as usual. If not already done,
> first activate the environment::
> 
> $ . ./docenv/bin/activate
> (doc-env) $ make htmldocs
> 
> This (requirements.txt) is the way python packaging goes.


The above assumes that the user wants to use virtenv and
have python3, virtualenv3 and pip3 already installed.

I agree that a virtual environment works better than using
distro-specific packaging, as Sphinx toolchain is really
fragile. But we should give an option for the developer to
use whatever he wants.

I'm actually thinking that the final version of this script
is to have a command line parameter to would allow selecting
between virtenv or package install for Sphinx.

IMHO, virtenv should be the default.

> Ok, this won't solve TeX installation problems of Linux distros,
> for this a script like the one here in your RFC is helpful.

Your proposal doesn't solve Python, TeX, GraphViz nor 
ImageMagick dependencies.

The TeX dependencies are the hardest ones, and, whatever
solution we take, this should be taken into account.

Thanks,
Mauro


[RFC v3] scripts/sphinx-pre-install: add a script to check Sphinx install

2017-07-14 Thread Mauro Carvalho Chehab
Solving Sphinx dependencies can be painful. Add a script to
check if everything is ok.

Tested on Fedora 26 and Ubuntu 17.04.

Signed-off-by: Mauro Carvalho Chehab 
---

v3: check for DeJavu fonts on Ubuntu and add "sudo" to Fedora instructions
v2: add support for Fedora 26

 scripts/sphinx-pre-install | 324 +
 1 file changed, 324 insertions(+)
 create mode 100755 scripts/sphinx-pre-install

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
new file mode 100755
index ..fa9976df719e
--- /dev/null
+++ b/scripts/sphinx-pre-install
@@ -0,0 +1,324 @@
+#!/usr/bin/perl
+use strict;
+
+#
+# Static vars
+#
+
+my @missing;
+my @opt_missing;
+my $system_release;
+my $need = 0;
+my $optional = 0;
+my $need_symlink = 0;
+my $install = "";
+
+##
+# Subroutines used at the check missing deps logic
+##
+
+sub catcheck($)
+{
+  my $res = "";
+  $res = qx(cat $_[0]) if (-r $_[0]);
+  return $res;
+}
+
+sub check_missing(%)
+{
+   my %map = %{$_[0]};
+
+   foreach my $prog (@missing) {
+   print "ERROR: please install \"$prog\", otherwise, build won't 
work.\n";
+   if (defined($map{$prog})) {
+   $install .= " " . $map{$prog};
+   } else {
+   $install .= " " . $prog;
+   }
+   }
+   foreach my $prog (@opt_missing) {
+   print "Warning: better to also install \"$prog\".\n";
+   if (defined($map{$prog})) {
+   $install .= " " . $map{$prog};
+   } else {
+   $install .= " " . $prog;
+   }
+   }
+
+   $install =~ s/^\s//;
+}
+
+sub add_package($$)
+{
+   my $package = shift;
+   my $is_optional = shift;
+
+   if ($is_optional) {
+   push @opt_missing, $package;
+
+   $optional++;
+   } else {
+   push @missing, $package;
+
+   $need++;
+   }
+}
+
+sub check_missing_file($$$)
+{
+   my $file = shift;
+   my $package = shift;
+   my $is_optional = shift;
+
+   return if(-e $file);
+
+   add_package($package, $is_optional);
+}
+
+sub findprog($)
+{
+   foreach(split(/:/, $ENV{PATH})) {
+   return "$_/$_[0]" if(-x "$_/$_[0]");
+   }
+}
+
+sub check_program($$)
+{
+   my $prog = shift;
+   my $is_optional = shift;
+
+   return if findprog($prog);
+
+   add_package($prog, $is_optional);
+}
+
+sub check_perl_module($$)
+{
+   my $prog = shift;
+   my $is_optional = shift;
+
+   my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null");
+   return if ($err == 0);
+
+   add_package($prog, $is_optional);
+}
+
+sub check_python_module($$)
+{
+   my $prog = shift;
+   my $is_optional = shift;
+
+   my $err = system("python3 -c 'import $prog' 2>/dev/null /dev/null");
+   return if ($err == 0);
+   my $err = system("python -c 'import $prog' 2>/dev/null /dev/null");
+   return if ($err == 0);
+
+   add_package($prog, $is_optional);
+}
+
+sub check_sphinx()
+{
+   return if findprog("sphinx-build");
+
+   if (findprog("sphinx-build-3")) {
+   $need_symlink = 1;
+   return;
+   }
+
+   add_package("python-sphinx", 0);
+}
+
+sub which($)
+{
+   my $file = shift;
+   my @path = split ":", $ENV{PATH};
+
+   foreach my $dir(@path) {
+   my $name = $dir.'/'.$file;
+   return $name if (-x $name );
+   }
+   return undef;
+}
+
+sub give_debian_hints()
+{
+   my %map = (
+   "python-sphinx" => "python3-sphinx",
+   "sphinx_rtd_theme"  => "python3-sphinx-rtd-theme",
+   "dot"   => "graphviz",
+   "convert"   => "imagemagick",
+   "Pod::Usage"=> "perl-modules",
+   "xelatex"   => "texlive-xetex",
+   );
+
+   check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
+  "fonts-dejavu", 1);
+
+   check_missing(\%map);
+
+   return if (!$need && !$optional);
+   printf("You should run:\n\n\tsudo apt-get install $install\n");
+}
+
+sub give_redhat_hints()
+{
+   my %map = (
+   "python-sphinx" => "python3-sphinx",
+   "sphinx_rtd_theme"  => "python3-sphinx_rtd_theme",
+   "dot"   => "graphviz",
+   "convert"   => "ImageMagick",
+   "Pod::Usage"=> "perl-Pod-Usage",
+   "xelatex"   => "texlive-xetex-bin 
python-sphinx-latex.noarch",
+   );
+
+   check_missing_file("/usr/share/licenses/python-sphinx-latex/LICENSE",
+  

[RFC v3] scripts/sphinx-pre-install: add a script to check Sphinx install

2017-07-14 Thread Mauro Carvalho Chehab
Solving Sphinx dependencies can be painful. Add a script to
check if everything is ok.

Tested on Fedora 26 and Ubuntu 17.04.

Signed-off-by: Mauro Carvalho Chehab 
---

v3: check for DeJavu fonts on Ubuntu and add "sudo" to Fedora instructions
v2: add support for Fedora 26

 scripts/sphinx-pre-install | 324 +
 1 file changed, 324 insertions(+)
 create mode 100755 scripts/sphinx-pre-install

diff --git a/scripts/sphinx-pre-install b/scripts/sphinx-pre-install
new file mode 100755
index ..fa9976df719e
--- /dev/null
+++ b/scripts/sphinx-pre-install
@@ -0,0 +1,324 @@
+#!/usr/bin/perl
+use strict;
+
+#
+# Static vars
+#
+
+my @missing;
+my @opt_missing;
+my $system_release;
+my $need = 0;
+my $optional = 0;
+my $need_symlink = 0;
+my $install = "";
+
+##
+# Subroutines used at the check missing deps logic
+##
+
+sub catcheck($)
+{
+  my $res = "";
+  $res = qx(cat $_[0]) if (-r $_[0]);
+  return $res;
+}
+
+sub check_missing(%)
+{
+   my %map = %{$_[0]};
+
+   foreach my $prog (@missing) {
+   print "ERROR: please install \"$prog\", otherwise, build won't 
work.\n";
+   if (defined($map{$prog})) {
+   $install .= " " . $map{$prog};
+   } else {
+   $install .= " " . $prog;
+   }
+   }
+   foreach my $prog (@opt_missing) {
+   print "Warning: better to also install \"$prog\".\n";
+   if (defined($map{$prog})) {
+   $install .= " " . $map{$prog};
+   } else {
+   $install .= " " . $prog;
+   }
+   }
+
+   $install =~ s/^\s//;
+}
+
+sub add_package($$)
+{
+   my $package = shift;
+   my $is_optional = shift;
+
+   if ($is_optional) {
+   push @opt_missing, $package;
+
+   $optional++;
+   } else {
+   push @missing, $package;
+
+   $need++;
+   }
+}
+
+sub check_missing_file($$$)
+{
+   my $file = shift;
+   my $package = shift;
+   my $is_optional = shift;
+
+   return if(-e $file);
+
+   add_package($package, $is_optional);
+}
+
+sub findprog($)
+{
+   foreach(split(/:/, $ENV{PATH})) {
+   return "$_/$_[0]" if(-x "$_/$_[0]");
+   }
+}
+
+sub check_program($$)
+{
+   my $prog = shift;
+   my $is_optional = shift;
+
+   return if findprog($prog);
+
+   add_package($prog, $is_optional);
+}
+
+sub check_perl_module($$)
+{
+   my $prog = shift;
+   my $is_optional = shift;
+
+   my $err = system("perl -M$prog -e 1 2>/dev/null /dev/null");
+   return if ($err == 0);
+
+   add_package($prog, $is_optional);
+}
+
+sub check_python_module($$)
+{
+   my $prog = shift;
+   my $is_optional = shift;
+
+   my $err = system("python3 -c 'import $prog' 2>/dev/null /dev/null");
+   return if ($err == 0);
+   my $err = system("python -c 'import $prog' 2>/dev/null /dev/null");
+   return if ($err == 0);
+
+   add_package($prog, $is_optional);
+}
+
+sub check_sphinx()
+{
+   return if findprog("sphinx-build");
+
+   if (findprog("sphinx-build-3")) {
+   $need_symlink = 1;
+   return;
+   }
+
+   add_package("python-sphinx", 0);
+}
+
+sub which($)
+{
+   my $file = shift;
+   my @path = split ":", $ENV{PATH};
+
+   foreach my $dir(@path) {
+   my $name = $dir.'/'.$file;
+   return $name if (-x $name );
+   }
+   return undef;
+}
+
+sub give_debian_hints()
+{
+   my %map = (
+   "python-sphinx" => "python3-sphinx",
+   "sphinx_rtd_theme"  => "python3-sphinx-rtd-theme",
+   "dot"   => "graphviz",
+   "convert"   => "imagemagick",
+   "Pod::Usage"=> "perl-modules",
+   "xelatex"   => "texlive-xetex",
+   );
+
+   check_missing_file("/usr/share/fonts/truetype/dejavu/DejaVuSans.ttf",
+  "fonts-dejavu", 1);
+
+   check_missing(\%map);
+
+   return if (!$need && !$optional);
+   printf("You should run:\n\n\tsudo apt-get install $install\n");
+}
+
+sub give_redhat_hints()
+{
+   my %map = (
+   "python-sphinx" => "python3-sphinx",
+   "sphinx_rtd_theme"  => "python3-sphinx_rtd_theme",
+   "dot"   => "graphviz",
+   "convert"   => "ImageMagick",
+   "Pod::Usage"=> "perl-Pod-Usage",
+   "xelatex"   => "texlive-xetex-bin 
python-sphinx-latex.noarch",
+   );
+
+   check_missing_file("/usr/share/licenses/python-sphinx-latex/LICENSE",
+  "python-sphinx-latex", 1);
+   

Re: [PATCH v2 00/53] Get rid of Docbook

2017-07-14 Thread Mauro Carvalho Chehab
Em Fri, 14 Jul 2017 16:15:23 -0700
Jim Davis  escreveu:

> On Thu, Jul 6, 2017 at 1:54 AM, Markus Heiser  
> wrote:
> 
> >  52b3f23 Docs: clean up some DocBook loose ends  
> 
> Speaking of minor loose ends,
> 
> make SPHINXDIRS=userspace-api pdfdocs
> 
> works -- though now that it's all sphinx, wouldn't just DIRS be better? -- and

Hmm... I don't like the idea of just DIRS, as there are other paths
used on Makefile (INSTALL_PATH, INSTALL_MOD_PATH, INSTALL_HDR_PATH).

> 
> make DOCBOOKS=userspace-api pdfdocs
> 
> still works too.  But that generates all of the pdf files, and not
> just the userspace-api.pdf. 

It will just ignore it. The same happens if you do:
make FOO=bar htmldocs

Yet, it could make sense to either warn or make it equivalent to
SPHINXDIRS at the Documentation/Makefile.

> And running now-dead targets like "make
> ps" or "make sgmldocs" or "make mandocs" just returns with no output.

Yeah. We need to get rid of those targets from Documentation/Makefile:

sgmldocs:
psdocs:
mandocs:
installmandocs:

I guess the enclosed patch should do the trick.

Thanks,
Mauro

-

docs: Makefile: remove no-ops targets

After removal of DocBook, those targets are bogus.

Reported-by: Jim Davis 
Signed-off-by: Mauro Carvalho Chehab 

diff --git a/Documentation/Makefile b/Documentation/Makefile
index a42320385df3..d75c00e3aadb 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -95,16 +95,6 @@ endif # HAVE_SPHINX
 # The following targets are independent of HAVE_SPHINX, and the rules should
 # work or silently pass without Sphinx.
 
-# no-ops for the Sphinx toolchain
-sgmldocs:
-   @:
-psdocs:
-   @:
-mandocs:
-   @:
-installmandocs:
-   @:
-
 cleandocs:
$(Q)rm -rf $(BUILDDIR)
$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) 
$(build)=Documentation/media clean
diff --git a/Documentation/translations/zh_CN/HOWTO 
b/Documentation/translations/zh_CN/HOWTO
index 11be075ba5fa..5f6d09edc9ac 100644
--- a/Documentation/translations/zh_CN/HOWTO
+++ b/Documentation/translations/zh_CN/HOWTO
@@ -149,9 +149,7 @@ Linux内核代码中包含有大量的文档。这些文档对于学习如何与
 核源码的主目录中使用以下不同命令将会分别生成PDF、Postscript、HTML和手册
 页等不同格式的文档:
 make pdfdocs
-make psdocs
 make htmldocs
-make mandocs
 
 
 如何成为内核开发者
diff --git a/Makefile b/Makefile
index 547947ff87de..5db9c669e541 100644
--- a/Makefile
+++ b/Makefile
@@ -1459,7 +1459,7 @@ $(help-board-dirs): help-%:
 
 # Documentation targets
 # ---
-DOC_TARGETS := xmldocs sgmldocs psdocs latexdocs pdfdocs htmldocs mandocs 
installmandocs epubdocs cleandocs linkcheckdocs
+DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs 
linkcheckdocs
 PHONY += $(DOC_TARGETS)
 $(DOC_TARGETS): scripts_basic FORCE
$(Q)$(MAKE) $(build)=Documentation $@


Re: [PATCH v2 00/53] Get rid of Docbook

2017-07-14 Thread Mauro Carvalho Chehab
Em Fri, 14 Jul 2017 16:15:23 -0700
Jim Davis  escreveu:

> On Thu, Jul 6, 2017 at 1:54 AM, Markus Heiser  
> wrote:
> 
> >  52b3f23 Docs: clean up some DocBook loose ends  
> 
> Speaking of minor loose ends,
> 
> make SPHINXDIRS=userspace-api pdfdocs
> 
> works -- though now that it's all sphinx, wouldn't just DIRS be better? -- and

Hmm... I don't like the idea of just DIRS, as there are other paths
used on Makefile (INSTALL_PATH, INSTALL_MOD_PATH, INSTALL_HDR_PATH).

> 
> make DOCBOOKS=userspace-api pdfdocs
> 
> still works too.  But that generates all of the pdf files, and not
> just the userspace-api.pdf. 

It will just ignore it. The same happens if you do:
make FOO=bar htmldocs

Yet, it could make sense to either warn or make it equivalent to
SPHINXDIRS at the Documentation/Makefile.

> And running now-dead targets like "make
> ps" or "make sgmldocs" or "make mandocs" just returns with no output.

Yeah. We need to get rid of those targets from Documentation/Makefile:

sgmldocs:
psdocs:
mandocs:
installmandocs:

I guess the enclosed patch should do the trick.

Thanks,
Mauro

-

docs: Makefile: remove no-ops targets

After removal of DocBook, those targets are bogus.

Reported-by: Jim Davis 
Signed-off-by: Mauro Carvalho Chehab 

diff --git a/Documentation/Makefile b/Documentation/Makefile
index a42320385df3..d75c00e3aadb 100644
--- a/Documentation/Makefile
+++ b/Documentation/Makefile
@@ -95,16 +95,6 @@ endif # HAVE_SPHINX
 # The following targets are independent of HAVE_SPHINX, and the rules should
 # work or silently pass without Sphinx.
 
-# no-ops for the Sphinx toolchain
-sgmldocs:
-   @:
-psdocs:
-   @:
-mandocs:
-   @:
-installmandocs:
-   @:
-
 cleandocs:
$(Q)rm -rf $(BUILDDIR)
$(Q)$(MAKE) BUILDDIR=$(abspath $(BUILDDIR)) 
$(build)=Documentation/media clean
diff --git a/Documentation/translations/zh_CN/HOWTO 
b/Documentation/translations/zh_CN/HOWTO
index 11be075ba5fa..5f6d09edc9ac 100644
--- a/Documentation/translations/zh_CN/HOWTO
+++ b/Documentation/translations/zh_CN/HOWTO
@@ -149,9 +149,7 @@ Linux内核代码中包含有大量的文档。这些文档对于学习如何与
 核源码的主目录中使用以下不同命令将会分别生成PDF、Postscript、HTML和手册
 页等不同格式的文档:
 make pdfdocs
-make psdocs
 make htmldocs
-make mandocs
 
 
 如何成为内核开发者
diff --git a/Makefile b/Makefile
index 547947ff87de..5db9c669e541 100644
--- a/Makefile
+++ b/Makefile
@@ -1459,7 +1459,7 @@ $(help-board-dirs): help-%:
 
 # Documentation targets
 # ---
-DOC_TARGETS := xmldocs sgmldocs psdocs latexdocs pdfdocs htmldocs mandocs 
installmandocs epubdocs cleandocs linkcheckdocs
+DOC_TARGETS := xmldocs latexdocs pdfdocs htmldocs epubdocs cleandocs 
linkcheckdocs
 PHONY += $(DOC_TARGETS)
 $(DOC_TARGETS): scripts_basic FORCE
$(Q)$(MAKE) $(build)=Documentation $@


[PATCH for v4.9 LTS 07/87] ARM: dts: n900: Mark eMMC slot with no-sdio and no-sd flags

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Pali Rohár 

[ Upstream commit 4cf48f1d7520a4d325af58eded4d8090e1b40be7 ]

Trying to initialize eMMC slot as SDIO or SD cause failure in n900 port of
qemu. eMMC itself is not detected and is not working.

Real Nokia N900 harware does not have this problem. As eMMC is really not
SDIO or SD based such change is harmless and will fix support for qemu.

Signed-off-by: Pali Rohár 
Acked-by: Pavel Machek 
Signed-off-by: Tony Lindgren 
Signed-off-by: Sasha Levin 
---
 arch/arm/boot/dts/omap3-n900.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 87ca50b53002..4d448f145ed1 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -734,6 +734,8 @@
vmmc_aux-supply = <>;
bus-width = <8>;
non-removable;
+   no-sdio;
+   no-sd;
 };
 
  {
-- 
2.11.0


[PATCH for v4.9 LTS 07/87] ARM: dts: n900: Mark eMMC slot with no-sdio and no-sd flags

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Pali Rohár 

[ Upstream commit 4cf48f1d7520a4d325af58eded4d8090e1b40be7 ]

Trying to initialize eMMC slot as SDIO or SD cause failure in n900 port of
qemu. eMMC itself is not detected and is not working.

Real Nokia N900 harware does not have this problem. As eMMC is really not
SDIO or SD based such change is harmless and will fix support for qemu.

Signed-off-by: Pali Rohár 
Acked-by: Pavel Machek 
Signed-off-by: Tony Lindgren 
Signed-off-by: Sasha Levin 
---
 arch/arm/boot/dts/omap3-n900.dts | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/omap3-n900.dts b/arch/arm/boot/dts/omap3-n900.dts
index 87ca50b53002..4d448f145ed1 100644
--- a/arch/arm/boot/dts/omap3-n900.dts
+++ b/arch/arm/boot/dts/omap3-n900.dts
@@ -734,6 +734,8 @@
vmmc_aux-supply = <>;
bus-width = <8>;
non-removable;
+   no-sdio;
+   no-sd;
 };
 
  {
-- 
2.11.0


Re: [PATCH net-next 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-14 Thread Sean Wang
On Wed, 2017-07-12 at 16:50 +0200, Andrew Lunn wrote:
> > +static int mtk_clk_enable(struct mtk_eth *eth)
> > +{
> > +   int clk, ret;
> > +
> > +   for (clk = 0; clk < MTK_CLK_MAX ; clk++) {
> > +   if (eth->clks[clk]) {
> > +   ret = clk_prepare_enable(eth->clks[clk]);
> > +   if (ret)
> > +   goto err_disable_clks;
> > +   }
> > +   }
> > +
> > +   return 0;
> > +
> > +err_disable_clks:
> > +   while (--clk >= 0) {
> > +   if (eth->clks[clk])
> > +   clk_disable_unprepare(eth->clks[clk]);
> > +   }
> > +
> > +   return ret;
> > +}
> 
> > +
> >  static int mtk_hw_init(struct mtk_eth *eth)
> >  {
> > int i, val;
> > @@ -1847,10 +1881,8 @@ static int mtk_hw_init(struct mtk_eth *eth)
> > pm_runtime_enable(eth->dev);
> > pm_runtime_get_sync(eth->dev);
> >  
> > -   clk_prepare_enable(eth->clks[MTK_CLK_ETHIF]);
> > -   clk_prepare_enable(eth->clks[MTK_CLK_ESW]);
> > -   clk_prepare_enable(eth->clks[MTK_CLK_GP1]);
> > -   clk_prepare_enable(eth->clks[MTK_CLK_GP2]);
> > +   mtk_clk_enable(eth);
> > +
> 
> mtk_clk_enable() returns an error code. It is probably a good idea to
> use it, especially if it could be EPRODE_DEFER.

okay, I will improve those clocks handling better along with Florian's
suggestion in the next version

Sean












> 
> Andrew




Re: [PATCH net-next 2/4] net-next: mediatek: add platform data to adapt into various hardware

2017-07-14 Thread Sean Wang
On Wed, 2017-07-12 at 16:50 +0200, Andrew Lunn wrote:
> > +static int mtk_clk_enable(struct mtk_eth *eth)
> > +{
> > +   int clk, ret;
> > +
> > +   for (clk = 0; clk < MTK_CLK_MAX ; clk++) {
> > +   if (eth->clks[clk]) {
> > +   ret = clk_prepare_enable(eth->clks[clk]);
> > +   if (ret)
> > +   goto err_disable_clks;
> > +   }
> > +   }
> > +
> > +   return 0;
> > +
> > +err_disable_clks:
> > +   while (--clk >= 0) {
> > +   if (eth->clks[clk])
> > +   clk_disable_unprepare(eth->clks[clk]);
> > +   }
> > +
> > +   return ret;
> > +}
> 
> > +
> >  static int mtk_hw_init(struct mtk_eth *eth)
> >  {
> > int i, val;
> > @@ -1847,10 +1881,8 @@ static int mtk_hw_init(struct mtk_eth *eth)
> > pm_runtime_enable(eth->dev);
> > pm_runtime_get_sync(eth->dev);
> >  
> > -   clk_prepare_enable(eth->clks[MTK_CLK_ETHIF]);
> > -   clk_prepare_enable(eth->clks[MTK_CLK_ESW]);
> > -   clk_prepare_enable(eth->clks[MTK_CLK_GP1]);
> > -   clk_prepare_enable(eth->clks[MTK_CLK_GP2]);
> > +   mtk_clk_enable(eth);
> > +
> 
> mtk_clk_enable() returns an error code. It is probably a good idea to
> use it, especially if it could be EPRODE_DEFER.

okay, I will improve those clocks handling better along with Florian's
suggestion in the next version

Sean












> 
> Andrew




[PATCH for v4.9 LTS 10/87] net/mlx4_core: Use-after-free causes a resource leak in flow-steering detach

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jack Morgenstein 

[ Upstream commit 3b01fe7f91c8e4f9afc4fae3c5af72c14958d2d8 ]

mlx4_QP_FLOW_STEERING_DETACH_wrapper first removes the steering
rule (which results in freeing the rule structure), and then
references a field in this struct (the qp number) when releasing the
busy-status on the rule's qp.

Since this memory was freed, it could reallocated and changed.
Therefore, the qp number in the struct may be incorrect,
so that we are releasing the incorrect qp. This leaves the rule's qp
in the busy state (and could possibly release an incorrect qp as well).

Fix this by saving the qp number in a local variable, for use after
removing the steering rule.

Fixes: 2c473ae7e582 ("net/mlx4_core: Disallow releasing VF QPs which have 
steering rules")
Signed-off-by: Jack Morgenstein 
Signed-off-by: Tariq Toukan 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c 
b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 32f76bf018c3..f1eb74a61bce 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -4474,6 +4474,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev 
*dev, int slave,
struct res_qp *rqp;
struct res_fs_rule *rrule;
u64 mirr_reg_id;
+   int qpn;
 
if (dev->caps.steering_mode !=
MLX4_STEERING_MODE_DEVICE_MANAGED)
@@ -4490,10 +4491,11 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct 
mlx4_dev *dev, int slave,
}
mirr_reg_id = rrule->mirr_rule_id;
kfree(rrule->mirr_mbox);
+   qpn = rrule->qpn;
 
/* Release the rule form busy state before removal */
put_res(dev, slave, vhcr->in_param, RES_FS_RULE);
-   err = get_res(dev, slave, rrule->qpn, RES_QP, );
+   err = get_res(dev, slave, qpn, RES_QP, );
if (err)
return err;
 
@@ -4518,7 +4520,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev 
*dev, int slave,
if (!err)
atomic_dec(>ref_count);
 out:
-   put_res(dev, slave, rrule->qpn, RES_QP);
+   put_res(dev, slave, qpn, RES_QP);
return err;
 }
 
-- 
2.11.0


[PATCH for v4.9 LTS 10/87] net/mlx4_core: Use-after-free causes a resource leak in flow-steering detach

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jack Morgenstein 

[ Upstream commit 3b01fe7f91c8e4f9afc4fae3c5af72c14958d2d8 ]

mlx4_QP_FLOW_STEERING_DETACH_wrapper first removes the steering
rule (which results in freeing the rule structure), and then
references a field in this struct (the qp number) when releasing the
busy-status on the rule's qp.

Since this memory was freed, it could reallocated and changed.
Therefore, the qp number in the struct may be incorrect,
so that we are releasing the incorrect qp. This leaves the rule's qp
in the busy state (and could possibly release an incorrect qp as well).

Fix this by saving the qp number in a local variable, for use after
removing the steering rule.

Fixes: 2c473ae7e582 ("net/mlx4_core: Disallow releasing VF QPs which have 
steering rules")
Signed-off-by: Jack Morgenstein 
Signed-off-by: Tariq Toukan 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c 
b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index 32f76bf018c3..f1eb74a61bce 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -4474,6 +4474,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev 
*dev, int slave,
struct res_qp *rqp;
struct res_fs_rule *rrule;
u64 mirr_reg_id;
+   int qpn;
 
if (dev->caps.steering_mode !=
MLX4_STEERING_MODE_DEVICE_MANAGED)
@@ -4490,10 +4491,11 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct 
mlx4_dev *dev, int slave,
}
mirr_reg_id = rrule->mirr_rule_id;
kfree(rrule->mirr_mbox);
+   qpn = rrule->qpn;
 
/* Release the rule form busy state before removal */
put_res(dev, slave, vhcr->in_param, RES_FS_RULE);
-   err = get_res(dev, slave, rrule->qpn, RES_QP, );
+   err = get_res(dev, slave, qpn, RES_QP, );
if (err)
return err;
 
@@ -4518,7 +4520,7 @@ int mlx4_QP_FLOW_STEERING_DETACH_wrapper(struct mlx4_dev 
*dev, int slave,
if (!err)
atomic_dec(>ref_count);
 out:
-   put_res(dev, slave, rrule->qpn, RES_QP);
+   put_res(dev, slave, qpn, RES_QP);
return err;
 }
 
-- 
2.11.0


[PATCH for v4.9 LTS 05/87] dt-bindings: input: Specify the interrupt number of TPS65217 power button

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Milo Kim 

[ Upstream commit 820381572fc015baa4f5744f5d4583ec0c0f1b82 ]

Specify the power button interrupt number which is from the datasheet.

Signed-off-by: Milo Kim 
Acked-by: Rob Herring 
Signed-off-by: Tony Lindgren 
Signed-off-by: Sasha Levin 
---
 Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt 
b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
index 3e5b9793341f..8682ab6d4a50 100644
--- a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
+++ b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
@@ -8,8 +8,9 @@ This driver provides a simple power button event via an 
Interrupt.
 Required properties:
 - compatible: should be "ti,tps65217-pwrbutton" or "ti,tps65218-pwrbutton"
 
-Required properties for TPS65218:
+Required properties:
 - interrupts: should be one of the following
+   - <2>: For controllers compatible with tps65217
- <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218
 
 Examples:
@@ -17,6 +18,7 @@ Examples:
  {
tps65217-pwrbutton {
compatible = "ti,tps65217-pwrbutton";
+   interrupts = <2>;
};
 };
 
-- 
2.11.0


[PATCH for v4.9 LTS 11/87] net/mlx4: Remove BUG_ON from ICM allocation routine

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Leon Romanovsky 

[ Upstream commit c1d5f8ff80ea84768f5fae1ca9d1abfbb5e6bbaa ]

This patch removes BUG_ON() macro from mlx4_alloc_icm_coherent()
by checking DMA address alignment in advance and performing proper
folding in case of error.

Fixes: 5b0bf5e25efe ("mlx4_core: Support ICM tables in coherent memory")
Reported-by: Ozgur Karatas 
Signed-off-by: Leon Romanovsky 
Signed-off-by: Tariq Toukan 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/net/ethernet/mellanox/mlx4/icm.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c 
b/drivers/net/ethernet/mellanox/mlx4/icm.c
index 2a9dd460a95f..e1f9e7cebf8f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/icm.c
+++ b/drivers/net/ethernet/mellanox/mlx4/icm.c
@@ -118,8 +118,13 @@ static int mlx4_alloc_icm_coherent(struct device *dev, 
struct scatterlist *mem,
if (!buf)
return -ENOMEM;
 
+   if (offset_in_page(buf)) {
+   dma_free_coherent(dev, PAGE_SIZE << order,
+ buf, sg_dma_address(mem));
+   return -ENOMEM;
+   }
+
sg_set_buf(mem, buf, PAGE_SIZE << order);
-   BUG_ON(mem->offset);
sg_dma_len(mem) = PAGE_SIZE << order;
return 0;
 }
-- 
2.11.0


[PATCH for v4.9 LTS 05/87] dt-bindings: input: Specify the interrupt number of TPS65217 power button

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Milo Kim 

[ Upstream commit 820381572fc015baa4f5744f5d4583ec0c0f1b82 ]

Specify the power button interrupt number which is from the datasheet.

Signed-off-by: Milo Kim 
Acked-by: Rob Herring 
Signed-off-by: Tony Lindgren 
Signed-off-by: Sasha Levin 
---
 Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt 
b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
index 3e5b9793341f..8682ab6d4a50 100644
--- a/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
+++ b/Documentation/devicetree/bindings/input/tps65218-pwrbutton.txt
@@ -8,8 +8,9 @@ This driver provides a simple power button event via an 
Interrupt.
 Required properties:
 - compatible: should be "ti,tps65217-pwrbutton" or "ti,tps65218-pwrbutton"
 
-Required properties for TPS65218:
+Required properties:
 - interrupts: should be one of the following
+   - <2>: For controllers compatible with tps65217
- <3 IRQ_TYPE_EDGE_BOTH>: For controllers compatible with tps65218
 
 Examples:
@@ -17,6 +18,7 @@ Examples:
  {
tps65217-pwrbutton {
compatible = "ti,tps65217-pwrbutton";
+   interrupts = <2>;
};
 };
 
-- 
2.11.0


[PATCH for v4.9 LTS 11/87] net/mlx4: Remove BUG_ON from ICM allocation routine

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Leon Romanovsky 

[ Upstream commit c1d5f8ff80ea84768f5fae1ca9d1abfbb5e6bbaa ]

This patch removes BUG_ON() macro from mlx4_alloc_icm_coherent()
by checking DMA address alignment in advance and performing proper
folding in case of error.

Fixes: 5b0bf5e25efe ("mlx4_core: Support ICM tables in coherent memory")
Reported-by: Ozgur Karatas 
Signed-off-by: Leon Romanovsky 
Signed-off-by: Tariq Toukan 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/net/ethernet/mellanox/mlx4/icm.c | 7 ++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx4/icm.c 
b/drivers/net/ethernet/mellanox/mlx4/icm.c
index 2a9dd460a95f..e1f9e7cebf8f 100644
--- a/drivers/net/ethernet/mellanox/mlx4/icm.c
+++ b/drivers/net/ethernet/mellanox/mlx4/icm.c
@@ -118,8 +118,13 @@ static int mlx4_alloc_icm_coherent(struct device *dev, 
struct scatterlist *mem,
if (!buf)
return -ENOMEM;
 
+   if (offset_in_page(buf)) {
+   dma_free_coherent(dev, PAGE_SIZE << order,
+ buf, sg_dma_address(mem));
+   return -ENOMEM;
+   }
+
sg_set_buf(mem, buf, PAGE_SIZE << order);
-   BUG_ON(mem->offset);
sg_dma_len(mem) = PAGE_SIZE << order;
return 0;
 }
-- 
2.11.0


[PATCH for v4.9 LTS 06/87] ARM: dts: am57xx-idk: Put USB2 port in peripheral mode

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Roger Quadros 

[ Upstream commit 5acd016c88937be3667ba4e6b60f0f74455b5e80 ]

USB2 port can be operated in dual-role mode but till we
have dual-role support in dwc3 driver let's limit this
port to peripheral mode.

If we don't do so it defaults to host mode. USB1 port
is meant for host only operation and we don't want
both ports in host only mode.

Signed-off-by: Roger Quadros 
Signed-off-by: Tony Lindgren 
Signed-off-by: Sasha Levin 
---
 arch/arm/boot/dts/am57xx-idk-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi 
b/arch/arm/boot/dts/am57xx-idk-common.dtsi
index 03cec62260e1..db858fff4e18 100644
--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
@@ -294,7 +294,7 @@
 };
 
  {
-   dr_mode = "otg";
+   dr_mode = "peripheral";
 };
 
  {
-- 
2.11.0


[PATCH for v4.9 LTS 06/87] ARM: dts: am57xx-idk: Put USB2 port in peripheral mode

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Roger Quadros 

[ Upstream commit 5acd016c88937be3667ba4e6b60f0f74455b5e80 ]

USB2 port can be operated in dual-role mode but till we
have dual-role support in dwc3 driver let's limit this
port to peripheral mode.

If we don't do so it defaults to host mode. USB1 port
is meant for host only operation and we don't want
both ports in host only mode.

Signed-off-by: Roger Quadros 
Signed-off-by: Tony Lindgren 
Signed-off-by: Sasha Levin 
---
 arch/arm/boot/dts/am57xx-idk-common.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/arm/boot/dts/am57xx-idk-common.dtsi 
b/arch/arm/boot/dts/am57xx-idk-common.dtsi
index 03cec62260e1..db858fff4e18 100644
--- a/arch/arm/boot/dts/am57xx-idk-common.dtsi
+++ b/arch/arm/boot/dts/am57xx-idk-common.dtsi
@@ -294,7 +294,7 @@
 };
 
  {
-   dr_mode = "otg";
+   dr_mode = "peripheral";
 };
 
  {
-- 
2.11.0


[PATCH for v4.9 LTS 17/87] irqchip/keystone: Fix "scheduling while atomic" on rt

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: "Strashko, Grygorii" 

[ Upstream commit 2f884e6e688a0deb69e6c9552e51aef8b7e3f5f1 ]

The below call chain generates "scheduling while atomic" backtrace and
causes system crash when Keystone 2 IRQ chip driver is used with RT-kernel:

gic_handle_irq()
 |-__handle_domain_irq()
  |-generic_handle_irq()
   |-keystone_irq_handler()
|-regmap_read()
 |-regmap_lock_spinlock()
  |-rt_spin_lock()

The reason is that Keystone driver dispatches IRQ using chained IRQ handler
and accesses I/O memory through syscon->regmap(mmio) which is implemented
as fast_io regmap and uses regular spinlocks for synchronization, but
spinlocks transformed to rt_mutexes on RT.

Hence, convert Keystone 2 IRQ driver to use generic irq handler instead of
chained IRQ handler. This way it will be compatible with RT kernel where it
will be forced thread IRQ handler while in non-RT kernel it still will be
executed in HW IRQ context.

Cc: Suman Anna 
Signed-off-by: Grygorii Strashko 
Tested-by: Suman Anna 
Link: https://lkml.kernel.org/r/20161208233310.10329-1-grygorii.stras...@ti.com
Signed-off-by: Jason Cooper 
Signed-off-by: Sasha Levin 
---
 drivers/irqchip/irq-keystone.c | 28 +++-
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/irqchip/irq-keystone.c b/drivers/irqchip/irq-keystone.c
index 54a5e870a8f5..efbcf8435185 100644
--- a/drivers/irqchip/irq-keystone.c
+++ b/drivers/irqchip/irq-keystone.c
@@ -19,9 +19,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -39,6 +39,7 @@ struct keystone_irq_device {
struct irq_domain   *irqd;
struct regmap   *devctrl_regs;
u32 devctrl_offset;
+   raw_spinlock_t  wa_lock;
 };
 
 static inline u32 keystone_irq_readl(struct keystone_irq_device *kirq)
@@ -83,17 +84,15 @@ static void keystone_irq_ack(struct irq_data *d)
/* nothing to do here */
 }
 
-static void keystone_irq_handler(struct irq_desc *desc)
+static irqreturn_t keystone_irq_handler(int irq, void *keystone_irq)
 {
-   unsigned int irq = irq_desc_get_irq(desc);
-   struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc);
+   struct keystone_irq_device *kirq = keystone_irq;
+   unsigned long wa_lock_flags;
unsigned long pending;
int src, virq;
 
dev_dbg(kirq->dev, "start irq %d\n", irq);
 
-   chained_irq_enter(irq_desc_get_chip(desc), desc);
-
pending = keystone_irq_readl(kirq);
keystone_irq_writel(kirq, pending);
 
@@ -111,13 +110,15 @@ static void keystone_irq_handler(struct irq_desc *desc)
if (!virq)
dev_warn(kirq->dev, "spurious irq detected 
hwirq %d, virq %d\n",
 src, virq);
+   raw_spin_lock_irqsave(>wa_lock, wa_lock_flags);
generic_handle_irq(virq);
+   raw_spin_unlock_irqrestore(>wa_lock,
+  wa_lock_flags);
}
}
 
-   chained_irq_exit(irq_desc_get_chip(desc), desc);
-
dev_dbg(kirq->dev, "end irq %d\n", irq);
+   return IRQ_HANDLED;
 }
 
 static int keystone_irq_map(struct irq_domain *h, unsigned int virq,
@@ -182,9 +183,16 @@ static int keystone_irq_probe(struct platform_device *pdev)
return -ENODEV;
}
 
+   raw_spin_lock_init(>wa_lock);
+
platform_set_drvdata(pdev, kirq);
 
-   irq_set_chained_handler_and_data(kirq->irq, keystone_irq_handler, kirq);
+   ret = request_irq(kirq->irq, keystone_irq_handler,
+ 0, dev_name(dev), kirq);
+   if (ret) {
+   irq_domain_remove(kirq->irqd);
+   return ret;
+   }
 
/* clear all source bits */
keystone_irq_writel(kirq, ~0x0);
@@ -199,6 +207,8 @@ static int keystone_irq_remove(struct platform_device *pdev)
struct keystone_irq_device *kirq = platform_get_drvdata(pdev);
int hwirq;
 
+   free_irq(kirq->irq, kirq);
+
for (hwirq = 0; hwirq < KEYSTONE_N_IRQ; hwirq++)
irq_dispose_mapping(irq_find_mapping(kirq->irqd, hwirq));
 
-- 
2.11.0


[PATCH for v4.9 LTS 13/87] drm/msm: Ensure that the hardware write pointer is valid

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jordan Crouse 

[ Upstream commit 88b333b0ed790f9433ff542b163bf972953b74d3 ]

Currently the value written to CP_RB_WPTR is calculated on the fly as
(rb->next - rb->start). But as the code is designed rb->next is wrapped
before writing the commands so if a series of commands happened to
fit perfectly in the ringbuffer, rb->next would end up being equal to
rb->size / 4 and thus result in an out of bounds address to CP_RB_WPTR.

The easiest way to fix this is to mask WPTR when writing it to the
hardware; it makes the hardware happy and the rest of the ringbuffer
math appears to work and there isn't any point in upsetting anything.

Signed-off-by: Jordan Crouse 
[squash in is_power_of_2() check]
Signed-off-by: Rob Clark 

Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 9 -
 drivers/gpu/drm/msm/msm_ringbuffer.c| 3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index f386f463278d..a904082ed206 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -210,7 +210,14 @@ void adreno_submit(struct msm_gpu *gpu, struct 
msm_gem_submit *submit,
 void adreno_flush(struct msm_gpu *gpu)
 {
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
-   uint32_t wptr = get_wptr(gpu->rb);
+   uint32_t wptr;
+
+   /*
+* Mask wptr value that we calculate to fit in the HW range. This is
+* to account for the possibility that the last command fit exactly into
+* the ringbuffer and rb->next hasn't wrapped to zero yet
+*/
+   wptr = get_wptr(gpu->rb) & ((gpu->rb->size / 4) - 1);
 
/* ensure writes to ringbuffer have hit system memory: */
mb();
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c 
b/drivers/gpu/drm/msm/msm_ringbuffer.c
index f326cf6a32e6..67b34e069abf 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.c
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
@@ -23,7 +23,8 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu 
*gpu, int size)
struct msm_ringbuffer *ring;
int ret;
 
-   size = ALIGN(size, 4);   /* size should be dword aligned */
+   if (WARN_ON(!is_power_of_2(size)))
+   return ERR_PTR(-EINVAL);
 
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
if (!ring) {
-- 
2.11.0


[PATCH for v4.9 LTS 17/87] irqchip/keystone: Fix "scheduling while atomic" on rt

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: "Strashko, Grygorii" 

[ Upstream commit 2f884e6e688a0deb69e6c9552e51aef8b7e3f5f1 ]

The below call chain generates "scheduling while atomic" backtrace and
causes system crash when Keystone 2 IRQ chip driver is used with RT-kernel:

gic_handle_irq()
 |-__handle_domain_irq()
  |-generic_handle_irq()
   |-keystone_irq_handler()
|-regmap_read()
 |-regmap_lock_spinlock()
  |-rt_spin_lock()

The reason is that Keystone driver dispatches IRQ using chained IRQ handler
and accesses I/O memory through syscon->regmap(mmio) which is implemented
as fast_io regmap and uses regular spinlocks for synchronization, but
spinlocks transformed to rt_mutexes on RT.

Hence, convert Keystone 2 IRQ driver to use generic irq handler instead of
chained IRQ handler. This way it will be compatible with RT kernel where it
will be forced thread IRQ handler while in non-RT kernel it still will be
executed in HW IRQ context.

Cc: Suman Anna 
Signed-off-by: Grygorii Strashko 
Tested-by: Suman Anna 
Link: https://lkml.kernel.org/r/20161208233310.10329-1-grygorii.stras...@ti.com
Signed-off-by: Jason Cooper 
Signed-off-by: Sasha Levin 
---
 drivers/irqchip/irq-keystone.c | 28 +++-
 1 file changed, 19 insertions(+), 9 deletions(-)

diff --git a/drivers/irqchip/irq-keystone.c b/drivers/irqchip/irq-keystone.c
index 54a5e870a8f5..efbcf8435185 100644
--- a/drivers/irqchip/irq-keystone.c
+++ b/drivers/irqchip/irq-keystone.c
@@ -19,9 +19,9 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
-#include 
 #include 
 #include 
 #include 
@@ -39,6 +39,7 @@ struct keystone_irq_device {
struct irq_domain   *irqd;
struct regmap   *devctrl_regs;
u32 devctrl_offset;
+   raw_spinlock_t  wa_lock;
 };
 
 static inline u32 keystone_irq_readl(struct keystone_irq_device *kirq)
@@ -83,17 +84,15 @@ static void keystone_irq_ack(struct irq_data *d)
/* nothing to do here */
 }
 
-static void keystone_irq_handler(struct irq_desc *desc)
+static irqreturn_t keystone_irq_handler(int irq, void *keystone_irq)
 {
-   unsigned int irq = irq_desc_get_irq(desc);
-   struct keystone_irq_device *kirq = irq_desc_get_handler_data(desc);
+   struct keystone_irq_device *kirq = keystone_irq;
+   unsigned long wa_lock_flags;
unsigned long pending;
int src, virq;
 
dev_dbg(kirq->dev, "start irq %d\n", irq);
 
-   chained_irq_enter(irq_desc_get_chip(desc), desc);
-
pending = keystone_irq_readl(kirq);
keystone_irq_writel(kirq, pending);
 
@@ -111,13 +110,15 @@ static void keystone_irq_handler(struct irq_desc *desc)
if (!virq)
dev_warn(kirq->dev, "spurious irq detected 
hwirq %d, virq %d\n",
 src, virq);
+   raw_spin_lock_irqsave(>wa_lock, wa_lock_flags);
generic_handle_irq(virq);
+   raw_spin_unlock_irqrestore(>wa_lock,
+  wa_lock_flags);
}
}
 
-   chained_irq_exit(irq_desc_get_chip(desc), desc);
-
dev_dbg(kirq->dev, "end irq %d\n", irq);
+   return IRQ_HANDLED;
 }
 
 static int keystone_irq_map(struct irq_domain *h, unsigned int virq,
@@ -182,9 +183,16 @@ static int keystone_irq_probe(struct platform_device *pdev)
return -ENODEV;
}
 
+   raw_spin_lock_init(>wa_lock);
+
platform_set_drvdata(pdev, kirq);
 
-   irq_set_chained_handler_and_data(kirq->irq, keystone_irq_handler, kirq);
+   ret = request_irq(kirq->irq, keystone_irq_handler,
+ 0, dev_name(dev), kirq);
+   if (ret) {
+   irq_domain_remove(kirq->irqd);
+   return ret;
+   }
 
/* clear all source bits */
keystone_irq_writel(kirq, ~0x0);
@@ -199,6 +207,8 @@ static int keystone_irq_remove(struct platform_device *pdev)
struct keystone_irq_device *kirq = platform_get_drvdata(pdev);
int hwirq;
 
+   free_irq(kirq->irq, kirq);
+
for (hwirq = 0; hwirq < KEYSTONE_N_IRQ; hwirq++)
irq_dispose_mapping(irq_find_mapping(kirq->irqd, hwirq));
 
-- 
2.11.0


[PATCH for v4.9 LTS 13/87] drm/msm: Ensure that the hardware write pointer is valid

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jordan Crouse 

[ Upstream commit 88b333b0ed790f9433ff542b163bf972953b74d3 ]

Currently the value written to CP_RB_WPTR is calculated on the fly as
(rb->next - rb->start). But as the code is designed rb->next is wrapped
before writing the commands so if a series of commands happened to
fit perfectly in the ringbuffer, rb->next would end up being equal to
rb->size / 4 and thus result in an out of bounds address to CP_RB_WPTR.

The easiest way to fix this is to mask WPTR when writing it to the
hardware; it makes the hardware happy and the rest of the ringbuffer
math appears to work and there isn't any point in upsetting anything.

Signed-off-by: Jordan Crouse 
[squash in is_power_of_2() check]
Signed-off-by: Rob Clark 

Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 9 -
 drivers/gpu/drm/msm/msm_ringbuffer.c| 3 ++-
 2 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c 
b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index f386f463278d..a904082ed206 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -210,7 +210,14 @@ void adreno_submit(struct msm_gpu *gpu, struct 
msm_gem_submit *submit,
 void adreno_flush(struct msm_gpu *gpu)
 {
struct adreno_gpu *adreno_gpu = to_adreno_gpu(gpu);
-   uint32_t wptr = get_wptr(gpu->rb);
+   uint32_t wptr;
+
+   /*
+* Mask wptr value that we calculate to fit in the HW range. This is
+* to account for the possibility that the last command fit exactly into
+* the ringbuffer and rb->next hasn't wrapped to zero yet
+*/
+   wptr = get_wptr(gpu->rb) & ((gpu->rb->size / 4) - 1);
 
/* ensure writes to ringbuffer have hit system memory: */
mb();
diff --git a/drivers/gpu/drm/msm/msm_ringbuffer.c 
b/drivers/gpu/drm/msm/msm_ringbuffer.c
index f326cf6a32e6..67b34e069abf 100644
--- a/drivers/gpu/drm/msm/msm_ringbuffer.c
+++ b/drivers/gpu/drm/msm/msm_ringbuffer.c
@@ -23,7 +23,8 @@ struct msm_ringbuffer *msm_ringbuffer_new(struct msm_gpu 
*gpu, int size)
struct msm_ringbuffer *ring;
int ret;
 
-   size = ALIGN(size, 4);   /* size should be dword aligned */
+   if (WARN_ON(!is_power_of_2(size)))
+   return ERR_PTR(-EINVAL);
 
ring = kzalloc(sizeof(*ring), GFP_KERNEL);
if (!ring) {
-- 
2.11.0


[PATCH for v4.9 LTS 01/87] x86/mce/AMD: Make the init code more robust

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Thomas Gleixner 

[ Upstream commit 0dad3a3014a0b9e72521ff44f17e0054f43dcdea ]

If mce_device_init() fails then the mce device pointer is NULL and the
AMD mce code happily dereferences it.

Add a sanity check.

Reported-by: Markus Trippelsdorf 
Reported-by: Boris Ostrovsky 
Signed-off-by: Thomas Gleixner 
Signed-off-by: Linus Torvalds 
Signed-off-by: Sasha Levin 
---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c 
b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 3dfca7b302dc..a5b47c1361a0 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -955,6 +955,9 @@ static int threshold_create_bank(unsigned int cpu, unsigned 
int bank)
const char *name = get_name(bank, NULL);
int err = 0;
 
+   if (!dev)
+   return -ENODEV;
+
if (is_shared_bank(bank)) {
nb = node_to_amd_nb(amd_get_nb_id(cpu));
 
-- 
2.11.0


[PATCH for v4.9 LTS 01/87] x86/mce/AMD: Make the init code more robust

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Thomas Gleixner 

[ Upstream commit 0dad3a3014a0b9e72521ff44f17e0054f43dcdea ]

If mce_device_init() fails then the mce device pointer is NULL and the
AMD mce code happily dereferences it.

Add a sanity check.

Reported-by: Markus Trippelsdorf 
Reported-by: Boris Ostrovsky 
Signed-off-by: Thomas Gleixner 
Signed-off-by: Linus Torvalds 
Signed-off-by: Sasha Levin 
---
 arch/x86/kernel/cpu/mcheck/mce_amd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c 
b/arch/x86/kernel/cpu/mcheck/mce_amd.c
index 3dfca7b302dc..a5b47c1361a0 100644
--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c
+++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c
@@ -955,6 +955,9 @@ static int threshold_create_bank(unsigned int cpu, unsigned 
int bank)
const char *name = get_name(bank, NULL);
int err = 0;
 
+   if (!dev)
+   return -ENODEV;
+
if (is_shared_bank(bank)) {
nb = node_to_amd_nb(amd_get_nb_id(cpu));
 
-- 
2.11.0


[PATCH for v4.9 LTS 12/87] net/mlx4_core: Fix raw qp flow steering rules under SRIOV

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jack Morgenstein 

[ Upstream commit 10b1c04e92229ebeb38ccd0dcf2b6d3ec73c0575 ]

Demoting simple flow steering rule priority (for DPDK) was achieved by
wrapping FW commands MLX4_QP_FLOW_STEERING_ATTACH/DETACH for the PF
as well, and forcing the priority to MLX4_DOMAIN_NIC in the wrapper
function for the PF and all VFs.

In function mlx4_ib_create_flow(), this change caused the main rule
creation for the PF to be wrapped, while it left the associated
tunnel steering rule creation unwrapped for the PF.

This mismatch caused rule deletion failures in mlx4_ib_destroy_flow()
for the PF when the detach wrapper function did not find the associated
tunnel-steering rule (since creation of that rule for the PF did not
go through the wrapper function).

Fix this by setting MLX4_QP_FLOW_STEERING_ATTACH/DETACH to be "native"
(so that the PF invocation does not go through the wrapper), and perform
the required priority demotion for the PF in the mlx4_ib_create_flow()
code path.

Fixes: 48564135cba8 ("net/mlx4_core: Demote simple multicast and broadcast flow 
steering rules")
Signed-off-by: Jack Morgenstein 
Signed-off-by: Tariq Toukan 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/infiniband/hw/mlx4/main.c  | 14 --
 drivers/net/ethernet/mellanox/mlx4/main.c  | 18 ++
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  | 22 +-
 include/linux/mlx4/device.h|  2 ++
 4 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c 
b/drivers/infiniband/hw/mlx4/main.c
index f2a885eee4bb..8059b7eaf3a8 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1680,9 +1680,19 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, 
struct ib_flow_attr *flow_att
size += ret;
}
 
+   if (mlx4_is_master(mdev->dev) && flow_type == MLX4_FS_REGULAR &&
+   flow_attr->num_of_specs == 1) {
+   struct _rule_hw *rule_header = (struct _rule_hw *)(ctrl + 1);
+   enum ib_flow_spec_type header_spec =
+   ((union ib_flow_spec *)(flow_attr + 1))->type;
+
+   if (header_spec == IB_FLOW_SPEC_ETH)
+   mlx4_handle_eth_header_mcast_prio(ctrl, rule_header);
+   }
+
ret = mlx4_cmd_imm(mdev->dev, mailbox->dma, reg_id, size >> 2, 0,
   MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A,
-  MLX4_CMD_WRAPPED);
+  MLX4_CMD_NATIVE);
if (ret == -ENOMEM)
pr_err("mcg table is full. Fail to register network rule.\n");
else if (ret == -ENXIO)
@@ -1699,7 +1709,7 @@ static int __mlx4_ib_destroy_flow(struct mlx4_dev *dev, 
u64 reg_id)
int err;
err = mlx4_cmd(dev, reg_id, 0, 0,
   MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A,
-  MLX4_CMD_WRAPPED);
+  MLX4_CMD_NATIVE);
if (err)
pr_err("Fail to detach network rule. registration id = 
0x%llx\n",
   reg_id);
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c 
b/drivers/net/ethernet/mellanox/mlx4/main.c
index b2ca8a635b2e..551786f58e59 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -782,6 +783,23 @@ int mlx4_is_slave_active(struct mlx4_dev *dev, int slave)
 }
 EXPORT_SYMBOL(mlx4_is_slave_active);
 
+void mlx4_handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl 
*ctrl,
+  struct _rule_hw *eth_header)
+{
+   if (is_multicast_ether_addr(eth_header->eth.dst_mac) ||
+   is_broadcast_ether_addr(eth_header->eth.dst_mac)) {
+   struct mlx4_net_trans_rule_hw_eth *eth =
+   (struct mlx4_net_trans_rule_hw_eth *)eth_header;
+   struct _rule_hw *next_rule = (struct _rule_hw *)(eth + 1);
+   bool last_rule = next_rule->size == 0 && next_rule->id == 0 &&
+   next_rule->rsvd == 0;
+
+   if (last_rule)
+   ctrl->prio = cpu_to_be16(MLX4_DOMAIN_NIC);
+   }
+}
+EXPORT_SYMBOL(mlx4_handle_eth_header_mcast_prio);
+
 static void slave_adjust_steering_mode(struct mlx4_dev *dev,
   struct mlx4_dev_cap *dev_cap,
   struct mlx4_init_hca_param *hca_param)
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c 
b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index f1eb74a61bce..1822382212ee 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ 

[PATCH for v4.9 LTS 12/87] net/mlx4_core: Fix raw qp flow steering rules under SRIOV

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jack Morgenstein 

[ Upstream commit 10b1c04e92229ebeb38ccd0dcf2b6d3ec73c0575 ]

Demoting simple flow steering rule priority (for DPDK) was achieved by
wrapping FW commands MLX4_QP_FLOW_STEERING_ATTACH/DETACH for the PF
as well, and forcing the priority to MLX4_DOMAIN_NIC in the wrapper
function for the PF and all VFs.

In function mlx4_ib_create_flow(), this change caused the main rule
creation for the PF to be wrapped, while it left the associated
tunnel steering rule creation unwrapped for the PF.

This mismatch caused rule deletion failures in mlx4_ib_destroy_flow()
for the PF when the detach wrapper function did not find the associated
tunnel-steering rule (since creation of that rule for the PF did not
go through the wrapper function).

Fix this by setting MLX4_QP_FLOW_STEERING_ATTACH/DETACH to be "native"
(so that the PF invocation does not go through the wrapper), and perform
the required priority demotion for the PF in the mlx4_ib_create_flow()
code path.

Fixes: 48564135cba8 ("net/mlx4_core: Demote simple multicast and broadcast flow 
steering rules")
Signed-off-by: Jack Morgenstein 
Signed-off-by: Tariq Toukan 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/infiniband/hw/mlx4/main.c  | 14 --
 drivers/net/ethernet/mellanox/mlx4/main.c  | 18 ++
 .../net/ethernet/mellanox/mlx4/resource_tracker.c  | 22 +-
 include/linux/mlx4/device.h|  2 ++
 4 files changed, 33 insertions(+), 23 deletions(-)

diff --git a/drivers/infiniband/hw/mlx4/main.c 
b/drivers/infiniband/hw/mlx4/main.c
index f2a885eee4bb..8059b7eaf3a8 100644
--- a/drivers/infiniband/hw/mlx4/main.c
+++ b/drivers/infiniband/hw/mlx4/main.c
@@ -1680,9 +1680,19 @@ static int __mlx4_ib_create_flow(struct ib_qp *qp, 
struct ib_flow_attr *flow_att
size += ret;
}
 
+   if (mlx4_is_master(mdev->dev) && flow_type == MLX4_FS_REGULAR &&
+   flow_attr->num_of_specs == 1) {
+   struct _rule_hw *rule_header = (struct _rule_hw *)(ctrl + 1);
+   enum ib_flow_spec_type header_spec =
+   ((union ib_flow_spec *)(flow_attr + 1))->type;
+
+   if (header_spec == IB_FLOW_SPEC_ETH)
+   mlx4_handle_eth_header_mcast_prio(ctrl, rule_header);
+   }
+
ret = mlx4_cmd_imm(mdev->dev, mailbox->dma, reg_id, size >> 2, 0,
   MLX4_QP_FLOW_STEERING_ATTACH, MLX4_CMD_TIME_CLASS_A,
-  MLX4_CMD_WRAPPED);
+  MLX4_CMD_NATIVE);
if (ret == -ENOMEM)
pr_err("mcg table is full. Fail to register network rule.\n");
else if (ret == -ENXIO)
@@ -1699,7 +1709,7 @@ static int __mlx4_ib_destroy_flow(struct mlx4_dev *dev, 
u64 reg_id)
int err;
err = mlx4_cmd(dev, reg_id, 0, 0,
   MLX4_QP_FLOW_STEERING_DETACH, MLX4_CMD_TIME_CLASS_A,
-  MLX4_CMD_WRAPPED);
+  MLX4_CMD_NATIVE);
if (err)
pr_err("Fail to detach network rule. registration id = 
0x%llx\n",
   reg_id);
diff --git a/drivers/net/ethernet/mellanox/mlx4/main.c 
b/drivers/net/ethernet/mellanox/mlx4/main.c
index b2ca8a635b2e..551786f58e59 100644
--- a/drivers/net/ethernet/mellanox/mlx4/main.c
+++ b/drivers/net/ethernet/mellanox/mlx4/main.c
@@ -42,6 +42,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 
 #include 
@@ -782,6 +783,23 @@ int mlx4_is_slave_active(struct mlx4_dev *dev, int slave)
 }
 EXPORT_SYMBOL(mlx4_is_slave_active);
 
+void mlx4_handle_eth_header_mcast_prio(struct mlx4_net_trans_rule_hw_ctrl 
*ctrl,
+  struct _rule_hw *eth_header)
+{
+   if (is_multicast_ether_addr(eth_header->eth.dst_mac) ||
+   is_broadcast_ether_addr(eth_header->eth.dst_mac)) {
+   struct mlx4_net_trans_rule_hw_eth *eth =
+   (struct mlx4_net_trans_rule_hw_eth *)eth_header;
+   struct _rule_hw *next_rule = (struct _rule_hw *)(eth + 1);
+   bool last_rule = next_rule->size == 0 && next_rule->id == 0 &&
+   next_rule->rsvd == 0;
+
+   if (last_rule)
+   ctrl->prio = cpu_to_be16(MLX4_DOMAIN_NIC);
+   }
+}
+EXPORT_SYMBOL(mlx4_handle_eth_header_mcast_prio);
+
 static void slave_adjust_steering_mode(struct mlx4_dev *dev,
   struct mlx4_dev_cap *dev_cap,
   struct mlx4_init_hca_param *hca_param)
diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c 
b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
index f1eb74a61bce..1822382212ee 100644
--- a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
+++ b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c
@@ -4165,22 +4165,6 @@ static int validate_eth_header_mac(int slave, struct 
_rule_hw 

[PATCH for v4.9 LTS 20/87] ASoC: nau8825: fix invalid configuration in Pre-Scalar of FLL

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: John Hsu 

[ Upstream commit a1792cda51300e15b03549cccf0b09f3be82e697 ]

The clk_ref_div is not configured in the correct position of the
register. The patch fixes that clk_ref_div, Pre-Scalar, is assigned
the wrong value.

Signed-off-by: John Hsu 
Signed-off-by: Mark Brown 
Signed-off-by: Sasha Levin 
---
 sound/soc/codecs/nau8825.c | 3 ++-
 sound/soc/codecs/nau8825.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index e643be91d762..f9f2737c4ad2 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1928,7 +1928,8 @@ static void nau8825_fll_apply(struct nau8825 *nau8825,
NAU8825_FLL_INTEGER_MASK, fll_param->fll_int);
/* FLL pre-scaler */
regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL4,
-   NAU8825_FLL_REF_DIV_MASK, fll_param->clk_ref_div);
+   NAU8825_FLL_REF_DIV_MASK,
+   fll_param->clk_ref_div << NAU8825_FLL_REF_DIV_SFT);
/* select divided VCO input */
regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5,
NAU8825_FLL_CLK_SW_MASK, NAU8825_FLL_CLK_SW_REF);
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 1c63e2abafa9..574d6f936135 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -129,7 +129,8 @@
 #define NAU8825_FLL_CLK_SRC_FS (0x3 << NAU8825_FLL_CLK_SRC_SFT)
 
 /* FLL4 (0x07) */
-#define NAU8825_FLL_REF_DIV_MASK   (0x3 << 10)
+#define NAU8825_FLL_REF_DIV_SFT10
+#define NAU8825_FLL_REF_DIV_MASK   (0x3 << NAU8825_FLL_REF_DIV_SFT)
 
 /* FLL5 (0x08) */
 #define NAU8825_FLL_PDB_DAC_EN (0x1 << 15)
-- 
2.11.0


[PATCH for v4.9 LTS 20/87] ASoC: nau8825: fix invalid configuration in Pre-Scalar of FLL

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: John Hsu 

[ Upstream commit a1792cda51300e15b03549cccf0b09f3be82e697 ]

The clk_ref_div is not configured in the correct position of the
register. The patch fixes that clk_ref_div, Pre-Scalar, is assigned
the wrong value.

Signed-off-by: John Hsu 
Signed-off-by: Mark Brown 
Signed-off-by: Sasha Levin 
---
 sound/soc/codecs/nau8825.c | 3 ++-
 sound/soc/codecs/nau8825.h | 3 ++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/soc/codecs/nau8825.c b/sound/soc/codecs/nau8825.c
index e643be91d762..f9f2737c4ad2 100644
--- a/sound/soc/codecs/nau8825.c
+++ b/sound/soc/codecs/nau8825.c
@@ -1928,7 +1928,8 @@ static void nau8825_fll_apply(struct nau8825 *nau8825,
NAU8825_FLL_INTEGER_MASK, fll_param->fll_int);
/* FLL pre-scaler */
regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL4,
-   NAU8825_FLL_REF_DIV_MASK, fll_param->clk_ref_div);
+   NAU8825_FLL_REF_DIV_MASK,
+   fll_param->clk_ref_div << NAU8825_FLL_REF_DIV_SFT);
/* select divided VCO input */
regmap_update_bits(nau8825->regmap, NAU8825_REG_FLL5,
NAU8825_FLL_CLK_SW_MASK, NAU8825_FLL_CLK_SW_REF);
diff --git a/sound/soc/codecs/nau8825.h b/sound/soc/codecs/nau8825.h
index 1c63e2abafa9..574d6f936135 100644
--- a/sound/soc/codecs/nau8825.h
+++ b/sound/soc/codecs/nau8825.h
@@ -129,7 +129,8 @@
 #define NAU8825_FLL_CLK_SRC_FS (0x3 << NAU8825_FLL_CLK_SRC_SFT)
 
 /* FLL4 (0x07) */
-#define NAU8825_FLL_REF_DIV_MASK   (0x3 << 10)
+#define NAU8825_FLL_REF_DIV_SFT10
+#define NAU8825_FLL_REF_DIV_MASK   (0x3 << NAU8825_FLL_REF_DIV_SFT)
 
 /* FLL5 (0x08) */
 #define NAU8825_FLL_PDB_DAC_EN (0x1 << 15)
-- 
2.11.0


[PATCH for v4.9 LTS 23/87] dmaengine: ioatdma: Add Skylake PCI Dev ID

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Dave Jiang 

[ Upstream commit 1594c18fd297a8edcc72bc4b161f3f52603ebb92 ]

Adding Skylake Xeon PCI device ids for ioatdma and related bits.

Signed-off-by: Dave Jiang 
Signed-off-by: Vinod Koul 
Signed-off-by: Sasha Levin 
---
 drivers/dma/ioat/hw.h   | 2 ++
 drivers/dma/ioat/init.c | 9 -
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/ioat/hw.h b/drivers/dma/ioat/hw.h
index 8e67895bcca3..abcc51b343ce 100644
--- a/drivers/dma/ioat/hw.h
+++ b/drivers/dma/ioat/hw.h
@@ -64,6 +64,8 @@
 #define PCI_DEVICE_ID_INTEL_IOAT_BDX8  0x6f2e
 #define PCI_DEVICE_ID_INTEL_IOAT_BDX9  0x6f2f
 
+#define PCI_DEVICE_ID_INTEL_IOAT_SKX   0x2021
+
 #define IOAT_VER_1_20x12/* Version 1.2 */
 #define IOAT_VER_2_00x20/* Version 2.0 */
 #define IOAT_VER_3_00x30/* Version 3.0 */
diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index d235fbe2564f..b45b0363f7f6 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -106,6 +106,8 @@ static struct pci_device_id ioat_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX8) },
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX9) },
 
+   { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_SKX) },
+
/* I/OAT v3.3 platforms */
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD0) },
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD1) },
@@ -243,10 +245,15 @@ static bool is_bdx_ioat(struct pci_dev *pdev)
}
 }
 
+static inline bool is_skx_ioat(struct pci_dev *pdev)
+{
+   return (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_SKX) ? true : false;
+}
+
 static bool is_xeon_cb32(struct pci_dev *pdev)
 {
return is_jf_ioat(pdev) || is_snb_ioat(pdev) || is_ivb_ioat(pdev) ||
-   is_hsw_ioat(pdev) || is_bdx_ioat(pdev);
+   is_hsw_ioat(pdev) || is_bdx_ioat(pdev) || is_skx_ioat(pdev);
 }
 
 bool is_bwd_ioat(struct pci_dev *pdev)
-- 
2.11.0


[PATCH for v4.9 LTS 23/87] dmaengine: ioatdma: Add Skylake PCI Dev ID

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Dave Jiang 

[ Upstream commit 1594c18fd297a8edcc72bc4b161f3f52603ebb92 ]

Adding Skylake Xeon PCI device ids for ioatdma and related bits.

Signed-off-by: Dave Jiang 
Signed-off-by: Vinod Koul 
Signed-off-by: Sasha Levin 
---
 drivers/dma/ioat/hw.h   | 2 ++
 drivers/dma/ioat/init.c | 9 -
 2 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/dma/ioat/hw.h b/drivers/dma/ioat/hw.h
index 8e67895bcca3..abcc51b343ce 100644
--- a/drivers/dma/ioat/hw.h
+++ b/drivers/dma/ioat/hw.h
@@ -64,6 +64,8 @@
 #define PCI_DEVICE_ID_INTEL_IOAT_BDX8  0x6f2e
 #define PCI_DEVICE_ID_INTEL_IOAT_BDX9  0x6f2f
 
+#define PCI_DEVICE_ID_INTEL_IOAT_SKX   0x2021
+
 #define IOAT_VER_1_20x12/* Version 1.2 */
 #define IOAT_VER_2_00x20/* Version 2.0 */
 #define IOAT_VER_3_00x30/* Version 3.0 */
diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index d235fbe2564f..b45b0363f7f6 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -106,6 +106,8 @@ static struct pci_device_id ioat_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX8) },
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BDX9) },
 
+   { PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_SKX) },
+
/* I/OAT v3.3 platforms */
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD0) },
{ PCI_VDEVICE(INTEL, PCI_DEVICE_ID_INTEL_IOAT_BWD1) },
@@ -243,10 +245,15 @@ static bool is_bdx_ioat(struct pci_dev *pdev)
}
 }
 
+static inline bool is_skx_ioat(struct pci_dev *pdev)
+{
+   return (pdev->device == PCI_DEVICE_ID_INTEL_IOAT_SKX) ? true : false;
+}
+
 static bool is_xeon_cb32(struct pci_dev *pdev)
 {
return is_jf_ioat(pdev) || is_snb_ioat(pdev) || is_ivb_ioat(pdev) ||
-   is_hsw_ioat(pdev) || is_bdx_ioat(pdev);
+   is_hsw_ioat(pdev) || is_bdx_ioat(pdev) || is_skx_ioat(pdev);
 }
 
 bool is_bwd_ioat(struct pci_dev *pdev)
-- 
2.11.0


[PATCH for v4.9 LTS 21/87] irqchip/mxs: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Stefan Wahren 

[ Upstream commit 88e20c74ee020f9e0c99dfce0dd9aa61c3f0cca0 ]

The ICOLL controller doesn't provide any facility to configure the
wakeup sources. That's the reason why this implementation lacks
the irq_set_wake implementation. But this prevent us from properly
entering power management states like "suspend to idle".

So enable the flags IRQCHIP_SKIP_SET_WAKE and
IRQCHIP_MASK_ON_SUSPEND to let the irqchip core allows and handles
the power management.

Signed-off-by: Stefan Wahren 
Reviewed-by: Fabio Estevam 
Link: 
https://lkml.kernel.org/r/1482863397-11400-1-git-send-email-stefan.wah...@i2se.com
Signed-off-by: Jason Cooper 
Signed-off-by: Sasha Levin 
---
 drivers/irqchip/irq-mxs.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c
index 17304705f2cf..05fa9f7af53c 100644
--- a/drivers/irqchip/irq-mxs.c
+++ b/drivers/irqchip/irq-mxs.c
@@ -131,12 +131,16 @@ static struct irq_chip mxs_icoll_chip = {
.irq_ack = icoll_ack_irq,
.irq_mask = icoll_mask_irq,
.irq_unmask = icoll_unmask_irq,
+   .flags = IRQCHIP_MASK_ON_SUSPEND |
+IRQCHIP_SKIP_SET_WAKE,
 };
 
 static struct irq_chip asm9260_icoll_chip = {
.irq_ack = icoll_ack_irq,
.irq_mask = asm9260_mask_irq,
.irq_unmask = asm9260_unmask_irq,
+   .flags = IRQCHIP_MASK_ON_SUSPEND |
+IRQCHIP_SKIP_SET_WAKE,
 };
 
 asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)
-- 
2.11.0


[PATCH for v4.9 LTS 24/87] dmaengine: ioatdma: workaround SKX ioatdma version

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Dave Jiang 

[ Upstream commit 34a31f0af84158955a9747fb5c6712da5bbb5331 ]

The Skylake ioatdma is technically CBDMA 3.2+ and contains the same hardware
bits with some additional 3.3 features, but it's not really 3.3 where the
driver is concerned.

Signed-off-by: Dave Jiang 
Signed-off-by: Vinod Koul 
Signed-off-by: Sasha Levin 
---
 drivers/dma/ioat/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index b45b0363f7f6..0dea6d55f0ff 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -1357,6 +1357,8 @@ static int ioat_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *id)
 
device->version = readb(device->reg_base + IOAT_VER_OFFSET);
if (device->version >= IOAT_VER_3_0) {
+   if (is_skx_ioat(pdev))
+   device->version = IOAT_VER_3_2;
err = ioat3_dma_probe(device, ioat_dca_enabled);
 
if (device->version >= IOAT_VER_3_3)
-- 
2.11.0


[PATCH for v4.9 LTS 21/87] irqchip/mxs: Enable SKIP_SET_WAKE and MASK_ON_SUSPEND

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Stefan Wahren 

[ Upstream commit 88e20c74ee020f9e0c99dfce0dd9aa61c3f0cca0 ]

The ICOLL controller doesn't provide any facility to configure the
wakeup sources. That's the reason why this implementation lacks
the irq_set_wake implementation. But this prevent us from properly
entering power management states like "suspend to idle".

So enable the flags IRQCHIP_SKIP_SET_WAKE and
IRQCHIP_MASK_ON_SUSPEND to let the irqchip core allows and handles
the power management.

Signed-off-by: Stefan Wahren 
Reviewed-by: Fabio Estevam 
Link: 
https://lkml.kernel.org/r/1482863397-11400-1-git-send-email-stefan.wah...@i2se.com
Signed-off-by: Jason Cooper 
Signed-off-by: Sasha Levin 
---
 drivers/irqchip/irq-mxs.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/drivers/irqchip/irq-mxs.c b/drivers/irqchip/irq-mxs.c
index 17304705f2cf..05fa9f7af53c 100644
--- a/drivers/irqchip/irq-mxs.c
+++ b/drivers/irqchip/irq-mxs.c
@@ -131,12 +131,16 @@ static struct irq_chip mxs_icoll_chip = {
.irq_ack = icoll_ack_irq,
.irq_mask = icoll_mask_irq,
.irq_unmask = icoll_unmask_irq,
+   .flags = IRQCHIP_MASK_ON_SUSPEND |
+IRQCHIP_SKIP_SET_WAKE,
 };
 
 static struct irq_chip asm9260_icoll_chip = {
.irq_ack = icoll_ack_irq,
.irq_mask = asm9260_mask_irq,
.irq_unmask = asm9260_unmask_irq,
+   .flags = IRQCHIP_MASK_ON_SUSPEND |
+IRQCHIP_SKIP_SET_WAKE,
 };
 
 asmlinkage void __exception_irq_entry icoll_handle_irq(struct pt_regs *regs)
-- 
2.11.0


[PATCH for v4.9 LTS 24/87] dmaengine: ioatdma: workaround SKX ioatdma version

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Dave Jiang 

[ Upstream commit 34a31f0af84158955a9747fb5c6712da5bbb5331 ]

The Skylake ioatdma is technically CBDMA 3.2+ and contains the same hardware
bits with some additional 3.3 features, but it's not really 3.3 where the
driver is concerned.

Signed-off-by: Dave Jiang 
Signed-off-by: Vinod Koul 
Signed-off-by: Sasha Levin 
---
 drivers/dma/ioat/init.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/dma/ioat/init.c b/drivers/dma/ioat/init.c
index b45b0363f7f6..0dea6d55f0ff 100644
--- a/drivers/dma/ioat/init.c
+++ b/drivers/dma/ioat/init.c
@@ -1357,6 +1357,8 @@ static int ioat_pci_probe(struct pci_dev *pdev, const 
struct pci_device_id *id)
 
device->version = readb(device->reg_base + IOAT_VER_OFFSET);
if (device->version >= IOAT_VER_3_0) {
+   if (is_skx_ioat(pdev))
+   device->version = IOAT_VER_3_2;
err = ioat3_dma_probe(device, ioat_dca_enabled);
 
if (device->version >= IOAT_VER_3_3)
-- 
2.11.0


[PATCH for v4.9 LTS 25/87] l2tp: consider '::' as wildcard address in l2tp_ip6 socket lookup

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Guillaume Nault 

[ Upstream commit 97b84fd6d91766ea57dcc350d78f42639e011c30 ]

An L2TP socket bound to the unspecified address should match with any
address. If not, it can't receive any packet and __l2tp_ip6_bind_lookup()
can't prevent another socket from binding on the same device/tunnel ID.

While there, rename the 'addr' variable to 'sk_laddr' (local addr), to
make following patch clearer.

Signed-off-by: Guillaume Nault 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 net/l2tp/l2tp_ip6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
index b10abef6b0a0..1d522ce833e6 100644
--- a/net/l2tp/l2tp_ip6.c
+++ b/net/l2tp/l2tp_ip6.c
@@ -64,7 +64,7 @@ static struct sock *__l2tp_ip6_bind_lookup(struct net *net,
struct sock *sk;
 
sk_for_each_bound(sk, _ip6_bind_table) {
-   const struct in6_addr *addr = inet6_rcv_saddr(sk);
+   const struct in6_addr *sk_laddr = inet6_rcv_saddr(sk);
struct l2tp_ip6_sock *l2tp = l2tp_ip6_sk(sk);
 
if (l2tp == NULL)
@@ -72,7 +72,7 @@ static struct sock *__l2tp_ip6_bind_lookup(struct net *net,
 
if ((l2tp->conn_id == tunnel_id) &&
net_eq(sock_net(sk), net) &&
-   (!addr || ipv6_addr_equal(addr, laddr)) &&
+   (!sk_laddr || ipv6_addr_any(sk_laddr) || 
ipv6_addr_equal(sk_laddr, laddr)) &&
(!sk->sk_bound_dev_if || !dif ||
 sk->sk_bound_dev_if == dif))
goto found;
-- 
2.11.0


[PATCH for v4.9 LTS 25/87] l2tp: consider '::' as wildcard address in l2tp_ip6 socket lookup

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Guillaume Nault 

[ Upstream commit 97b84fd6d91766ea57dcc350d78f42639e011c30 ]

An L2TP socket bound to the unspecified address should match with any
address. If not, it can't receive any packet and __l2tp_ip6_bind_lookup()
can't prevent another socket from binding on the same device/tunnel ID.

While there, rename the 'addr' variable to 'sk_laddr' (local addr), to
make following patch clearer.

Signed-off-by: Guillaume Nault 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 net/l2tp/l2tp_ip6.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c
index b10abef6b0a0..1d522ce833e6 100644
--- a/net/l2tp/l2tp_ip6.c
+++ b/net/l2tp/l2tp_ip6.c
@@ -64,7 +64,7 @@ static struct sock *__l2tp_ip6_bind_lookup(struct net *net,
struct sock *sk;
 
sk_for_each_bound(sk, _ip6_bind_table) {
-   const struct in6_addr *addr = inet6_rcv_saddr(sk);
+   const struct in6_addr *sk_laddr = inet6_rcv_saddr(sk);
struct l2tp_ip6_sock *l2tp = l2tp_ip6_sk(sk);
 
if (l2tp == NULL)
@@ -72,7 +72,7 @@ static struct sock *__l2tp_ip6_bind_lookup(struct net *net,
 
if ((l2tp->conn_id == tunnel_id) &&
net_eq(sock_net(sk), net) &&
-   (!addr || ipv6_addr_equal(addr, laddr)) &&
+   (!sk_laddr || ipv6_addr_any(sk_laddr) || 
ipv6_addr_equal(sk_laddr, laddr)) &&
(!sk->sk_bound_dev_if || !dif ||
 sk->sk_bound_dev_if == dif))
goto found;
-- 
2.11.0


[PATCH for v4.9 LTS 18/87] ASoC: tlv320aic3x: Mark the RESET register as volatile

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Peter Ujfalusi 

[ Upstream commit 63c3194b82530bd71fd49db84eb7ab656b8d404a ]

The RESET register only have one self clearing bit and it should not be
cached. If it is cached, when we sync the registers back to the chip we
will initiate a software reset as well, which is not desirable.

Signed-off-by: Peter Ujfalusi 
Reviewed-by: Jarkko Nikula 
Signed-off-by: Mark Brown 
Signed-off-by: Sasha Levin 
---
 sound/soc/codecs/tlv320aic3x.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 5a8d96ec058c..fe45a16a5142 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -126,6 +126,16 @@ static const struct reg_default aic3x_reg[] = {
{ 108, 0x00 }, { 109, 0x00 },
 };
 
+static bool aic3x_volatile_reg(struct device *dev, unsigned int reg)
+{
+   switch (reg) {
+   case AIC3X_RESET:
+   return true;
+   default:
+   return false;
+   }
+}
+
 static const struct regmap_config aic3x_regmap = {
.reg_bits = 8,
.val_bits = 8,
@@ -133,6 +143,9 @@ static const struct regmap_config aic3x_regmap = {
.max_register = DAC_ICC_ADJ,
.reg_defaults = aic3x_reg,
.num_reg_defaults = ARRAY_SIZE(aic3x_reg),
+
+   .volatile_reg = aic3x_volatile_reg,
+
.cache_type = REGCACHE_RBTREE,
 };
 
-- 
2.11.0


[PATCH for v4.9 LTS 02/87] r8169: add support for RTL8168 series add-on card.

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Chun-Hao Lin 

[ Upstream commit 610c908773d30907c950ca3b2ee8ac4b2813537b ]

This chip is the same as RTL8168, but its device id is 0x8161.

Signed-off-by: Chun-Hao Lin 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/net/ethernet/realtek/r8169.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c 
b/drivers/net/ethernet/realtek/r8169.c
index bf000d819a21..2c4350a1c629 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -326,6 +326,7 @@ enum cfg_version {
 static const struct pci_device_id rtl8169_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8129), 0, 0, RTL_CFG_0 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8136), 0, 0, RTL_CFG_2 },
+   { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8161), 0, 0, RTL_CFG_1 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8167), 0, 0, RTL_CFG_0 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), 0, 0, RTL_CFG_1 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8169), 0, 0, RTL_CFG_0 },
-- 
2.11.0


[PATCH for v4.9 LTS 18/87] ASoC: tlv320aic3x: Mark the RESET register as volatile

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Peter Ujfalusi 

[ Upstream commit 63c3194b82530bd71fd49db84eb7ab656b8d404a ]

The RESET register only have one self clearing bit and it should not be
cached. If it is cached, when we sync the registers back to the chip we
will initiate a software reset as well, which is not desirable.

Signed-off-by: Peter Ujfalusi 
Reviewed-by: Jarkko Nikula 
Signed-off-by: Mark Brown 
Signed-off-by: Sasha Levin 
---
 sound/soc/codecs/tlv320aic3x.c | 13 +
 1 file changed, 13 insertions(+)

diff --git a/sound/soc/codecs/tlv320aic3x.c b/sound/soc/codecs/tlv320aic3x.c
index 5a8d96ec058c..fe45a16a5142 100644
--- a/sound/soc/codecs/tlv320aic3x.c
+++ b/sound/soc/codecs/tlv320aic3x.c
@@ -126,6 +126,16 @@ static const struct reg_default aic3x_reg[] = {
{ 108, 0x00 }, { 109, 0x00 },
 };
 
+static bool aic3x_volatile_reg(struct device *dev, unsigned int reg)
+{
+   switch (reg) {
+   case AIC3X_RESET:
+   return true;
+   default:
+   return false;
+   }
+}
+
 static const struct regmap_config aic3x_regmap = {
.reg_bits = 8,
.val_bits = 8,
@@ -133,6 +143,9 @@ static const struct regmap_config aic3x_regmap = {
.max_register = DAC_ICC_ADJ,
.reg_defaults = aic3x_reg,
.num_reg_defaults = ARRAY_SIZE(aic3x_reg),
+
+   .volatile_reg = aic3x_volatile_reg,
+
.cache_type = REGCACHE_RBTREE,
 };
 
-- 
2.11.0


[PATCH for v4.9 LTS 02/87] r8169: add support for RTL8168 series add-on card.

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Chun-Hao Lin 

[ Upstream commit 610c908773d30907c950ca3b2ee8ac4b2813537b ]

This chip is the same as RTL8168, but its device id is 0x8161.

Signed-off-by: Chun-Hao Lin 
Signed-off-by: David S. Miller 
Signed-off-by: Sasha Levin 
---
 drivers/net/ethernet/realtek/r8169.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/realtek/r8169.c 
b/drivers/net/ethernet/realtek/r8169.c
index bf000d819a21..2c4350a1c629 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -326,6 +326,7 @@ enum cfg_version {
 static const struct pci_device_id rtl8169_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8129), 0, 0, RTL_CFG_0 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8136), 0, 0, RTL_CFG_2 },
+   { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8161), 0, 0, RTL_CFG_1 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8167), 0, 0, RTL_CFG_0 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8168), 0, 0, RTL_CFG_1 },
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, 0x8169), 0, 0, RTL_CFG_0 },
-- 
2.11.0


[PATCH for v4.9 LTS 15/87] drm/msm: Verify that MSM_SUBMIT_BO_FLAGS are set

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jordan Crouse 

[ Upstream commit a6cb3b864b21b7345f824a4faa12b723c8aaf099 ]

For every submission buffer object one of MSM_SUBMIT_BO_WRITE
and MSM_SUBMIT_BO_READ must be set (and nothing else). If we
allowed zero then the buffer object would never get queued to
be unreferenced.

Signed-off-by: Jordan Crouse 
Signed-off-by: Rob Clark 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/msm/msm_gem_submit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c 
b/drivers/gpu/drm/msm/msm_gem_submit.c
index 427898a96325..393973016b52 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -106,7 +106,8 @@ static int submit_lookup_objects(struct msm_gem_submit 
*submit,
pagefault_disable();
}
 
-   if (submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) {
+   if ((submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) ||
+   !(submit_bo.flags & MSM_SUBMIT_BO_FLAGS)) {
DRM_ERROR("invalid flags: %x\n", submit_bo.flags);
ret = -EINVAL;
goto out_unlock;
-- 
2.11.0


[PATCH for v4.9 LTS 22/87] openrisc: Add _text symbol to fix ksym build error

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Stafford Horne 

[ Upstream commit 086cc1c31a0ec075dac02425367c871bb65bc2c9 ]

The build robot reports:

   .tmp_kallsyms1.o: In function `kallsyms_relative_base':
>> (.rodata+0x8a18): undefined reference to `_text'

This is when using 'make alldefconfig'. Adding this _text symbol to mark
the start of the kernel as in other architecture fixes this.

Signed-off-by: Stafford Horne 
Acked-by: Jonas Bonn 
Signed-off-by: Sasha Levin 
---
 arch/openrisc/kernel/vmlinux.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/kernel/vmlinux.lds.S 
b/arch/openrisc/kernel/vmlinux.lds.S
index d68b9ede8423..c50609aead35 100644
--- a/arch/openrisc/kernel/vmlinux.lds.S
+++ b/arch/openrisc/kernel/vmlinux.lds.S
@@ -38,6 +38,8 @@ SECTIONS
 /* Read-only sections, merged into text segment: */
 . = LOAD_BASE ;
 
+   _text = .;
+
/* _s_kernel_ro must be page aligned */
. = ALIGN(PAGE_SIZE);
_s_kernel_ro = .;
-- 
2.11.0


[PATCH for v4.9 LTS 15/87] drm/msm: Verify that MSM_SUBMIT_BO_FLAGS are set

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Jordan Crouse 

[ Upstream commit a6cb3b864b21b7345f824a4faa12b723c8aaf099 ]

For every submission buffer object one of MSM_SUBMIT_BO_WRITE
and MSM_SUBMIT_BO_READ must be set (and nothing else). If we
allowed zero then the buffer object would never get queued to
be unreferenced.

Signed-off-by: Jordan Crouse 
Signed-off-by: Rob Clark 
Signed-off-by: Sasha Levin 
---
 drivers/gpu/drm/msm/msm_gem_submit.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/msm_gem_submit.c 
b/drivers/gpu/drm/msm/msm_gem_submit.c
index 427898a96325..393973016b52 100644
--- a/drivers/gpu/drm/msm/msm_gem_submit.c
+++ b/drivers/gpu/drm/msm/msm_gem_submit.c
@@ -106,7 +106,8 @@ static int submit_lookup_objects(struct msm_gem_submit 
*submit,
pagefault_disable();
}
 
-   if (submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) {
+   if ((submit_bo.flags & ~MSM_SUBMIT_BO_FLAGS) ||
+   !(submit_bo.flags & MSM_SUBMIT_BO_FLAGS)) {
DRM_ERROR("invalid flags: %x\n", submit_bo.flags);
ret = -EINVAL;
goto out_unlock;
-- 
2.11.0


[PATCH for v4.9 LTS 22/87] openrisc: Add _text symbol to fix ksym build error

2017-07-14 Thread Levin, Alexander (Sasha Levin)
From: Stafford Horne 

[ Upstream commit 086cc1c31a0ec075dac02425367c871bb65bc2c9 ]

The build robot reports:

   .tmp_kallsyms1.o: In function `kallsyms_relative_base':
>> (.rodata+0x8a18): undefined reference to `_text'

This is when using 'make alldefconfig'. Adding this _text symbol to mark
the start of the kernel as in other architecture fixes this.

Signed-off-by: Stafford Horne 
Acked-by: Jonas Bonn 
Signed-off-by: Sasha Levin 
---
 arch/openrisc/kernel/vmlinux.lds.S | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/openrisc/kernel/vmlinux.lds.S 
b/arch/openrisc/kernel/vmlinux.lds.S
index d68b9ede8423..c50609aead35 100644
--- a/arch/openrisc/kernel/vmlinux.lds.S
+++ b/arch/openrisc/kernel/vmlinux.lds.S
@@ -38,6 +38,8 @@ SECTIONS
 /* Read-only sections, merged into text segment: */
 . = LOAD_BASE ;
 
+   _text = .;
+
/* _s_kernel_ro must be page aligned */
. = ALIGN(PAGE_SIZE);
_s_kernel_ro = .;
-- 
2.11.0


  1   2   3   4   5   6   7   8   9   10   >