tree: git://people.freedesktop.org/~agd5f/linux.git drm-next-4.19-wip head: 69c20a808c86d7fd6cd64a9c8cc6b024a88c45fa commit: b55f236b433d63a5c4c90c5a40c9694eb5cbff34 [110/115] drm/amdgpu: fix documentation of amdgpu_mn.c v2 reproduce: make htmldocs All warnings (new ones prefixed by >>): WARNING: convert(1) not found, for SVG to PDF conversion install ImageMagick (https://www.imagemagick.org) include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.ibss' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.connect' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.keys' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.ie' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.ie_len' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.bssid' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.ssid' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.default_key' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.default_mgmt_key' not described in 'wireless_dev' include/net/cfg80211.h:4216: warning: Function parameter or member 'wext.prev_bssid_valid' not described in 'wireless_dev' include/net/mac80211.h:2282: warning: Function parameter or member 'radiotap_timestamp.units_pos' not described in 'ieee80211_hw' include/net/mac80211.h:2282: warning: Function parameter or member 'radiotap_timestamp.accuracy' not described in 'ieee80211_hw' include/net/mac80211.h:955: warning: Function parameter or member 'control.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.rts_cts_rate_idx' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.use_rts' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.use_cts_prot' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.short_preamble' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.skip_table' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.jiffies' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.vif' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.hw_key' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.flags' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'control.enqueue_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'ack' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'ack.cookie' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.ampdu_ack_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.ampdu_len' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.antenna' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.tx_time' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.is_valid_ack_signal' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'status.status_driver_data' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'driver_rates' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'pad' not described in 'ieee80211_tx_info' include/net/mac80211.h:955: warning: Function parameter or member 'rate_driver_data' not described in 'ieee80211_tx_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'rx_stats_avg' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'rx_stats_avg.signal' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'rx_stats_avg.chain_signal' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.filtered' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.retry_failed' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.retry_count' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.lost_packets' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.last_tdls_pkt_time' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.msdu_retries' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.msdu_failed' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.last_ack' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.last_ack_signal' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'status_stats.ack_signal_filled' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'tx_stats.packets' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'tx_stats.bytes' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'tx_stats.last_rate' not described in 'sta_info' net/mac80211/sta_info.h:586: warning: Function parameter or member 'tx_stats.msdu' not described in 'sta_info' kernel/sched/fair.c:3719: warning: Function parameter or member 'flags' not described in 'attach_entity_load_avg' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.cb' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.poll' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_excl.active' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.cb' not described in 'dma_buf' include/linux/dma-buf.h:307: warning: Function parameter or member 'cb_shared.poll' not described in 'dma_buf' include/linux/dma-buf.h:307: 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/gpio/driver.h:142: warning: Function parameter or member 'request_key' not described in 'gpio_irq_chip' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.sign' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.realbits' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.storagebits' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.shift' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.repeat' not described in 'iio_chan_spec' include/linux/iio/iio.h:270: warning: Function parameter or member 'scan_type.endianness' not described in 'iio_chan_spec' 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' include/linux/mtd/rawnand.h:752: warning: Function parameter or member 'timings.sdr' not described in 'nand_data_interface' include/linux/mtd/rawnand.h:817: warning: Function parameter or member 'buf' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:817: warning: Function parameter or member 'buf.in' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:817: warning: Function parameter or member 'buf.out' not described in 'nand_op_data_instr' include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.cmd' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.data' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:863: warning: Function parameter or member 'ctx.waitrdy' not described in 'nand_op_instr' include/linux/mtd/rawnand.h:1010: warning: Function parameter or member 'ctx' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:1010: warning: Function parameter or member 'ctx.addr' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:1010: warning: Function parameter or member 'ctx.data' not described in 'nand_op_parser_pattern_elem' include/linux/mtd/rawnand.h:1313: warning: Function parameter or member 'manufacturer.desc' not described in 'nand_chip' include/linux/mtd/rawnand.h:1313: warning: Function parameter or member 'manufacturer.priv' not described in 'nand_chip' include/linux/regulator/driver.h:222: warning: Function parameter or member 'resume_early' not described in 'regulator_ops' drivers/regulator/core.c:4306: warning: Excess function parameter 'state' description in 'regulator_suspend_late' 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/usb/typec/mux.c:186: warning: Function parameter or member 'mux' not described in 'typec_mux_unregister' drivers/usb/typec/mux.c:186: warning: Excess function parameter 'sw' description in 'typec_mux_unregister' >> drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:90: warning: Function parameter or member 'type' not described in 'amdgpu_mn' >> drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c:282: warning: Function parameter or member 'mm' not described in 'amdgpu_mn_invalidate_range_start_hsa' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_pin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_unpin' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_res_obj' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_get_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_import_sg_table' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_vunmap' not described in 'drm_driver' include/drm/drm_drv.h:610: warning: Function parameter or member 'gem_prime_mmap' not described in 'drm_driver' drivers/gpu/drm/i915/i915_vma.h:48: warning: cannot understand function prototype: 'struct i915_vma ' drivers/gpu/drm/i915/i915_vma.h:1: warning: no structured comments found include/drm/tinydrm/tinydrm.h:34: warning: Function parameter or member 'fb_dirty' not described in 'tinydrm_device' drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'crtc_state' not described in 'mipi_dbi_enable_flush' drivers/gpu/drm/tinydrm/mipi-dbi.c:272: warning: Function parameter or member 'plane_state' not described in 'mipi_dbi_enable_flush' include/media/v4l2-dev.h:42: warning: Enum value 'VFL_TYPE_MAX' not described in enum 'vfl_devnode_type' include/linux/skbuff.h:850: warning: Function parameter or member 'dev_scratch' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'ip_defrag_offset' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'skb_mstamp' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member '__cloned_offset' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'head_frag' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member '__unused' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member '__pkt_type_offset' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'pfmemalloc' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'encapsulation' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'encap_hdr_csum' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'csum_valid' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'csum_complete_sw' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'csum_level' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'inner_protocol_type' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'remcsum_offload' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'offload_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'offload_mr_fwd_mark' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'sender_cpu' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'reserved_tailroom' not described in 'sk_buff' include/linux/skbuff.h:850: warning: Function parameter or member 'inner_ipproto' not described in 'sk_buff' include/net/sock.h:234: warning: Function parameter or member 'skc_addrpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_portpair' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_ipv6only' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_net_refcnt' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_daddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_v6_rcv_saddr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_cookie' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_listener' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_dr' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_rcv_wnd' not described in 'sock_common' include/net/sock.h:234: warning: Function parameter or member 'skc_tw_rcv_nxt' not described in 'sock_common' include/net/sock.h:488: warning: Function parameter or member 'sk_backlog.rmem_alloc' not described in 'sock' include/net/sock.h:488: warning: Function parameter or member 'sk_backlog.len' not described in 'sock' include/net/sock.h:488: warning: Function parameter or member 'sk_backlog.head' not described in 'sock' include/net/sock.h:488: warning: Function parameter or member 'sk_backlog.tail' not described in 'sock' include/net/sock.h:488: warning: Function parameter or member 'sk_wq_raw' not described in 'sock' include/net/sock.h:488: warning: Function parameter or member 'tcp_rtx_queue' not described in 'sock' include/net/sock.h:488: warning: Function parameter or member 'sk_route_forced_caps' not described in 'sock' include/linux/netdevice.h:1955: warning: Function parameter or member 'adj_list.upper' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'adj_list.lower' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'gso_partial_features' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'switchdev_ops' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'l3mdev_ops' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'xfrmdev_ops' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'name_assign_type' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'ieee802154_ptr' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'mpls_ptr' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'xdp_prog' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'gro_flush_timeout' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'nf_hooks_ingress' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member '____cacheline_aligned_in_smp' not described in 'net_device' include/linux/netdevice.h:1955: warning: Function parameter or member 'qdisc_hash' 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' include/linux/rcupdate.h:572: ERROR: Unexpected indentation. include/linux/rcupdate.h:576: ERROR: Unexpected indentation. include/linux/rcupdate.h:580: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:582: WARNING: Block quote ends without a blank line; unexpected unindent. include/linux/rcupdate.h:582: WARNING: Inline literal start-string without end-string. Documentation/crypto/crypto_engine.rst:13: ERROR: Unexpected indentation. Documentation/crypto/crypto_engine.rst:15: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/time/timer.c:1259: ERROR: Unexpected indentation. kernel/time/timer.c:1261: ERROR: Unexpected indentation. kernel/time/timer.c:1262: 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:1129: WARNING: Block quote ends without a blank line; unexpected unindent. kernel/signal.c:327: WARNING: Inline literal start-string without end-string. Documentation/driver-api/device_connection.rst:42: ERROR: Error in "kernel-doc" directive: maximum 4 argument(s) allowed, 7 supplied. vim +90 drivers/gpu/drm/amd/amdgpu/amdgpu_mn.c d38ceaf9 Alex Deucher 2015-04-20 @90 b55f236b Christian König 2018-06-05 91 /** b55f236b Christian König 2018-06-05 92 * struct amdgpu_mn_node b55f236b Christian König 2018-06-05 93 * b55f236b Christian König 2018-06-05 94 * @it: interval node defining start-last of the affected address range b55f236b Christian König 2018-06-05 95 * @bos: list of all BOs in the affected address range b55f236b Christian König 2018-06-05 96 * b55f236b Christian König 2018-06-05 97 * Manages all BOs which are affected of a certain range of address space. b55f236b Christian König 2018-06-05 98 */ d38ceaf9 Alex Deucher 2015-04-20 99 struct amdgpu_mn_node { d38ceaf9 Alex Deucher 2015-04-20 100 struct interval_tree_node it; d38ceaf9 Alex Deucher 2015-04-20 101 struct list_head bos; d38ceaf9 Alex Deucher 2015-04-20 102 }; d38ceaf9 Alex Deucher 2015-04-20 103 d38ceaf9 Alex Deucher 2015-04-20 104 /** b55f236b Christian König 2018-06-05 105 * amdgpu_mn_destroy - destroy the MMU notifier d38ceaf9 Alex Deucher 2015-04-20 106 * d38ceaf9 Alex Deucher 2015-04-20 107 * @work: previously sheduled work item d38ceaf9 Alex Deucher 2015-04-20 108 * d38ceaf9 Alex Deucher 2015-04-20 109 * Lazy destroys the notifier from a work item d38ceaf9 Alex Deucher 2015-04-20 110 */ d38ceaf9 Alex Deucher 2015-04-20 111 static void amdgpu_mn_destroy(struct work_struct *work) d38ceaf9 Alex Deucher 2015-04-20 112 { b593fc01 Christian König 2018-06-13 113 struct amdgpu_mn *amn = container_of(work, struct amdgpu_mn, work); b593fc01 Christian König 2018-06-13 114 struct amdgpu_device *adev = amn->adev; d38ceaf9 Alex Deucher 2015-04-20 115 struct amdgpu_mn_node *node, *next_node; d38ceaf9 Alex Deucher 2015-04-20 116 struct amdgpu_bo *bo, *next_bo; d38ceaf9 Alex Deucher 2015-04-20 117 d38ceaf9 Alex Deucher 2015-04-20 118 mutex_lock(&adev->mn_lock); b593fc01 Christian König 2018-06-13 119 down_write(&amn->lock); b593fc01 Christian König 2018-06-13 120 hash_del(&amn->node); f808c13f Davidlohr Bueso 2017-09-08 121 rbtree_postorder_for_each_entry_safe(node, next_node, b593fc01 Christian König 2018-06-13 122 &amn->objects.rb_root, it.rb) { d38ceaf9 Alex Deucher 2015-04-20 123 list_for_each_entry_safe(bo, next_bo, &node->bos, mn_list) { d38ceaf9 Alex Deucher 2015-04-20 124 bo->mn = NULL; d38ceaf9 Alex Deucher 2015-04-20 125 list_del_init(&bo->mn_list); d38ceaf9 Alex Deucher 2015-04-20 126 } d38ceaf9 Alex Deucher 2015-04-20 127 kfree(node); d38ceaf9 Alex Deucher 2015-04-20 128 } b593fc01 Christian König 2018-06-13 129 up_write(&amn->lock); b8ea3783 Felix Kuehling 2016-02-16 130 mutex_unlock(&adev->mn_lock); b593fc01 Christian König 2018-06-13 131 mmu_notifier_unregister_no_release(&amn->mn, amn->mm); b593fc01 Christian König 2018-06-13 132 kfree(amn); d38ceaf9 Alex Deucher 2015-04-20 133 } d38ceaf9 Alex Deucher 2015-04-20 134 d38ceaf9 Alex Deucher 2015-04-20 135 /** d38ceaf9 Alex Deucher 2015-04-20 136 * amdgpu_mn_release - callback to notify about mm destruction d38ceaf9 Alex Deucher 2015-04-20 137 * d38ceaf9 Alex Deucher 2015-04-20 138 * @mn: our notifier b55f236b Christian König 2018-06-05 139 * @mm: the mm this callback is about d38ceaf9 Alex Deucher 2015-04-20 140 * d38ceaf9 Alex Deucher 2015-04-20 141 * Shedule a work item to lazy destroy our notifier. d38ceaf9 Alex Deucher 2015-04-20 142 */ d38ceaf9 Alex Deucher 2015-04-20 143 static void amdgpu_mn_release(struct mmu_notifier *mn, d38ceaf9 Alex Deucher 2015-04-20 144 struct mm_struct *mm) d38ceaf9 Alex Deucher 2015-04-20 145 { b593fc01 Christian König 2018-06-13 146 struct amdgpu_mn *amn = container_of(mn, struct amdgpu_mn, mn); b55f236b Christian König 2018-06-05 147 b593fc01 Christian König 2018-06-13 148 INIT_WORK(&amn->work, amdgpu_mn_destroy); b593fc01 Christian König 2018-06-13 149 schedule_work(&amn->work); d38ceaf9 Alex Deucher 2015-04-20 150 } d38ceaf9 Alex Deucher 2015-04-20 151 3fe89771 Christian König 2017-09-12 152 3fe89771 Christian König 2017-09-12 153 /** b55f236b Christian König 2018-06-05 154 * amdgpu_mn_lock - take the write side lock for this notifier b55f236b Christian König 2018-06-05 155 * b55f236b Christian König 2018-06-05 156 * @mn: our notifier 3fe89771 Christian König 2017-09-12 157 */ 3fe89771 Christian König 2017-09-12 158 void amdgpu_mn_lock(struct amdgpu_mn *mn) 3fe89771 Christian König 2017-09-12 159 { 3fe89771 Christian König 2017-09-12 160 if (mn) 3fe89771 Christian König 2017-09-12 161 down_write(&mn->lock); 3fe89771 Christian König 2017-09-12 162 } 3fe89771 Christian König 2017-09-12 163 3fe89771 Christian König 2017-09-12 164 /** b55f236b Christian König 2018-06-05 165 * amdgpu_mn_unlock - drop the write side lock for this notifier b55f236b Christian König 2018-06-05 166 * b55f236b Christian König 2018-06-05 167 * @mn: our notifier 3fe89771 Christian König 2017-09-12 168 */ 3fe89771 Christian König 2017-09-12 169 void amdgpu_mn_unlock(struct amdgpu_mn *mn) 3fe89771 Christian König 2017-09-12 170 { 3fe89771 Christian König 2017-09-12 171 if (mn) 3fe89771 Christian König 2017-09-12 172 up_write(&mn->lock); 3fe89771 Christian König 2017-09-12 173 } 3fe89771 Christian König 2017-09-12 174 d38ceaf9 Alex Deucher 2015-04-20 175 /** b55f236b Christian König 2018-06-05 176 * amdgpu_mn_read_lock - take the read side lock for this notifier 1ed3d256 Christian König 2017-09-05 177 * b593fc01 Christian König 2018-06-13 178 * @amn: our notifier 1ed3d256 Christian König 2017-09-05 179 */ b593fc01 Christian König 2018-06-13 180 static void amdgpu_mn_read_lock(struct amdgpu_mn *amn) 1ed3d256 Christian König 2017-09-05 181 { b593fc01 Christian König 2018-06-13 182 mutex_lock(&amn->read_lock); b593fc01 Christian König 2018-06-13 183 if (atomic_inc_return(&amn->recursion) == 1) b593fc01 Christian König 2018-06-13 184 down_read_non_owner(&amn->lock); b593fc01 Christian König 2018-06-13 185 mutex_unlock(&amn->read_lock); 1ed3d256 Christian König 2017-09-05 186 } 1ed3d256 Christian König 2017-09-05 187 1ed3d256 Christian König 2017-09-05 188 /** b55f236b Christian König 2018-06-05 189 * amdgpu_mn_read_unlock - drop the read side lock for this notifier 1ed3d256 Christian König 2017-09-05 190 * b593fc01 Christian König 2018-06-13 191 * @amn: our notifier 1ed3d256 Christian König 2017-09-05 192 */ b593fc01 Christian König 2018-06-13 193 static void amdgpu_mn_read_unlock(struct amdgpu_mn *amn) 1ed3d256 Christian König 2017-09-05 194 { b593fc01 Christian König 2018-06-13 195 if (atomic_dec_return(&amn->recursion) == 0) b593fc01 Christian König 2018-06-13 196 up_read_non_owner(&amn->lock); 1ed3d256 Christian König 2017-09-05 197 } 1ed3d256 Christian König 2017-09-05 198 d38ceaf9 Alex Deucher 2015-04-20 199 /** ae20f12d Christian König 2016-03-18 200 * amdgpu_mn_invalidate_node - unmap all BOs of a node d38ceaf9 Alex Deucher 2015-04-20 201 * ae20f12d Christian König 2016-03-18 202 * @node: the node with the BOs to unmap b55f236b Christian König 2018-06-05 203 * @start: start of address range affected b55f236b Christian König 2018-06-05 204 * @end: end of address range affected d38ceaf9 Alex Deucher 2015-04-20 205 * b55f236b Christian König 2018-06-05 206 * Block for operations on BOs to finish and mark pages as accessed and b55f236b Christian König 2018-06-05 207 * potentially dirty. d38ceaf9 Alex Deucher 2015-04-20 208 */ ae20f12d Christian König 2016-03-18 209 static void amdgpu_mn_invalidate_node(struct amdgpu_mn_node *node, d38ceaf9 Alex Deucher 2015-04-20 210 unsigned long start, d38ceaf9 Alex Deucher 2015-04-20 211 unsigned long end) d38ceaf9 Alex Deucher 2015-04-20 212 { d38ceaf9 Alex Deucher 2015-04-20 213 struct amdgpu_bo *bo; 7ab7e8a4 Jack Xiao 2015-04-27 214 long r; d38ceaf9 Alex Deucher 2015-04-20 215 d38ceaf9 Alex Deucher 2015-04-20 216 list_for_each_entry(bo, &node->bos, mn_list) { d38ceaf9 Alex Deucher 2015-04-20 217 ae20f12d Christian König 2016-03-18 218 if (!amdgpu_ttm_tt_affect_userptr(bo->tbo.ttm, start, end)) a961ea73 Christian König 2015-05-04 219 continue; a961ea73 Christian König 2015-05-04 220 d38ceaf9 Alex Deucher 2015-04-20 221 r = reservation_object_wait_timeout_rcu(bo->tbo.resv, d38ceaf9 Alex Deucher 2015-04-20 222 true, false, MAX_SCHEDULE_TIMEOUT); 7ab7e8a4 Jack Xiao 2015-04-27 223 if (r <= 0) 7ab7e8a4 Jack Xiao 2015-04-27 224 DRM_ERROR("(%ld) failed to wait for user bo\n", r); d38ceaf9 Alex Deucher 2015-04-20 225 1b0c0f9d Christian König 2017-09-05 226 amdgpu_ttm_tt_mark_user_pages(bo->tbo.ttm); d38ceaf9 Alex Deucher 2015-04-20 227 } d38ceaf9 Alex Deucher 2015-04-20 228 } 0d2b42b0 Christian König 2016-03-18 229 ae20f12d Christian König 2016-03-18 230 /** e52482de Felix Kuehling 2018-03-23 231 * amdgpu_mn_invalidate_range_start_gfx - callback to notify about mm change ae20f12d Christian König 2016-03-18 232 * ae20f12d Christian König 2016-03-18 233 * @mn: our notifier b55f236b Christian König 2018-06-05 234 * @mm: the mm this callback is about ae20f12d Christian König 2016-03-18 235 * @start: start of updated range ae20f12d Christian König 2016-03-18 236 * @end: end of updated range ae20f12d Christian König 2016-03-18 237 * b55f236b Christian König 2018-06-05 238 * Block for operations on BOs to finish and mark pages as accessed and b55f236b Christian König 2018-06-05 239 * potentially dirty. ae20f12d Christian König 2016-03-18 240 */ e52482de Felix Kuehling 2018-03-23 241 static void amdgpu_mn_invalidate_range_start_gfx(struct mmu_notifier *mn, ae20f12d Christian König 2016-03-18 242 struct mm_struct *mm, ae20f12d Christian König 2016-03-18 243 unsigned long start, ae20f12d Christian König 2016-03-18 244 unsigned long end) ae20f12d Christian König 2016-03-18 245 { b593fc01 Christian König 2018-06-13 246 struct amdgpu_mn *amn = container_of(mn, struct amdgpu_mn, mn); ae20f12d Christian König 2016-03-18 247 struct interval_tree_node *it; ae20f12d Christian König 2016-03-18 248 ae20f12d Christian König 2016-03-18 249 /* notification is exclusive, but interval is inclusive */ ae20f12d Christian König 2016-03-18 250 end -= 1; ae20f12d Christian König 2016-03-18 251 b593fc01 Christian König 2018-06-13 252 amdgpu_mn_read_lock(amn); ae20f12d Christian König 2016-03-18 253 b593fc01 Christian König 2018-06-13 254 it = interval_tree_iter_first(&amn->objects, start, end); ae20f12d Christian König 2016-03-18 255 while (it) { ae20f12d Christian König 2016-03-18 256 struct amdgpu_mn_node *node; ae20f12d Christian König 2016-03-18 257 ae20f12d Christian König 2016-03-18 258 node = container_of(it, struct amdgpu_mn_node, it); ae20f12d Christian König 2016-03-18 259 it = interval_tree_iter_next(it, start, end); ae20f12d Christian König 2016-03-18 260 ae20f12d Christian König 2016-03-18 261 amdgpu_mn_invalidate_node(node, start, end); ae20f12d Christian König 2016-03-18 262 } 1ed3d256 Christian König 2017-09-05 263 } ae20f12d Christian König 2016-03-18 264 1ed3d256 Christian König 2017-09-05 265 /** e52482de Felix Kuehling 2018-03-23 266 * amdgpu_mn_invalidate_range_start_hsa - callback to notify about mm change e52482de Felix Kuehling 2018-03-23 267 * e52482de Felix Kuehling 2018-03-23 268 * @mn: our notifier e52482de Felix Kuehling 2018-03-23 269 * @mn: the mm this callback is about e52482de Felix Kuehling 2018-03-23 270 * @start: start of updated range e52482de Felix Kuehling 2018-03-23 271 * @end: end of updated range e52482de Felix Kuehling 2018-03-23 272 * e52482de Felix Kuehling 2018-03-23 273 * We temporarily evict all BOs between start and end. This e52482de Felix Kuehling 2018-03-23 274 * necessitates evicting all user-mode queues of the process. The BOs e52482de Felix Kuehling 2018-03-23 275 * are restorted in amdgpu_mn_invalidate_range_end_hsa. e52482de Felix Kuehling 2018-03-23 276 */ e52482de Felix Kuehling 2018-03-23 277 static void amdgpu_mn_invalidate_range_start_hsa(struct mmu_notifier *mn, e52482de Felix Kuehling 2018-03-23 278 struct mm_struct *mm, e52482de Felix Kuehling 2018-03-23 279 unsigned long start, e52482de Felix Kuehling 2018-03-23 280 unsigned long end) e52482de Felix Kuehling 2018-03-23 281 { b593fc01 Christian König 2018-06-13 @282 struct amdgpu_mn *amn = container_of(mn, struct amdgpu_mn, mn); e52482de Felix Kuehling 2018-03-23 283 struct interval_tree_node *it; e52482de Felix Kuehling 2018-03-23 284 e52482de Felix Kuehling 2018-03-23 285 /* notification is exclusive, but interval is inclusive */ e52482de Felix Kuehling 2018-03-23 286 end -= 1; e52482de Felix Kuehling 2018-03-23 287 b593fc01 Christian König 2018-06-13 288 amdgpu_mn_read_lock(amn); e52482de Felix Kuehling 2018-03-23 289 b593fc01 Christian König 2018-06-13 290 it = interval_tree_iter_first(&amn->objects, start, end); e52482de Felix Kuehling 2018-03-23 291 while (it) { e52482de Felix Kuehling 2018-03-23 292 struct amdgpu_mn_node *node; e52482de Felix Kuehling 2018-03-23 293 struct amdgpu_bo *bo; e52482de Felix Kuehling 2018-03-23 294 e52482de Felix Kuehling 2018-03-23 295 node = container_of(it, struct amdgpu_mn_node, it); e52482de Felix Kuehling 2018-03-23 296 it = interval_tree_iter_next(it, start, end); e52482de Felix Kuehling 2018-03-23 297 e52482de Felix Kuehling 2018-03-23 298 list_for_each_entry(bo, &node->bos, mn_list) { e52482de Felix Kuehling 2018-03-23 299 struct kgd_mem *mem = bo->kfd_bo; e52482de Felix Kuehling 2018-03-23 300 e52482de Felix Kuehling 2018-03-23 301 if (amdgpu_ttm_tt_affect_userptr(bo->tbo.ttm, e52482de Felix Kuehling 2018-03-23 302 start, end)) e52482de Felix Kuehling 2018-03-23 303 amdgpu_amdkfd_evict_userptr(mem, mm); e52482de Felix Kuehling 2018-03-23 304 } e52482de Felix Kuehling 2018-03-23 305 } e52482de Felix Kuehling 2018-03-23 306 } e52482de Felix Kuehling 2018-03-23 307 :::::: The code at line 90 was first introduced by commit :::::: d38ceaf99ed015f2a0b9af3499791bd3a3daae21 drm/amdgpu: add core driver (v4) :::::: TO: Alex Deucher <alexander.deucher@xxxxxxx> :::::: CC: Alex Deucher <alexander.deucher@xxxxxxx> --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation
Attachment:
.config.gz
Description: application/gzip
_______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.freedesktop.org/mailman/listinfo/dri-devel