Qi Zheng
e11c4f3acb
drm/panfrost: dynamically allocate the drm-panfrost shrinker
...
In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the drm-panfrost shrinker, so that it can be freed
asynchronously via RCU. Then it doesn't need to wait for RCU read-side
critical section when releasing the struct panfrost_device.
Link: https://lkml.kernel.org/r/20230911094444.68966-23-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com >
Reviewed-by: Steven Price <steven.price@arm.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Rob Herring <robh@kernel.org >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Alasdair Kergon <agk@redhat.com >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Andreas Dilger <adilger.kernel@dilger.ca >
Cc: Andreas Gruenbacher <agruenba@redhat.com >
Cc: Anna Schumaker <anna@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Bob Peterson <rpeterso@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Carlos Llamas <cmllamas@google.com >
Cc: Chandan Babu R <chandan.babu@oracle.com >
Cc: Chao Yu <chao@kernel.org >
Cc: Chris Mason <clm@fb.com >
Cc: Christian Brauner <brauner@kernel.org >
Cc: Christian Koenig <christian.koenig@amd.com >
Cc: Chuck Lever <cel@kernel.org >
Cc: Coly Li <colyli@suse.de >
Cc: Dai Ngo <Dai.Ngo@oracle.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: "Darrick J. Wong" <djwong@kernel.org >
Cc: Dave Chinner <david@fromorbit.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David Hildenbrand <david@redhat.com >
Cc: David Sterba <dsterba@suse.com >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Gao Xiang <hsiangkao@linux.alibaba.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Huang Rui <ray.huang@amd.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jaegeuk Kim <jaegeuk@kernel.org >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Jan Kara <jack@suse.cz >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Jeff Layton <jlayton@kernel.org >
Cc: Jeffle Xu <jefflexu@linux.alibaba.com >
Cc: Joel Fernandes (Google) <joel@joelfernandes.org >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Josef Bacik <josef@toxicpanda.com >
Cc: Juergen Gross <jgross@suse.com >
Cc: Kent Overstreet <kent.overstreet@gmail.com >
Cc: Kirill Tkhai <tkhai@ya.ru >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Mike Snitzer <snitzer@kernel.org >
Cc: Minchan Kim <minchan@kernel.org >
Cc: Muchun Song <muchun.song@linux.dev >
Cc: Muchun Song <songmuchun@bytedance.com >
Cc: Nadav Amit <namit@vmware.com >
Cc: Neil Brown <neilb@suse.de >
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Cc: Olga Kornievskaia <kolga@netapp.com >
Cc: Paul E. McKenney <paulmck@kernel.org >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Roman Gushchin <roman.gushchin@linux.dev >
Cc: Sean Paul <sean@poorly.run >
Cc: Sergey Senozhatsky <senozhatsky@chromium.org >
Cc: Song Liu <song@kernel.org >
Cc: Stefano Stabellini <sstabellini@kernel.org >
Cc: "Theodore Ts'o" <tytso@mit.edu >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tom Talpey <tom@talpey.com >
Cc: Trond Myklebust <trond.myklebust@hammerspace.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Vlastimil Babka <vbabka@suse.cz >
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com >
Cc: Yue Hu <huyue2@coolpad.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2023-10-04 10:32:25 -07:00
Qi Zheng
cd61a76c21
drm/msm: dynamically allocate the drm-msm_gem shrinker
...
In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the drm-msm_gem shrinker, so that it can be freed
asynchronously via RCU. Then it doesn't need to wait for RCU read-side
critical section when releasing the struct msm_drm_private.
Link: https://lkml.kernel.org/r/20230911094444.68966-22-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com >
Reviewed-by: Muchun Song <songmuchun@bytedance.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Sean Paul <sean@poorly.run >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: David Airlie <airlied@gmail.com >
Cc: Alasdair Kergon <agk@redhat.com >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: Andreas Dilger <adilger.kernel@dilger.ca >
Cc: Andreas Gruenbacher <agruenba@redhat.com >
Cc: Anna Schumaker <anna@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Bob Peterson <rpeterso@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Carlos Llamas <cmllamas@google.com >
Cc: Chandan Babu R <chandan.babu@oracle.com >
Cc: Chao Yu <chao@kernel.org >
Cc: Chris Mason <clm@fb.com >
Cc: Christian Brauner <brauner@kernel.org >
Cc: Christian Koenig <christian.koenig@amd.com >
Cc: Chuck Lever <cel@kernel.org >
Cc: Coly Li <colyli@suse.de >
Cc: Dai Ngo <Dai.Ngo@oracle.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: "Darrick J. Wong" <djwong@kernel.org >
Cc: Dave Chinner <david@fromorbit.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David Hildenbrand <david@redhat.com >
Cc: David Sterba <dsterba@suse.com >
Cc: Gao Xiang <hsiangkao@linux.alibaba.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Huang Rui <ray.huang@amd.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jaegeuk Kim <jaegeuk@kernel.org >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Jan Kara <jack@suse.cz >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Jeff Layton <jlayton@kernel.org >
Cc: Jeffle Xu <jefflexu@linux.alibaba.com >
Cc: Joel Fernandes (Google) <joel@joelfernandes.org >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Josef Bacik <josef@toxicpanda.com >
Cc: Juergen Gross <jgross@suse.com >
Cc: Kent Overstreet <kent.overstreet@gmail.com >
Cc: Kirill Tkhai <tkhai@ya.ru >
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Mike Snitzer <snitzer@kernel.org >
Cc: Minchan Kim <minchan@kernel.org >
Cc: Muchun Song <muchun.song@linux.dev >
Cc: Nadav Amit <namit@vmware.com >
Cc: Neil Brown <neilb@suse.de >
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Cc: Olga Kornievskaia <kolga@netapp.com >
Cc: Paul E. McKenney <paulmck@kernel.org >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rob Herring <robh@kernel.org >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Roman Gushchin <roman.gushchin@linux.dev >
Cc: Sergey Senozhatsky <senozhatsky@chromium.org >
Cc: Song Liu <song@kernel.org >
Cc: Stefano Stabellini <sstabellini@kernel.org >
Cc: Steven Price <steven.price@arm.com >
Cc: "Theodore Ts'o" <tytso@mit.edu >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Tom Talpey <tom@talpey.com >
Cc: Trond Myklebust <trond.myklebust@hammerspace.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Vlastimil Babka <vbabka@suse.cz >
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com >
Cc: Yue Hu <huyue2@coolpad.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2023-10-04 10:32:24 -07:00
Qi Zheng
583cc9e410
drm/i915: dynamically allocate the i915_gem_mm shrinker
...
In preparation for implementing lockless slab shrink, use new APIs to
dynamically allocate the i915_gem_mm shrinker, so that it can be freed
asynchronously via RCU. Then it doesn't need to wait for RCU read-side
critical section when releasing the struct drm_i915_private.
Link: https://lkml.kernel.org/r/20230911094444.68966-21-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com >
Reviewed-by: Muchun Song <songmuchun@bytedance.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Alasdair Kergon <agk@redhat.com >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: Andreas Dilger <adilger.kernel@dilger.ca >
Cc: Andreas Gruenbacher <agruenba@redhat.com >
Cc: Anna Schumaker <anna@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Bob Peterson <rpeterso@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Carlos Llamas <cmllamas@google.com >
Cc: Chandan Babu R <chandan.babu@oracle.com >
Cc: Chao Yu <chao@kernel.org >
Cc: Chris Mason <clm@fb.com >
Cc: Christian Brauner <brauner@kernel.org >
Cc: Christian Koenig <christian.koenig@amd.com >
Cc: Chuck Lever <cel@kernel.org >
Cc: Coly Li <colyli@suse.de >
Cc: Dai Ngo <Dai.Ngo@oracle.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: "Darrick J. Wong" <djwong@kernel.org >
Cc: Dave Chinner <david@fromorbit.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David Hildenbrand <david@redhat.com >
Cc: David Sterba <dsterba@suse.com >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Gao Xiang <hsiangkao@linux.alibaba.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Huang Rui <ray.huang@amd.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jaegeuk Kim <jaegeuk@kernel.org >
Cc: Jan Kara <jack@suse.cz >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Jeff Layton <jlayton@kernel.org >
Cc: Jeffle Xu <jefflexu@linux.alibaba.com >
Cc: Joel Fernandes (Google) <joel@joelfernandes.org >
Cc: Josef Bacik <josef@toxicpanda.com >
Cc: Juergen Gross <jgross@suse.com >
Cc: Kent Overstreet <kent.overstreet@gmail.com >
Cc: Kirill Tkhai <tkhai@ya.ru >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Mike Snitzer <snitzer@kernel.org >
Cc: Minchan Kim <minchan@kernel.org >
Cc: Muchun Song <muchun.song@linux.dev >
Cc: Nadav Amit <namit@vmware.com >
Cc: Neil Brown <neilb@suse.de >
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Cc: Olga Kornievskaia <kolga@netapp.com >
Cc: Paul E. McKenney <paulmck@kernel.org >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Roman Gushchin <roman.gushchin@linux.dev >
Cc: Sean Paul <sean@poorly.run >
Cc: Sergey Senozhatsky <senozhatsky@chromium.org >
Cc: Song Liu <song@kernel.org >
Cc: Stefano Stabellini <sstabellini@kernel.org >
Cc: Steven Price <steven.price@arm.com >
Cc: "Theodore Ts'o" <tytso@mit.edu >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Tom Talpey <tom@talpey.com >
Cc: Trond Myklebust <trond.myklebust@hammerspace.com >
Cc: Vlastimil Babka <vbabka@suse.cz >
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com >
Cc: Yue Hu <huyue2@coolpad.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2023-10-04 10:32:24 -07:00
Qi Zheng
d35b5c98c1
drm/ttm: dynamically allocate the drm-ttm_pool shrinker
...
Use new APIs to dynamically allocate the drm-ttm_pool shrinker.
Link: https://lkml.kernel.org/r/20230911094444.68966-5-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com >
Reviewed-by: Muchun Song <songmuchun@bytedance.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Christian Koenig <christian.koenig@amd.com >
Cc: Huang Rui <ray.huang@amd.com >
Cc: David Airlie <airlied@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Alasdair Kergon <agk@redhat.com >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: Andreas Dilger <adilger.kernel@dilger.ca >
Cc: Andreas Gruenbacher <agruenba@redhat.com >
Cc: Anna Schumaker <anna@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Bob Peterson <rpeterso@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Carlos Llamas <cmllamas@google.com >
Cc: Chandan Babu R <chandan.babu@oracle.com >
Cc: Chao Yu <chao@kernel.org >
Cc: Chris Mason <clm@fb.com >
Cc: Christian Brauner <brauner@kernel.org >
Cc: Chuck Lever <cel@kernel.org >
Cc: Coly Li <colyli@suse.de >
Cc: Dai Ngo <Dai.Ngo@oracle.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: "Darrick J. Wong" <djwong@kernel.org >
Cc: Dave Chinner <david@fromorbit.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David Hildenbrand <david@redhat.com >
Cc: David Sterba <dsterba@suse.com >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Gao Xiang <hsiangkao@linux.alibaba.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jaegeuk Kim <jaegeuk@kernel.org >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Jan Kara <jack@suse.cz >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Jeff Layton <jlayton@kernel.org >
Cc: Jeffle Xu <jefflexu@linux.alibaba.com >
Cc: Joel Fernandes (Google) <joel@joelfernandes.org >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Josef Bacik <josef@toxicpanda.com >
Cc: Juergen Gross <jgross@suse.com >
Cc: Kent Overstreet <kent.overstreet@gmail.com >
Cc: Kirill Tkhai <tkhai@ya.ru >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Mike Snitzer <snitzer@kernel.org >
Cc: Minchan Kim <minchan@kernel.org >
Cc: Muchun Song <muchun.song@linux.dev >
Cc: Nadav Amit <namit@vmware.com >
Cc: Neil Brown <neilb@suse.de >
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Cc: Olga Kornievskaia <kolga@netapp.com >
Cc: Paul E. McKenney <paulmck@kernel.org >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Roman Gushchin <roman.gushchin@linux.dev >
Cc: Sean Paul <sean@poorly.run >
Cc: Sergey Senozhatsky <senozhatsky@chromium.org >
Cc: Song Liu <song@kernel.org >
Cc: Stefano Stabellini <sstabellini@kernel.org >
Cc: Steven Price <steven.price@arm.com >
Cc: "Theodore Ts'o" <tytso@mit.edu >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Tom Talpey <tom@talpey.com >
Cc: Trond Myklebust <trond.myklebust@hammerspace.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Vlastimil Babka <vbabka@suse.cz >
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com >
Cc: Yue Hu <huyue2@coolpad.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2023-10-04 10:32:23 -07:00
Qi Zheng
0b2f5ea1aa
drm/ttm: introduce pool_shrink_rwsem
...
Currently, synchronize_shrinkers() is only used by TTM pool. It only
requires that no shrinkers run in parallel.
After we use RCU+refcount method to implement the lockless slab shrink, we
can not use shrinker_rwsem or synchronize_rcu() to guarantee that all
shrinker invocations have seen an update before freeing memory.
So we introduce a new pool_shrink_rwsem to implement a private
ttm_pool_synchronize_shrinkers(), so as to achieve the same purpose.
Link: https://lkml.kernel.org/r/20230911092517.64141-5-zhengqi.arch@bytedance.com
Signed-off-by: Qi Zheng <zhengqi.arch@bytedance.com >
Reviewed-by: Muchun Song <songmuchun@bytedance.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Cc: Christian Brauner <brauner@kernel.org >
Cc: Chuck Lever <cel@kernel.org >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: Darrick J. Wong <djwong@kernel.org >
Cc: Dave Chinner <david@fromorbit.com >
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Cc: Joel Fernandes <joel@joelfernandes.org >
Cc: Kirill Tkhai <tkhai@ya.ru >
Cc: Paul E. McKenney <paulmck@kernel.org >
Cc: Roman Gushchin <roman.gushchin@linux.dev >
Cc: Sergey Senozhatsky <senozhatsky@chromium.org >
Cc: Steven Price <steven.price@arm.com >
Cc: Theodore Ts'o <tytso@mit.edu >
Cc: Vlastimil Babka <vbabka@suse.cz >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Alasdair Kergon <agk@redhat.com >
Cc: Alexander Viro <viro@zeniv.linux.org.uk >
Cc: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com >
Cc: Andreas Dilger <adilger.kernel@dilger.ca >
Cc: Andreas Gruenbacher <agruenba@redhat.com >
Cc: Anna Schumaker <anna@kernel.org >
Cc: Arnd Bergmann <arnd@arndb.de >
Cc: Bob Peterson <rpeterso@redhat.com >
Cc: Borislav Petkov <bp@alien8.de >
Cc: Carlos Llamas <cmllamas@google.com >
Cc: Chandan Babu R <chandan.babu@oracle.com >
Cc: Chao Yu <chao@kernel.org >
Cc: Chris Mason <clm@fb.com >
Cc: Coly Li <colyli@suse.de >
Cc: Dai Ngo <Dai.Ngo@oracle.com >
Cc: Dave Hansen <dave.hansen@linux.intel.com >
Cc: David Airlie <airlied@gmail.com >
Cc: David Hildenbrand <david@redhat.com >
Cc: David Sterba <dsterba@suse.com >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Gao Xiang <hsiangkao@linux.alibaba.com >
Cc: Huang Rui <ray.huang@amd.com >
Cc: Ingo Molnar <mingo@redhat.com >
Cc: Jaegeuk Kim <jaegeuk@kernel.org >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Jan Kara <jack@suse.cz >
Cc: Jason Wang <jasowang@redhat.com >
Cc: Jeff Layton <jlayton@kernel.org >
Cc: Jeffle Xu <jefflexu@linux.alibaba.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Josef Bacik <josef@toxicpanda.com >
Cc: Juergen Gross <jgross@suse.com >
Cc: Kent Overstreet <kent.overstreet@gmail.com >
Cc: Marijn Suijten <marijn.suijten@somainline.org >
Cc: "Michael S. Tsirkin" <mst@redhat.com >
Cc: Mike Snitzer <snitzer@kernel.org >
Cc: Minchan Kim <minchan@kernel.org >
Cc: Muchun Song <muchun.song@linux.dev >
Cc: Nadav Amit <namit@vmware.com >
Cc: Neil Brown <neilb@suse.de >
Cc: Oleksandr Tyshchenko <oleksandr_tyshchenko@epam.com >
Cc: Olga Kornievskaia <kolga@netapp.com >
Cc: Richard Weinberger <richard@nod.at >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Rob Herring <robh@kernel.org >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Sean Paul <sean@poorly.run >
Cc: Song Liu <song@kernel.org >
Cc: Stefano Stabellini <sstabellini@kernel.org >
Cc: Thomas Gleixner <tglx@linutronix.de >
Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com >
Cc: Tom Talpey <tom@talpey.com >
Cc: Trond Myklebust <trond.myklebust@hammerspace.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com >
Cc: Yue Hu <huyue2@coolpad.com >
Signed-off-by: Andrew Morton <akpm@linux-foundation.org >
2023-10-04 10:32:23 -07:00
Umesh Nerlige Ramappa
907ef0398c
i915/guc: Get runtime pm in busyness worker only if already active
...
Ideally the busyness worker should take a gt pm wakeref because the
worker only needs to be active while gt is awake. However, the gt_park
path cancels the worker synchronously and this complicates the flow if
the worker is also running at the same time. The cancel waits for the
worker and when the worker releases the wakeref, that would call gt_park
and would lead to a deadlock.
The resolution is to take the global pm wakeref if runtime pm is already
active. If not, we don't need to update the busyness stats as the stats
would already be updated when the gt was parked.
Note:
- We do not requeue the worker if we cannot take a reference to runtime
pm since intel_guc_busyness_unpark would requeue the worker in the
resume path.
- If the gt was parked longer than time taken for GT timestamp to roll
over, we ignore those rollovers since we don't care about tracking the
exact GT time. We only care about roll overs when the gt is active and
running workloads.
- There is a window of time between gt_park and runtime suspend, where
the worker may run. This is acceptable since the worker will not find
any new data to update busyness.
v2: (Daniele)
- Edit commit message and code comment
- Use runtime pm in the worker
- Put runtime pm after enabling the worker
- Use Link tag and add Fixes tag
v3: (Daniele)
- Reword commit and comments and add details
Link: https://gitlab.freedesktop.org/drm/intel/-/issues/7077
Fixes: 77cdd054dd ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu")
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com >
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230925192117.2497058-1-umesh.nerlige.ramappa@intel.com
(cherry picked from commit e2f99b79d4 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-09-26 13:58:16 -04:00
Javier Pello
b7599d2417
drm/i915/gt: Fix reservation address in ggtt_reserve_guc_top
...
There is an assertion in ggtt_reserve_guc_top that the global GTT
is of size at least GUC_GGTT_TOP, which is not the case on a 32-bit
platform; see commit 562d55d991
("drm/i915/bdw: Only use 2g GGTT for 32b platforms"). If GEM_BUG_ON
is enabled, this triggers a BUG(); if GEM_BUG_ON is disabled, the
subsequent reservation fails and the driver fails to initialise
the device:
i915 0000:00:02.0: [drm:i915_init_ggtt [i915]] Failed to reserve top of GGTT for GuC
i915 0000:00:02.0: Device initialization failed (-28)
i915 0000:00:02.0: Please file a bug on drm/i915; see https://gitlab.freedesktop.org/drm/intel/-/wikis/How-to-file-i915-bugs for details.
i915: probe of 0000:00:02.0 failed with error -28
Make the reservation at the top of the available space, whatever
that is, instead of assuming that the top will be GUC_GGTT_TOP.
Fixes: 911800765e ("drm/i915/uc: Reserve upper range of GGTT")
Link: https://gitlab.freedesktop.org/drm/intel/-/issues/9080
Signed-off-by: Javier Pello <devel@otheo.eu >
Reviewed-by: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Fernando Pacheco <fernando.pacheco@intel.com >
Cc: Chris Wilson <chris@chris-wilson.co.uk >
Cc: Jani Nikula <jani.nikula@linux.intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com >
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com >
Cc: intel-gfx@lists.freedesktop.org
Cc: stable@vger.kernel.org # v5.3+
Signed-off-by: John Harrison <John.C.Harrison@Intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230902171039.2229126186d697dbcf62d6d8@otheo.eu
(cherry picked from commit 0f3fa942d9 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-09-26 13:58:12 -04:00
Matthew Wilcox (Oracle)
863a8eb3f2
i915: Limit the length of an sg list to the requested length
...
The folio conversion changed the behaviour of shmem_sg_alloc_table() to
put the entire length of the last folio into the sg list, even if the sg
list should have been shorter. gen8_ggtt_insert_entries() relied on the
list being the right length and would overrun the end of the page tables.
Other functions may also have been affected.
Clamp the length of the last entry in the sg list to be the expected
length.
Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org >
Fixes: 0b62af28f2 ("i915: convert shmem_sg_free_table() to use a folio_batch")
Cc: stable@vger.kernel.org # 6.5.x
Link: https://gitlab.freedesktop.org/drm/intel/-/issues/9256
Link: https://lore.kernel.org/lkml/6287208.lOV4Wx5bFT@natalenko.name/
Reported-by: Oleksandr Natalenko <oleksandr@natalenko.name >
Tested-by: Oleksandr Natalenko <oleksandr@natalenko.name >
Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com >
Signed-off-by: Andrzej Hajda <andrzej.hajda@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230919194855.347582-1-willy@infradead.org
(cherry picked from commit 26a8e32e6d )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-09-26 13:58:05 -04:00
Dave Airlie
54928f2f84
Merge tag 'amd-drm-fixes-6.6-2023-09-20' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
...
amd-drm-fixes-6.6-2023-09-20:
amdgpu:
- MST fix
- Vbios part number reporting fix
- Fix a possible memory leak in an error case in the RAS code
- Fix low resolution modes on eDP
amdkfd:
- Fix GPU address for user queue wptr when GART is not at 0
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230920222915.7789-1-alexander.deucher@amd.com
2023-09-22 15:43:44 +10:00
Dave Airlie
ab2bff5993
Merge tag 'drm-intel-fixes-2023-09-21' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
...
- Prevent error pointer dereference (Dan Carpenter)
- Fix PMU busyness values when using GuC mode (Umesh)
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ZQxf267jxc7tiIlZ@intel.com
2023-09-22 15:32:21 +10:00
Dave Airlie
f675553d76
Merge tag 'drm-misc-fixes-2023-09-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
...
Short summary of fixes pull:
* DRM MM-test fixes
* Fbdev Kconfig fixes
* ivpu:
* IRQ-handling fixes
* meson:
* Fix memory leak in HDMI EDID code
* nouveau:
* Correct type casting
* Fix memory leak in scheduler
* u_memcpya() fixes
* virtio:
* Fence cleanups
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20230921153712.GA14059@linux-uq9g
2023-09-22 14:38:30 +10:00
YuBiao Wang
cc39f9ccb8
drm/amdkfd: Use gpu_offset for user queue's wptr
...
Directly use tbo's start address will miss the domain start offset. Need
to use gpu_offset instead.
Signed-off-by: YuBiao Wang <YuBiao.Wang@amd.com >
Reviewed-by: Christian König <christian.koenig@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2023-09-20 17:30:42 -04:00
Hamza Mahfooz
2de19022c5
drm/amd/display: fix the ability to use lower resolution modes on eDP
...
On eDP we can receive invalid modes from dm_update_crtc_state() for
entirely new streams for which drm_mode_set_crtcinfo() shouldn't be
called on. So, instead of calling drm_mode_set_crtcinfo() from within
create_stream_for_sink() we can instead call it from
amdgpu_dm_connector_mode_valid(). Since, we are guaranteed to only call
drm_mode_set_crtcinfo() for valid modes from that function (invalid
modes are rejected by that callback) and that is the only user
of create_validate_stream_for_sink() that we need to call
drm_mode_set_crtcinfo() for (as before commit cb841d27b8
("drm/amd/display: Always pass connector_state to stream validation"),
that is the only place where create_validate_stream_for_sink()'s
dm_state was NULL).
Cc: stable@vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2693
Fixes: cb841d27b8 ("drm/amd/display: Always pass connector_state to stream validation")
Tested-by: Mark Broadworth <mark.broadworth@amd.com >
Reviewed-by: Harry Wentland <harry.wentland@amd.com >
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-20 17:28:34 -04:00
Cong Liu
f387bb578d
drm/amdgpu: fix a memory leak in amdgpu_ras_feature_enable
...
This patch fixes a memory leak in the amdgpu_ras_feature_enable() function.
The leak occurs when the function sends a command to the firmware to enable
or disable a RAS feature for a GFX block. If the command fails, the kfree()
function is not called to free the info memory.
Fixes: 9f051d6ff1 ("drm/amdgpu: Free ras cmd input buffer properly")
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Cong Liu <liucong2@kylinos.cn >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-20 17:27:04 -04:00
Lijo Lazar
06cce38ef5
Revert "drm/amdgpu: Report vbios version instead of PN"
...
This reverts commit 7748ce5b69 .
vbios_version sysfs node is used to identify Part Number also. Revert to
the same so that it doesn't break scripts/software which parse this.
Signed-off-by: Lijo Lazar <lijo.lazar@amd.com >
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-20 17:26:15 -04:00
Muhammad Ahmed
6f6583e58d
drm/amd/display: Fix MST recognizes connected displays as one
...
[What]
MST now recognizes both connected displays
Fixes: 927e784c18 ("drm/amd/display: Add symclk enable/disable during stream enable/disable")
Reviewed-by: Charlene Liu <charlene.liu@amd.com >
Acked-by: Stylon Wang <stylon.wang@amd.com >
Signed-off-by: Muhammad Ahmed <ahmed.ahmed@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-20 17:23:30 -04:00
José Pekkarinen
4556b93f6c
drm/virtio: clean out_fence on complete_submit
...
The removed line prevents the following cleanup function
to execute a dma_fence_put on the out_fence to free its
memory, producing the following output in kmemleak:
unreferenced object 0xffff888126d8ee00 (size 128):
comm "kwin_wayland", pid 981, jiffies 4295380296 (age 390.060s)
hex dump (first 32 bytes):
c8 a1 c2 27 81 88 ff ff e0 14 a9 c0 ff ff ff ff ...'............
30 1a e1 2e a6 00 00 00 28 fc 5b 17 81 88 ff ff 0.......(.[.....
backtrace:
[<0000000011655661>] kmalloc_trace+0x26/0xa0
[<0000000055f15b82>] virtio_gpu_fence_alloc+0x47/0xc0 [virtio_gpu]
[<00000000fa6d96f9>] virtio_gpu_execbuffer_ioctl+0x1a8/0x800 [virtio_gpu]
[<00000000e6cb5105>] drm_ioctl_kernel+0x169/0x240 [drm]
[<000000005ad33e27>] drm_ioctl+0x399/0x6b0 [drm]
[<00000000a19dbf65>] __x64_sys_ioctl+0xc5/0x100
[<0000000011fa801e>] do_syscall_64+0x5b/0xc0
[<0000000065c76d8a>] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
unreferenced object 0xffff888121930500 (size 128):
comm "kwin_wayland", pid 981, jiffies 4295380313 (age 390.096s)
hex dump (first 32 bytes):
c8 a1 c2 27 81 88 ff ff e0 14 a9 c0 ff ff ff ff ...'............
f9 ec d7 2f a6 00 00 00 28 fc 5b 17 81 88 ff ff .../....(.[.....
backtrace:
[<0000000011655661>] kmalloc_trace+0x26/0xa0
[<0000000055f15b82>] virtio_gpu_fence_alloc+0x47/0xc0 [virtio_gpu]
[<00000000fa6d96f9>] virtio_gpu_execbuffer_ioctl+0x1a8/0x800 [virtio_gpu]
[<00000000e6cb5105>] drm_ioctl_kernel+0x169/0x240 [drm]
[<000000005ad33e27>] drm_ioctl+0x399/0x6b0 [drm]
[<00000000a19dbf65>] __x64_sys_ioctl+0xc5/0x100
[<0000000011fa801e>] do_syscall_64+0x5b/0xc0
[<0000000065c76d8a>] entry_SYSCALL_64_after_hwframe+0x6e/0xd8
[...]
This memleak will grow quickly, being possible to see the
following line in dmesg after few minutes of life in the
virtual machine:
[ 706.217388] kmemleak: 10731 new suspected memory leaks (see /sys/kernel/debug/kmemleak)
The patch will remove the line to allow the cleanup
function do its job.
Signed-off-by: José Pekkarinen <jose.pekkarinen@foxhound.fi >
Fixes: e4812ab8e6 ("drm/virtio: Refactor and optimize job submission code path")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230912060824.5210-1-jose.pekkarinen@foxhound.fi
2023-09-21 00:11:24 +03:00
Umesh Nerlige Ramappa
c524cd40e8
i915/pmu: Move execlist stats initialization to execlist specific setup
...
engine->stats is a union of execlist and guc stat objects. When execlist
specific fields are initialized, the initial state of guc stats is
affected. This results in bad busyness values when using GuC mode. Move
the execlist initialization from common code to execlist specific code.
Fixes: 77cdd054dd ("drm/i915/pmu: Connect engine busyness stats from GuC to pmu")
Signed-off-by: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com >
Reviewed-by: Alan Previn <alan.previn.teres.alexis@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230912212247.1828681-1-umesh.nerlige.ramappa@intel.com
(cherry picked from commit 4485bd519f )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-09-20 10:55:37 -04:00
Dan Carpenter
f17cc0f11f
drm/i915/gt: Prevent error pointer dereference
...
Move the check for "if (IS_ERR(obj))" in front of the call to
i915_gem_object_set_cache_coherency() which dereferences "obj".
Otherwise it will lead to a crash.
Fixes: 43aa755eae ("drm/i915/mtl: Update cache coherency setting for context structure")
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Reviewed-by: Andi Shyti <andi.shyti@linux.intel.com >
Signed-off-by: Andi Shyti <andi.shyti@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/455b2279-2e08-4d00-9784-be56d8ee42e3@moroto.mountain
(cherry picked from commit c92ec50822 )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-09-20 10:55:30 -04:00
Jani Nikula
099f0af9d9
drm/meson: fix memory leak on ->hpd_notify callback
...
The EDID returned by drm_bridge_get_edid() needs to be freed.
Fixes: 0af5e0b411 ("drm/meson: encoder_hdmi: switch to bridge DRM_BRIDGE_ATTACH_NO_CONNECTOR")
Cc: Neil Armstrong <narmstrong@baylibre.com >
Cc: Sam Ravnborg <sam@ravnborg.org >
Cc: Martin Blumenstingl <martin.blumenstingl@googlemail.com >
Cc: Neil Armstrong <neil.armstrong@linaro.org >
Cc: Kevin Hilman <khilman@baylibre.com >
Cc: Jerome Brunet <jbrunet@baylibre.com >
Cc: dri-devel@lists.freedesktop.org
Cc: linux-amlogic@lists.infradead.org
Cc: linux-arm-kernel@lists.infradead.org
Cc: stable@vger.kernel.org # v5.17+
Signed-off-by: Jani Nikula <jani.nikula@intel.com >
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20230914131015.2472029-1-jani.nikula@intel.com
2023-09-20 15:44:31 +02:00
Dan Carpenter
c5f9362307
nouveau/u_memcpya: fix NULL vs error pointer bug
...
The u_memcpya() function is supposed to return error pointers on
error. Returning NULL will lead to an Oops.
Fixes: e3885f7121 ("nouveau/u_memcpya: use vmemdup_user")
Reviewed-by: Lyude Paul <lyude@redhat.com >
Reviewed-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/10fd258b-466f-4c5b-9d48-fe61a3f21424@moroto.mountain
2023-09-20 00:20:08 +02:00
Dave Airlie
e3885f7121
nouveau/u_memcpya: use vmemdup_user
...
I think there are limit checks in place for most things but the
new uAPI wants to not have them.
Add a limit check and use the vmemdup_user helper instead.
Signed-off-by: Dave Airlie <airlied@redhat.com >
Reviewed-by: Danilo Krummrich <dakr@redhat.com >
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230810185020.231135-1-airlied@gmail.com
2023-09-20 00:15:50 +02:00
Danilo Krummrich
31499b0192
drm/nouveau: sched: fix leaking memory of timedout job
...
Always stop and re-start the scheduler in order to let the scheduler
free up the timedout job in case it got signaled. In case of exec jobs
the job type specific callback will take care to signal all fences and
tear down the channel.
Fixes: b88baab828 ("drm/nouveau: implement new VM_BIND uAPI")
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230916162835.5719-1-dakr@redhat.com
2023-09-20 00:15:50 +02:00
Danilo Krummrich
7ece3fc9b7
drm/nouveau: fence: fix type cast warning in nouveau_fence_emit()
...
Fix the following warning.
drivers/gpu/drm/nouveau/nouveau_fence.c:210:45: sparse: sparse:
incorrect type in initializer (different address spaces)
@@ expected struct nouveau_channel *chan
@@ got struct nouveau_channel [noderef] __rcu *channel
We're just about to emit the fence, there is nothing to protect against
yet, hence it is safe to just cast __rcu away.
Reported-by: kernel test robot <lkp@intel.com >
Closes: https://lore.kernel.org/oe-kbuild-all/202309140340.BwKXzaDx-lkp@intel.com/
Fixes: 978474dc82 ("drm/nouveau: fence: fix undefined fence state after emit")
Signed-off-by: Danilo Krummrich <dakr@redhat.com >
Reviewed-by: Dave Airlie <airlied@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230916011501.15813-1-dakr@redhat.com
2023-09-20 00:15:50 +02:00
Arnd Bergmann
bb6c4507fe
drm: fix up fbdev Kconfig defaults
...
As a result of the recent Kconfig reworks, the default settings for the
framebuffer interfaces changed in unexpected ways:
Configurations that leave CONFIG_FB disabled but use DRM now get
DRM_FBDEV_EMULATION by default. This also turns on the deprecated /dev/fb
device nodes for machines that don't actually want it.
In turn, configurations that previously had DRM_FBDEV_EMULATION enabled
now only get the /dev/fb front-end but not the more useful framebuffer
console, which is not selected any more.
We had previously decided that any combination of the three frontends
(FB_DEVICE, FRAMEBUFFER_CONSOLE and LOGO) should be selectable, but the
new default settings mean that a lot of defconfig files would have to
get adapted.
Change the defaults back to what they were in Linux 6.5:
- Leave DRM_FBDEV_EMULATION turned off unless CONFIG_FB
is enabled. Previously this was a hard dependency but now the two are
independent. However, configurations that enable CONFIG_FB probably
also want to keep the emulation for DRM, while those without FB
presumably did that intentionally in the past.
- Leave FB_DEVICE turned off for FB=n. Following the same
logic, the deprecated option should not automatically get enabled
here, most users that had FB turned off in the past do not want it,
even if they want the console
- Turn the FRAMEBUFFER_CONSOLE option on if
DRM_FBDEV_EMULATION is set to avoid having to change defconfig
files that relied on it being selected unconditionally in the past.
This also makes sense since both LOGO and FB_DEVICE are now disabled
by default for builds without CONFIG_FB, but DRM_FBDEV_EMULATION
would make no sense if all three are disabled.
Fixes: a5ae331edb ("drm: Drop select FRAMEBUFFER_CONSOLE for DRM_FBDEV_EMULATION")
Fixes: 701d2054fa ("fbdev: Make support for userspace interfaces configurable")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org >
Signed-off-by: Arnd Bergmann <arnd@arndb.de >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be >
Acked-by: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230911205338.2385278-1-arnd@kernel.org
2023-09-18 10:52:55 +02:00
Janusz Krzysztofik
2ba1579839
drm/tests: Fix incorrect argument in drm_test_mm_insert_range
...
While drm_mm test was converted form igt selftest to kunit, unexpected
value of "end" argument equal "start" was introduced to one of calls to a
function that executes the drm_test_mm_insert_range for specific start/end
pair of arguments. As a consequence, DRM_MM_BUG_ON(end <= start) is
triggered. Fix it by restoring the original value.
Fixes: fc8d29e298 ("drm: selftest: convert drm_mm selftest to KUnit")
Signed-off-by: Janusz Krzysztofik <janusz.krzysztofik@linux.intel.com >
Cc: "Maíra Canal" <mairacanal@riseup.net >
Cc: Arthur Grillo <arthurgrillo@riseup.net >
Cc: Javier Martinez Canillas <javierm@redhat.com >
Cc: Daniel Latypov <dlatypov@google.com >
Cc: stable@vger.kernel.org # v6.1+
Reviewed-by: Maíra Canal <mairacanal@riseup.net >
Signed-off-by: Maíra Canal <mairacanal@riseup.net >
Link: https://patchwork.freedesktop.org/patch/msgid/20230911130323.7037-2-janusz.krzysztofik@linux.intel.com
2023-09-15 11:39:48 -03:00
Dave Airlie
c3c9acb8b2
Merge tag 'drm-misc-fixes-2023-09-14' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
...
Short summary of fixes pull:
* radeon: Uninterruptible fence waiting
* tests: Fix use-after-free bug
* vkms: Revert hrtimer fix
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Thomas Zimmermann <tzimmermann@suse.de >
Link: https://patchwork.freedesktop.org/patch/msgid/20230914122649.GA28252@linux-uq9g
2023-09-15 12:13:01 +10:00
Dave Airlie
c6fbd2b0ca
Merge tag 'drm-intel-fixes-2023-09-14' of git://anongit.freedesktop.org/drm/drm-intel into drm-fixes
...
- Only check eDP HPD when AUX CH is shared.
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Rodrigo Vivi <rodrigo.vivi@intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/ZQL+NqtIZH5F/Nxr@intel.com
2023-09-15 10:12:24 +10:00
Dave Airlie
1216d49178
Merge tag 'amd-drm-fixes-6.6-2023-09-13' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
...
amd-drm-fixes-6.6-2023-09-13:
amdgpu:
- GC 9.4.3 fixes
- Fix white screen issues with S/G display on system with >= 64G of ram
- Replay fixes
- SMU 13.0.6 fixes
- AUX backlight fix
- NBIO 4.3 SR-IOV fixes for HDP
- RAS fixes
- DP MST resume fix
- Fix segfault on systems with no vbios
- DPIA fixes
amdkfd:
- CWSR grace period fix
- Unaligned doorbell fix
- CRIU fix for GFX11
- Add missing TLB flush on gfx10 and newer
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Alex Deucher <alexander.deucher@amd.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230913195009.7714-1-alexander.deucher@amd.com
2023-09-15 09:50:50 +10:00
Daniel Vetter
15794f9dc3
Merge tag 'drm-misc-fixes-2023-09-07' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
...
One doc fix for drm/connector, one fix for amdgpu for an crash when
VRAM usage is high, and one fix in gm12u320 to fix the timeout units in
the code
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch >
From: Maxime Ripard <mripard@redhat.com >
Link: https://patchwork.freedesktop.org/patch/msgid/w5nlld5ukeh6bgtljsxmkex3e7s7f4qquuqkv5lv4cv3uxzwqr@pgokpejfsyef
2023-09-14 14:00:51 +02:00
Maíra Canal
7908632f29
Revert "drm/vkms: Fix race-condition between the hrtimer and the atomic commit"
...
This reverts commit a0e6a017ab .
Unlocking a mutex in the context of a hrtimer callback is violating mutex
locking rules, as mutex_unlock() from interrupt context is not permitted.
Link: https://lore.kernel.org/dri-devel/ZQLAc%2FFwkv%2FGiVoK@phenom.ffwll.local/T/#t
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch >
Signed-off-by: Maíra Canal <mcanal@igalia.com >
Signed-off-by: Maíra Canal <mairacanal@riseup.net >
Link: https://patchwork.freedesktop.org/patch/msgid/20230914102024.1789154-1-mcanal@igalia.com
2023-09-14 07:48:19 -03:00
Harish Kasiviswanathan
edcfe22985
drm/amdkfd: Insert missing TLB flush on GFX10 and later
...
Heavy-weight TLB flush is required after unmap on all GPUs for
correctness and security.
Signed-off-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2023-09-12 17:45:40 -04:00
Ville Syrjälä
7c95ec3b59
drm/i915: Only check eDP HPD when AUX CH is shared
...
Apparently Acer Chromebook C740 (BDW-ULT) doesn't have the
eDP HPD line properly connected, and thus fails the new
HPD check during eDP probe. The result is that we lose the
eDP output.
I suspect all such machines would be Chromebooks or other
Linux exclusive systems as the Windows driver likely wouldn't
work either. I did check a few other BDW machines here and
those do have eDP HPD connected, one of them even is a
different Chromebook (Samus).
To account for these funky machines let's skip the HPD check when
it looks like the eDP port is the only one using that specific AUX
channel. In case of multiple ports sharing the same AUX CH (eg. on
Asrock B250M-HDV) we still do the check and thus should correctly
ignore the eDP port in favor of the other DP port (usually a DP->VGA
converter).
v2: Don't oops during list iteration
Cc: stable@vger.kernel.org
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9264
Fixes: cfe5bdfb27 ("drm/i915: Check HPD live state during eDP probe")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20230908052527.685-1-ville.syrjala@linux.intel.com
Reviewed-by: Luca Coelho <luciano.coelho@intel.com >
(cherry picked from commit 70052100fa )
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com >
2023-09-12 08:35:32 -04:00
Thomas Zimmermann
c900529f3d
Merge drm/drm-fixes into drm-misc-fixes
...
Forwarding to v6.6-rc1.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2023-09-12 08:53:30 +02:00
Mustapha Ghaddar
2931937844
drm/amd/display: Fix 2nd DPIA encoder Assignment
...
[HOW & Why]
There seems to be an issue with 2nd DPIA acquiring link encoder for tiled displays.
Solution is to remove check for eng_id before we get first dynamic encoder for it
Reviewed-by: Cruise Hung <cruise.hung@amd.com >
Reviewed-by: Meenakshikumar Somasundaram <meenakshikumar.somasundaram@amd.com >
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Acked-by: Stylon Wang <stylon.wang@amd.com >
Signed-off-by: Mustapha Ghaddar <mghaddar@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:30:15 -04:00
Mustapha Ghaddar
64be47ba28
drm/amd/display: Add DPIA Link Encoder Assignment Fix
...
For DPIA we should have preferred DIG assignment based on DPIA selected
as per the ASIC design.
Reviewed-by: George Shen <george.shen@amd.com >
Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Mustapha Ghaddar <mghaddar@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
2023-09-11 18:30:03 -04:00
Randy Dunlap
db5494a852
drm/amd/display: fix replay_mode kernel-doc warning
...
Fix the typo in the kernel-doc for @replay_mode to prevent
kernel-doc warnings:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:623: warning: Incorrect use of kernel-doc format: * @replay mode: Replay supported
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h:626: warning: Function parameter or member 'replay_mode' not described in 'amdgpu_hdmi_vsdb_info'
Fixes: ec8e59cb4e ("drm/amd/display: Get replay info from VSDB")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Reported-by: kernel test robot <lkp@intel.com >
Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com >
Cc: Harry Wentland <harry.wentland@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: Leo Li <sunpeng.li@amd.com >
Cc: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com >
Cc: amd-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:25:39 -04:00
David Francis
5e7e822542
drm/amdgpu: Handle null atom context in VBIOS info ioctl
...
On some APU systems, there is no atom context and so the
atom_context struct is null.
Add a check to the VBIOS_INFO branch of amdgpu_info_ioctl
to handle this case, returning all zeroes.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: David Francis <David.Francis@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:25:26 -04:00
David Francis
9296da8c40
drm/amdkfd: Checkpoint and restore queues on GFX11
...
The code in kfd_mqd_manager_v11.c to support criu dump and
restore of queue state was missing.
Added it; should be equivalent to kfd_mqd_manager_v10.c.
CC: Felix Kuehling <felix.kuehling@amd.com >
Reviewed-by: Harish Kasiviswanathan <Harish.Kasiviswanathan@amd.com >
Acked-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: David Francis <David.Francis@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:22:38 -04:00
Wayne Lin
ec5fa9fcde
drm/amd/display: Adjust the MST resume flow
...
[Why]
In drm_dp_mst_topology_mgr_resume() today, it will resume the
mst branch to be ready handling mst mode and also consecutively do
the mst topology probing. Which will cause the dirver have chance
to fire hotplug event before restoring the old state. Then Userspace
will react to the hotplug event based on a wrong state.
[How]
Adjust the mst resume flow as:
1. set dpcd to resume mst branch status
2. restore source old state
3. Do mst resume topology probing
For drm_dp_mst_topology_mgr_resume(), it's better to adjust it to
pull out topology probing work into a 2nd part procedure of the mst
resume. Will have a follow up patch in drm.
Reviewed-by: Chao-kai Wang <stylon.wang@amd.com >
Cc: Mario Limonciello <mario.limonciello@amd.com >
Cc: Alex Deucher <alexander.deucher@amd.com >
Cc: stable@vger.kernel.org
Acked-by: Stylon Wang <stylon.wang@amd.com >
Signed-off-by: Wayne Lin <wayne.lin@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:21:50 -04:00
Hawking Zhang
ffd6bde302
drm/amdgpu: fallback to old RAS error message for aqua_vanjaram
...
So driver doesn't generate incorrect message until
the new format is settled down for aqua_vanjaram
Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com >
Reviewed-by: Yang Wang <kevinyang.wang@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:20:07 -04:00
Alex Deucher
ab43213e7a
drm/amdgpu/nbio4.3: set proper rmmio_remap.reg_offset for SR-IOV
...
Needed for HDP flush to work correctly.
Reviewed-by: Timmy Tsai <timmtsai@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:19:48 -04:00
Alex Deucher
1832403cd4
drm/amdgpu/soc21: don't remap HDP registers for SR-IOV
...
This matches the behavior for soc15 and nv.
Acked-by: Christian König <christian.koenig@amd.com >
Reviewed-by: Timmy Tsai <timmtsai@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:19:42 -04:00
Swapnil Patel
f5b2c10b57
drm/amd/display: Don't check registers, if using AUX BL control
...
[Why]
Currently the driver looks DCN registers to access if BL is on or not.
This check is not valid if we are using AUX based brightness control.
This causes driver to not send out "backlight off" command during power off
sequence as it already thinks it is off.
[How]
Only check DCN registers if we aren't using AUX based brightness control.
Reviewed-by: Wenjing Liu <wenjing.liu@amd.com >
Acked-by: Stylon Wang <stylon.wang@amd.com >
Signed-off-by: Swapnil Patel <swapnil.patel@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:19:31 -04:00
Dan Carpenter
81cc8779cf
drm/amdgpu: fix retry loop test
...
This loop will exit with "retry" set to -1 if it fails but the code
checks for if "retry" is zero. Fix this by changing post-op to a
pre-op. --retry vs retry--.
Fixes: e01eeffc3f ("drm/amd/pm: avoid driver getting empty metrics table for the first time")
Reviewed-by: Evan Quan <evan.quan@amd.com >
Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:19:03 -04:00
Bhawanpreet Lakha
679fc891bf
drm/amd/display: Add dirty rect support for Replay
...
Dirty rect can be used with replay, so enable them to allow for more
powersaving.
Reviewed-by: Sun peng Li <sunpeng.li@amd.com >
Acked-by: Stylon Wang <stylon.wang@amd.com >
Signed-off-by: Bhawanpreet Lakha <bhawanpreet.lakha@amd.com >
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:18:53 -04:00
Hamza Mahfooz
169ed4ece8
Revert "drm/amd: Disable S/G for APUs when 64GB or more host memory"
...
This reverts commit 70e64c4d52 .
Since, we now have an actual fix for this issue, we can get rid of this
workaround as it can cause pin failures if enough VRAM isn't carved out
by the BIOS.
Cc: stable@vger.kernel.org # 6.1+
Acked-by: Harry Wentland <harry.wentland@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:18:17 -04:00
Yifan Zhang
ef064187a9
drm/amd/display: fix the white screen issue when >= 64GB DRAM
...
Dropping bit 31:4 of page table base is wrong, it makes page table
base points to wrong address if phys addr is beyond 64GB; dropping
page_table_start/end bit 31:4 is unnecessary since dcn20_vmid_setup
will do that. Also, while we are at it, cleanup the assignments using
upper_32_bits()/lower_32_bits() and AMDGPU_GPU_PAGE_SHIFT.
Cc: stable@vger.kernel.org
Link: https://gitlab.freedesktop.org/drm/amd/-/issues/2354
Fixes: 81d0bcf990 ("drm/amdgpu: make display pinning more flexible (v2)")
Acked-by: Harry Wentland <harry.wentland@amd.com >
Reviewed-by: Alex Deucher <alexander.deucher@amd.com >
Signed-off-by: Yifan Zhang <yifan1.zhang@amd.com >
Co-developed-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Hamza Mahfooz <hamza.mahfooz@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:18:09 -04:00
Mukul Joshi
fc6efed2c7
drm/amdkfd: Update CU masking for GFX 9.4.3
...
The CU mask passed from user-space will change based on
different spatial partitioning mode. As a result, update
CU masking code for GFX9.4.3 to work for all partitioning
modes.
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:17:27 -04:00
Mukul Joshi
0752e66e91
drm/amdkfd: Update cache info reporting for GFX v9.4.3
...
Update cache info reporting in sysfs to report the correct
number of CUs and associated cache information based on
different spatial partitioning modes.
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com >
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com >
Signed-off-by: Alex Deucher <alexander.deucher@amd.com >
2023-09-11 18:17:20 -04:00