Re: [PATCH 3/7] drm/i915/perf: only append status when data is available

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Lionel,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on drm-intel/for-linux-next]
[also build test WARNING on v5.0-rc2 next-20190116]
[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/Lionel-Landwerlin/drm-i915-perf-rework-aging-tail-workaround/20190117-000149
base:   git://anongit.freedesktop.org/drm-intel for-linux-next
reproduce: make htmldocs

All warnings (new ones prefixed by >>):

   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf'
   include/linux/dma-buf.h:304: warning: Function parameter or member 'cb_shared.active' not described in 'dma_buf'
   include/linux/dma-fence-array.h:54: warning: Function parameter or member 'work' not described in 'dma_fence_array'
   include/linux/firmware/intel/stratix10-svc-client.h:1: warning: no structured comments found
   include/linux/gpio/driver.h:371: warning: Function parameter or member 'init_valid_mask' not described in 'gpio_chip'
   include/linux/iio/hw-consumer.h:1: warning: no structured comments found
   include/linux/input/sparse-keymap.h:46: warning: Function parameter or member 'sw' not described in 'key_entry'
   drivers/mtd/nand/raw/nand_base.c:420: warning: Function parameter or member 'chip' not described in 'nand_fill_oob'
   drivers/mtd/nand/raw/nand_bbt.c:173: warning: Function parameter or member 'this' not described in 'read_bbt'
   drivers/mtd/nand/raw/nand_bbt.c:173: warning: Excess function parameter 'chip' description in 'read_bbt'
   include/linux/regulator/machine.h:199: warning: Function parameter or member 'max_uV_step' not described in 'regulation_constraints'
   include/linux/regulator/driver.h:228: warning: Function parameter or member 'resume' not described in 'regulator_ops'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw0' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw1' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw2' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.esw3' not described in 'irb'
   arch/s390/include/asm/cio.h:245: warning: Function parameter or member 'esw.eadm' not described in 'irb'
   drivers/slimbus/stream.c:1: warning: no structured comments found
   include/linux/spi/spi.h:180: warning: Function parameter or member 'driver_override' not described in 'spi_device'
   drivers/target/target_core_device.c:1: warning: no structured comments found
   drivers/usb/typec/bus.c:1: warning: no structured comments found
   drivers/usb/typec/class.c:1: warning: no structured comments found
   include/linux/w1.h:281: warning: Function parameter or member 'of_match_table' not described in 'w1_family'
   fs/direct-io.c:257: warning: Excess function parameter 'offset' description in 'dio_complete'
   fs/file_table.c:1: warning: no structured comments found
   fs/libfs.c:477: warning: Excess function parameter 'available' description in 'simple_write_end'
   fs/posix_acl.c:646: warning: Function parameter or member 'inode' not described in 'posix_acl_update_mode'
   fs/posix_acl.c:646: warning: Function parameter or member 'mode_p' not described in 'posix_acl_update_mode'
   fs/posix_acl.c:646: warning: Function parameter or member 'acl' not described in 'posix_acl_update_mode'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:294: warning: Excess function parameter 'mm' description in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:294: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:294: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:343: warning: Excess function parameter 'mm' description in 'amdgpu_mn_invalidate_range_end'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:343: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_end'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:343: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_end'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:183: warning: Function parameter or member 'blockable' not described in 'amdgpu_mn_read_lock'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Function parameter or member 'range' not described in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Excess function parameter 'mm' description in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:295: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_start_hsa'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Function parameter or member 'range' not described in 'amdgpu_mn_invalidate_range_end'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Excess function parameter 'mm' description in 'amdgpu_mn_invalidate_range_end'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Excess function parameter 'start' description in 'amdgpu_mn_invalidate_range_end'
   drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:344: warning: Excess function parameter 'end' description in 'amdgpu_mn_invalidate_range_end'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:382: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:383: warning: cannot understand function prototype: 'struct amdgpu_vm_pt_cursor '
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'start' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'end' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:555: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_leaf'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'adev' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'vm' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'cursor' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:603: warning: Function parameter or member 'entry' not described in 'for_each_amdgpu_vm_pt_dfs_safe'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:845: warning: Function parameter or member 'level' not described in 'amdgpu_vm_bo_param'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1353: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1353: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1353: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1353: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1353: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1353: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1353: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_func'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'params' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'bo' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'level' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'pe' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'addr' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'count' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'incr' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:1520: warning: Function parameter or member 'flags' not described in 'amdgpu_vm_update_huge'
   drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c:3096: warning: Function parameter or member 'pasid' not described in 'amdgpu_vm_make_compute'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:128: warning: Incorrect use of kernel-doc format: Documentation Makefile include scripts source @atomic_obj
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:203: warning: Function parameter or member 'atomic_obj' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:203: warning: Function parameter or member 'atomic_obj_lock' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:203: warning: Function parameter or member 'backlight_link' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:203: warning: Function parameter or member 'backlight_caps' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:203: warning: Function parameter or member 'freesync_module' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:203: warning: Function parameter or member 'fw_dmcu' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:203: warning: Function parameter or member 'dmcu_fw_version' not described in 'amdgpu_display_manager'
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c:1: warning: no structured comments found
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver'
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver'
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver'
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver'
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver'
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver'
   include/drm/drm_drv.h:618: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver'
   include/drm/drm_atomic_state_helper.h:1: warning: no structured comments found
   drivers/gpu/drm/drm_dp_helper.c:1364: warning: Function parameter or member 'dsc_dpcd' not described in 'drm_dp_dsc_sink_max_slice_count'
   drivers/gpu/drm/drm_dp_helper.c:1364: warning: Function parameter or member 'is_edp' not described in 'drm_dp_dsc_sink_max_slice_count'
   drivers/gpu/drm/i915/i915_vma.h:49: warning: cannot understand function prototype: 'struct i915_vma '
   drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found
   drivers/gpu/drm/i915/intel_guc_fwif.h:536: warning: cannot understand function prototype: 'struct guc_log_buffer_state '
   drivers/gpu/drm/i915/i915_trace.h:1: warning: no structured comments found
>> drivers/gpu/drm/i915/i915_perf.c:644: warning: Function parameter or member 'oastatus' not described in 'gen8_append_oa_reports'
>> drivers/gpu/drm/i915/i915_perf.c:928: warning: Function parameter or member 'oastatus1' not described in 'gen7_append_oa_reports'
   include/linux/skbuff.h:876: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'list' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'skb_mstamp_ns' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'head_frag' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'encapsulation' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'csum_valid' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member '__pkt_vlan_present_offset' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'vlan_present' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'csum_level' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff'
   include/linux/skbuff.h:876: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff'
   include/net/sock.h:238: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_portpair' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_cookie' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_listener' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common'
   include/net/sock.h:238: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common'
   include/net/sock.h:513: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'sk_backlog.len' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'sk_backlog.head' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'sk_wq_raw' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'sk_txtime_report_errors' not described in 'sock'
   include/net/sock.h:513: warning: Function parameter or member 'sk_validate_xmit_skb' not described in 'sock'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'adj_list.upper' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'adj_list.lower' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'gso_partial_features' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'switchdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'tlsdev_ops' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'name_assign_type' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'mpls_ptr' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'xdp_prog' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'qdisc_hash' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'xps_cpus_map' not described in 'net_device'
   include/linux/netdevice.h:2048: warning: Function parameter or member 'xps_rxqs_map' not described in 'net_device'
   include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(advertising' not described in 'phylink_link_state'
   include/linux/phylink.h:56: warning: Function parameter or member '__ETHTOOL_DECLARE_LINK_MODE_MASK(lp_advertising' not described in 'phylink_link_state'
   Documentation/admin-guide/cgroup-v2.rst:1509: WARNING: Block quote ends without a blank line; unexpected unindent.
   Documentation/admin-guide/cgroup-v2.rst:1511: WARNING: Block quote ends without a blank line; unexpected unindent.
   Documentation/admin-guide/cgroup-v2.rst:1512: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/interrupt.h:252: WARNING: Inline emphasis start-string without end-string.
   include/net/mac80211.h:1214: ERROR: Unexpected indentation.
   include/net/mac80211.h:1221: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:110: WARNING: Block quote ends without a blank line; unexpected unindent.
   include/linux/wait.h:113: ERROR: Unexpected indentation.
   include/linux/wait.h:115: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/time/hrtimer.c:1120: WARNING: Block quote ends without a blank line; unexpected unindent.
   kernel/signal.c:344: WARNING: Inline literal start-string without end-string.
   include/linux/kernel.h:137: WARNING: Inline interpreted text or phrase reference start-string without end-string.
   Documentation/driver-api/dmaengine/dmatest.rst:63: ERROR: Unexpected indentation.
   include/uapi/linux/firewire-cdev.h:312: WARNING: Inline literal start-string without end-string.
   Documentation/driver-api/gpio/board.rst:209: ERROR: Unexpected indentation.
   drivers/ata/libata-core.c:5959: ERROR: Unknown target name: "hw".
   drivers/message/fusion/mptbase.c:5057: WARNING: Definition list ends without a blank line; unexpected unindent.
   drivers/tty/serial/serial_core.c:1948: WARNING: Definition list ends without a blank line; unexpected unindent.
   include/linux/mtd/rawnand.h:1192: WARNING: Inline strong start-string without end-string.
   include/linux/mtd/rawnand.h:1194: WARNING: Inline strong start-string without end-string.
   include/linux/regulator/driver.h:287: ERROR: Unknown target name: "regulator_regmap_x_voltage".
   Documentation/driver-api/soundwire/locking.rst:50: ERROR: Inconsistent literal block quoting.
   Documentation/driver-api/soundwire/locking.rst:51: WARNING: Line block ends without a blank line.
   Documentation/driver-api/soundwire/locking.rst:55: WARNING: Inline substitution_reference start-string without end-string.
   Documentation/driver-api/soundwire/locking.rst:56: WARNING: Line block ends without a blank line.
   include/linux/spi/spi.h:368: ERROR: Unexpected indentation.
   fs/posix_acl.c:635: WARNING: Inline emphasis start-string without end-string.
   Documentation/filesystems/path-lookup.rst:347: WARNING: Title underline too short.

vim +644 drivers/gpu/drm/i915/i915_perf.c

d79651522 Robert Bragg      2016-11-07  617  
d79651522 Robert Bragg      2016-11-07  618  /**
d79651522 Robert Bragg      2016-11-07  619   * Copies all buffered OA reports into userspace read() buffer.
d79651522 Robert Bragg      2016-11-07  620   * @stream: An i915-perf stream opened for OA metrics
d79651522 Robert Bragg      2016-11-07  621   * @buf: destination buffer given by userspace
d79651522 Robert Bragg      2016-11-07  622   * @count: the number of bytes userspace wants to read
d79651522 Robert Bragg      2016-11-07  623   * @offset: (inout): the current position for writing into @buf
d79651522 Robert Bragg      2016-11-07  624   *
16d98b31f Robert Bragg      2016-12-07  625   * Notably any error condition resulting in a short read (-%ENOSPC or
16d98b31f Robert Bragg      2016-12-07  626   * -%EFAULT) will be returned even though one or more records may
d79651522 Robert Bragg      2016-11-07  627   * have been successfully copied. In this case it's up to the caller
d79651522 Robert Bragg      2016-11-07  628   * to decide if the error should be squashed before returning to
d79651522 Robert Bragg      2016-11-07  629   * userspace.
d79651522 Robert Bragg      2016-11-07  630   *
d79651522 Robert Bragg      2016-11-07  631   * Note: reports are consumed from the head, and appended to the
e81b3a555 Robert Bragg      2017-05-11  632   * tail, so the tail chases the head?... If you think that's mad
d79651522 Robert Bragg      2016-11-07  633   * and back-to-front you're not alone, but this follows the
d79651522 Robert Bragg      2016-11-07  634   * Gen PRM naming convention.
16d98b31f Robert Bragg      2016-12-07  635   *
16d98b31f Robert Bragg      2016-12-07  636   * Returns: 0 on success, negative error code on failure.
d79651522 Robert Bragg      2016-11-07  637   */
19f81df28 Robert Bragg      2017-06-13  638  static int gen8_append_oa_reports(struct i915_perf_stream *stream,
6e39236ad Lionel Landwerlin 2019-01-16  639  				  u32 oastatus,
19f81df28 Robert Bragg      2017-06-13  640  				  char __user *buf,
19f81df28 Robert Bragg      2017-06-13  641  				  size_t count,
19f81df28 Robert Bragg      2017-06-13  642  				  size_t *offset)
19f81df28 Robert Bragg      2017-06-13  643  {
19f81df28 Robert Bragg      2017-06-13 @644  	struct drm_i915_private *dev_priv = stream->dev_priv;
19f81df28 Robert Bragg      2017-06-13  645  	int report_size = dev_priv->perf.oa.oa_buffer.format_size;
19f81df28 Robert Bragg      2017-06-13  646  	u8 *oa_buf_base = dev_priv->perf.oa.oa_buffer.vaddr;
19f81df28 Robert Bragg      2017-06-13  647  	u32 gtt_offset = i915_ggtt_offset(dev_priv->perf.oa.oa_buffer.vma);
fe8416864 Joonas Lahtinen   2018-11-16  648  	u32 mask = (OA_BUFFER_SIZE - 1);
19f81df28 Robert Bragg      2017-06-13  649  	size_t start_offset = *offset;
19f81df28 Robert Bragg      2017-06-13  650  	unsigned long flags;
19f81df28 Robert Bragg      2017-06-13  651  	u32 head, tail;
19f81df28 Robert Bragg      2017-06-13  652  	u32 taken;
19f81df28 Robert Bragg      2017-06-13  653  	int ret = 0;
19f81df28 Robert Bragg      2017-06-13  654  
19f81df28 Robert Bragg      2017-06-13  655  	if (WARN_ON(!stream->enabled))
19f81df28 Robert Bragg      2017-06-13  656  		return -EIO;
19f81df28 Robert Bragg      2017-06-13  657  
19f81df28 Robert Bragg      2017-06-13  658  	spin_lock_irqsave(&dev_priv->perf.oa.oa_buffer.ptr_lock, flags);
19f81df28 Robert Bragg      2017-06-13  659  
19f81df28 Robert Bragg      2017-06-13  660  	head = dev_priv->perf.oa.oa_buffer.head;
b667af43d Lionel Landwerlin 2019-01-16  661  	tail = dev_priv->perf.oa.oa_buffer.tail;
19f81df28 Robert Bragg      2017-06-13  662  
19f81df28 Robert Bragg      2017-06-13  663  	spin_unlock_irqrestore(&dev_priv->perf.oa.oa_buffer.ptr_lock, flags);
19f81df28 Robert Bragg      2017-06-13  664  
19f81df28 Robert Bragg      2017-06-13  665  	/*
19f81df28 Robert Bragg      2017-06-13  666  	 * NB: oa_buffer.head/tail include the gtt_offset which we don't want
19f81df28 Robert Bragg      2017-06-13  667  	 * while indexing relative to oa_buf_base.
19f81df28 Robert Bragg      2017-06-13  668  	 */
19f81df28 Robert Bragg      2017-06-13  669  	head -= gtt_offset;
19f81df28 Robert Bragg      2017-06-13  670  	tail -= gtt_offset;
19f81df28 Robert Bragg      2017-06-13  671  
19f81df28 Robert Bragg      2017-06-13  672  	/*
19f81df28 Robert Bragg      2017-06-13  673  	 * An out of bounds or misaligned head or tail pointer implies a driver
19f81df28 Robert Bragg      2017-06-13  674  	 * bug since we validate + align the tail pointers we read from the
19f81df28 Robert Bragg      2017-06-13  675  	 * hardware and we are in full control of the head pointer which should
19f81df28 Robert Bragg      2017-06-13  676  	 * only be incremented by multiples of the report size (notably also
19f81df28 Robert Bragg      2017-06-13  677  	 * all a power of two).
19f81df28 Robert Bragg      2017-06-13  678  	 */
fe8416864 Joonas Lahtinen   2018-11-16  679  	if (WARN_ONCE(head > OA_BUFFER_SIZE || head % report_size ||
fe8416864 Joonas Lahtinen   2018-11-16  680  		      tail > OA_BUFFER_SIZE || tail % report_size,
19f81df28 Robert Bragg      2017-06-13  681  		      "Inconsistent OA buffer pointers: head = %u, tail = %u\n",
19f81df28 Robert Bragg      2017-06-13  682  		      head, tail))
19f81df28 Robert Bragg      2017-06-13  683  		return -EIO;
19f81df28 Robert Bragg      2017-06-13  684  
6e39236ad Lionel Landwerlin 2019-01-16  685  	/*
6e39236ad Lionel Landwerlin 2019-01-16  686  	 * If there is nothing to read, don't append the status report yet,
6e39236ad Lionel Landwerlin 2019-01-16  687  	 * wait until we have some data available.
6e39236ad Lionel Landwerlin 2019-01-16  688  	 */
6e39236ad Lionel Landwerlin 2019-01-16  689  	if (!OA_TAKEN(tail, head))
6e39236ad Lionel Landwerlin 2019-01-16  690  		return 0;
6e39236ad Lionel Landwerlin 2019-01-16  691  
6e39236ad Lionel Landwerlin 2019-01-16  692  	if (oastatus & GEN8_OASTATUS_REPORT_LOST) {
6e39236ad Lionel Landwerlin 2019-01-16  693  		ret = append_oa_status(stream, buf, count, offset,
6e39236ad Lionel Landwerlin 2019-01-16  694  				       DRM_I915_PERF_RECORD_OA_REPORT_LOST);
6e39236ad Lionel Landwerlin 2019-01-16  695  		if (ret)
6e39236ad Lionel Landwerlin 2019-01-16  696  			return ret;
6e39236ad Lionel Landwerlin 2019-01-16  697  		I915_WRITE(GEN8_OASTATUS,
6e39236ad Lionel Landwerlin 2019-01-16  698  			   oastatus & ~GEN8_OASTATUS_REPORT_LOST);
6e39236ad Lionel Landwerlin 2019-01-16  699  	}
19f81df28 Robert Bragg      2017-06-13  700  
19f81df28 Robert Bragg      2017-06-13  701  	for (/* none */;
19f81df28 Robert Bragg      2017-06-13  702  	     (taken = OA_TAKEN(tail, head));
19f81df28 Robert Bragg      2017-06-13  703  	     head = (head + report_size) & mask) {
19f81df28 Robert Bragg      2017-06-13  704  		u8 *report = oa_buf_base + head;
19f81df28 Robert Bragg      2017-06-13  705  		u32 *report32 = (void *)report;
19f81df28 Robert Bragg      2017-06-13  706  		u32 ctx_id;
19f81df28 Robert Bragg      2017-06-13  707  		u32 reason;
19f81df28 Robert Bragg      2017-06-13  708  
19f81df28 Robert Bragg      2017-06-13  709  		/*
19f81df28 Robert Bragg      2017-06-13  710  		 * All the report sizes factor neatly into the buffer
19f81df28 Robert Bragg      2017-06-13  711  		 * size so we never expect to see a report split
19f81df28 Robert Bragg      2017-06-13  712  		 * between the beginning and end of the buffer.
19f81df28 Robert Bragg      2017-06-13  713  		 *
19f81df28 Robert Bragg      2017-06-13  714  		 * Given the initial alignment check a misalignment
19f81df28 Robert Bragg      2017-06-13  715  		 * here would imply a driver bug that would result
19f81df28 Robert Bragg      2017-06-13  716  		 * in an overrun.
19f81df28 Robert Bragg      2017-06-13  717  		 */
fe8416864 Joonas Lahtinen   2018-11-16  718  		if (WARN_ON((OA_BUFFER_SIZE - head) < report_size)) {
19f81df28 Robert Bragg      2017-06-13  719  			DRM_ERROR("Spurious OA head ptr: non-integral report offset\n");
19f81df28 Robert Bragg      2017-06-13  720  			break;
19f81df28 Robert Bragg      2017-06-13  721  		}
19f81df28 Robert Bragg      2017-06-13  722  
19f81df28 Robert Bragg      2017-06-13  723  		/*
19f81df28 Robert Bragg      2017-06-13  724  		 * The reason field includes flags identifying what
19f81df28 Robert Bragg      2017-06-13  725  		 * triggered this specific report (mostly timer
19f81df28 Robert Bragg      2017-06-13  726  		 * triggered or e.g. due to a context switch).
19f81df28 Robert Bragg      2017-06-13  727  		 *
19f81df28 Robert Bragg      2017-06-13  728  		 * This field is never expected to be zero so we can
19f81df28 Robert Bragg      2017-06-13  729  		 * check that the report isn't invalid before copying
19f81df28 Robert Bragg      2017-06-13  730  		 * it to userspace...
19f81df28 Robert Bragg      2017-06-13  731  		 */
19f81df28 Robert Bragg      2017-06-13  732  		reason = ((report32[0] >> OAREPORT_REASON_SHIFT) &
19f81df28 Robert Bragg      2017-06-13  733  			  OAREPORT_REASON_MASK);
19f81df28 Robert Bragg      2017-06-13  734  		if (reason == 0) {
19f81df28 Robert Bragg      2017-06-13  735  			if (__ratelimit(&dev_priv->perf.oa.spurious_report_rs))
19f81df28 Robert Bragg      2017-06-13  736  				DRM_NOTE("Skipping spurious, invalid OA report\n");
19f81df28 Robert Bragg      2017-06-13  737  			continue;
19f81df28 Robert Bragg      2017-06-13  738  		}
19f81df28 Robert Bragg      2017-06-13  739  
61d5676b5 Lionel Landwerlin 2018-06-02  740  		ctx_id = report32[2] & dev_priv->perf.oa.specific_ctx_id_mask;
19f81df28 Robert Bragg      2017-06-13  741  
19f81df28 Robert Bragg      2017-06-13  742  		/*
19f81df28 Robert Bragg      2017-06-13  743  		 * Squash whatever is in the CTX_ID field if it's marked as
19f81df28 Robert Bragg      2017-06-13  744  		 * invalid to be sure we avoid false-positive, single-context
19f81df28 Robert Bragg      2017-06-13  745  		 * filtering below...
19f81df28 Robert Bragg      2017-06-13  746  		 *
19f81df28 Robert Bragg      2017-06-13  747  		 * Note: that we don't clear the valid_ctx_bit so userspace can
19f81df28 Robert Bragg      2017-06-13  748  		 * understand that the ID has been squashed by the kernel.
19f81df28 Robert Bragg      2017-06-13  749  		 */
19f81df28 Robert Bragg      2017-06-13  750  		if (!(report32[0] & dev_priv->perf.oa.gen8_valid_ctx_bit))
19f81df28 Robert Bragg      2017-06-13  751  			ctx_id = report32[2] = INVALID_CTX_ID;
19f81df28 Robert Bragg      2017-06-13  752  
19f81df28 Robert Bragg      2017-06-13  753  		/*
19f81df28 Robert Bragg      2017-06-13  754  		 * NB: For Gen 8 the OA unit no longer supports clock gating
19f81df28 Robert Bragg      2017-06-13  755  		 * off for a specific context and the kernel can't securely
19f81df28 Robert Bragg      2017-06-13  756  		 * stop the counters from updating as system-wide / global
19f81df28 Robert Bragg      2017-06-13  757  		 * values.
19f81df28 Robert Bragg      2017-06-13  758  		 *
19f81df28 Robert Bragg      2017-06-13  759  		 * Automatic reports now include a context ID so reports can be
19f81df28 Robert Bragg      2017-06-13  760  		 * filtered on the cpu but it's not worth trying to
19f81df28 Robert Bragg      2017-06-13  761  		 * automatically subtract/hide counter progress for other
19f81df28 Robert Bragg      2017-06-13  762  		 * contexts while filtering since we can't stop userspace
19f81df28 Robert Bragg      2017-06-13  763  		 * issuing MI_REPORT_PERF_COUNT commands which would still
19f81df28 Robert Bragg      2017-06-13  764  		 * provide a side-band view of the real values.
19f81df28 Robert Bragg      2017-06-13  765  		 *
19f81df28 Robert Bragg      2017-06-13  766  		 * To allow userspace (such as Mesa/GL_INTEL_performance_query)
19f81df28 Robert Bragg      2017-06-13  767  		 * to normalize counters for a single filtered context then it
19f81df28 Robert Bragg      2017-06-13  768  		 * needs be forwarded bookend context-switch reports so that it
19f81df28 Robert Bragg      2017-06-13  769  		 * can track switches in between MI_REPORT_PERF_COUNT commands
19f81df28 Robert Bragg      2017-06-13  770  		 * and can itself subtract/ignore the progress of counters
19f81df28 Robert Bragg      2017-06-13  771  		 * associated with other contexts. Note that the hardware
19f81df28 Robert Bragg      2017-06-13  772  		 * automatically triggers reports when switching to a new
19f81df28 Robert Bragg      2017-06-13  773  		 * context which are tagged with the ID of the newly active
19f81df28 Robert Bragg      2017-06-13  774  		 * context. To avoid the complexity (and likely fragility) of
19f81df28 Robert Bragg      2017-06-13  775  		 * reading ahead while parsing reports to try and minimize
19f81df28 Robert Bragg      2017-06-13  776  		 * forwarding redundant context switch reports (i.e. between
19f81df28 Robert Bragg      2017-06-13  777  		 * other, unrelated contexts) we simply elect to forward them
19f81df28 Robert Bragg      2017-06-13  778  		 * all.
19f81df28 Robert Bragg      2017-06-13  779  		 *
19f81df28 Robert Bragg      2017-06-13  780  		 * We don't rely solely on the reason field to identify context
19f81df28 Robert Bragg      2017-06-13  781  		 * switches since it's not-uncommon for periodic samples to
19f81df28 Robert Bragg      2017-06-13  782  		 * identify a switch before any 'context switch' report.
19f81df28 Robert Bragg      2017-06-13  783  		 */
19f81df28 Robert Bragg      2017-06-13  784  		if (!dev_priv->perf.oa.exclusive_stream->ctx ||
19f81df28 Robert Bragg      2017-06-13  785  		    dev_priv->perf.oa.specific_ctx_id == ctx_id ||
19f81df28 Robert Bragg      2017-06-13  786  		    (dev_priv->perf.oa.oa_buffer.last_ctx_id ==
19f81df28 Robert Bragg      2017-06-13  787  		     dev_priv->perf.oa.specific_ctx_id) ||
19f81df28 Robert Bragg      2017-06-13  788  		    reason & OAREPORT_REASON_CTX_SWITCH) {
19f81df28 Robert Bragg      2017-06-13  789  
19f81df28 Robert Bragg      2017-06-13  790  			/*
19f81df28 Robert Bragg      2017-06-13  791  			 * While filtering for a single context we avoid
19f81df28 Robert Bragg      2017-06-13  792  			 * leaking the IDs of other contexts.
19f81df28 Robert Bragg      2017-06-13  793  			 */
19f81df28 Robert Bragg      2017-06-13  794  			if (dev_priv->perf.oa.exclusive_stream->ctx &&
19f81df28 Robert Bragg      2017-06-13  795  			    dev_priv->perf.oa.specific_ctx_id != ctx_id) {
19f81df28 Robert Bragg      2017-06-13  796  				report32[2] = INVALID_CTX_ID;
19f81df28 Robert Bragg      2017-06-13  797  			}
19f81df28 Robert Bragg      2017-06-13  798  
19f81df28 Robert Bragg      2017-06-13  799  			ret = append_oa_sample(stream, buf, count, offset,
19f81df28 Robert Bragg      2017-06-13  800  					       report);
19f81df28 Robert Bragg      2017-06-13  801  			if (ret)
19f81df28 Robert Bragg      2017-06-13  802  				break;
19f81df28 Robert Bragg      2017-06-13  803  
19f81df28 Robert Bragg      2017-06-13  804  			dev_priv->perf.oa.oa_buffer.last_ctx_id = ctx_id;
19f81df28 Robert Bragg      2017-06-13  805  		}
19f81df28 Robert Bragg      2017-06-13  806  
19f81df28 Robert Bragg      2017-06-13  807  		/*
b667af43d Lionel Landwerlin 2019-01-16  808  		 * Clear out the first 2 dword as a mean to detect unlanded
b667af43d Lionel Landwerlin 2019-01-16  809  		 * reports.
19f81df28 Robert Bragg      2017-06-13  810  		 */
b667af43d Lionel Landwerlin 2019-01-16  811  		report32[0] = report32[1] = 0;
19f81df28 Robert Bragg      2017-06-13  812  	}
19f81df28 Robert Bragg      2017-06-13  813  
19f81df28 Robert Bragg      2017-06-13  814  	if (start_offset != *offset) {
19f81df28 Robert Bragg      2017-06-13  815  		spin_lock_irqsave(&dev_priv->perf.oa.oa_buffer.ptr_lock, flags);
19f81df28 Robert Bragg      2017-06-13  816  
19f81df28 Robert Bragg      2017-06-13  817  		/*
19f81df28 Robert Bragg      2017-06-13  818  		 * We removed the gtt_offset for the copy loop above, indexing
19f81df28 Robert Bragg      2017-06-13  819  		 * relative to oa_buf_base so put back here...
19f81df28 Robert Bragg      2017-06-13  820  		 */
19f81df28 Robert Bragg      2017-06-13  821  		head += gtt_offset;
19f81df28 Robert Bragg      2017-06-13  822  
19f81df28 Robert Bragg      2017-06-13  823  		I915_WRITE(GEN8_OAHEADPTR, head & GEN8_OAHEADPTR_MASK);
19f81df28 Robert Bragg      2017-06-13  824  		dev_priv->perf.oa.oa_buffer.head = head;
19f81df28 Robert Bragg      2017-06-13  825  
19f81df28 Robert Bragg      2017-06-13  826  		spin_unlock_irqrestore(&dev_priv->perf.oa.oa_buffer.ptr_lock, flags);
19f81df28 Robert Bragg      2017-06-13  827  	}
19f81df28 Robert Bragg      2017-06-13  828  
19f81df28 Robert Bragg      2017-06-13  829  	return ret;
19f81df28 Robert Bragg      2017-06-13  830  }
19f81df28 Robert Bragg      2017-06-13  831  

:::::: The code at line 644 was first introduced by commit
:::::: 19f81df2859eb10e92d68991cefa39f826dea013 drm/i915/perf: Add OA unit support for Gen 8+

:::::: TO: Robert Bragg <robert@xxxxxxxxxxxxx>
:::::: CC: Ben Widawsky <ben@xxxxxxxxxxxx>

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

Attachment: .config.gz
Description: application/gzip

_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux