* Re: [PATCH] mfd: stmfx: Fix an endian bug in stmfx_irq_handler()
From: Amelie DELAUNAY @ 2019-06-20 15:18 UTC (permalink / raw)
To: Lee Jones, Linus Torvalds
Cc: Dan Carpenter, Maxime Coquelin, Alexandre TORGUE,
linux-stm32@st-md-mailman.stormreply.com, Linux ARM,
Linux List Kernel Mailing, kernel-janitors@vger.kernel.org
In-Reply-To: <20190619055816.GF18371@dell>
On 6/19/19 7:58 AM, Lee Jones wrote:
> On Tue, 18 Jun 2019, Linus Torvalds wrote:
>
>> On Tue, Jun 18, 2019 at 1:16 AM Lee Jones <lee.jones@linaro.org> wrote:
>>>
>>>> Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
>>>
>>> Ideally we can get a review too.
>>
>> Looks fine to me, but obviously somebody should actually _test_ it too.
>
> Amelie, would you be so kind?
>
Tested on stm32mp157c-ev1.
Tested-by: Amelie Delaunay <amelie.delaunay@st.com>
^ permalink raw reply
* Re: [PATCH] drm/amdgpu: set max df perfmon to 4
From: Kuehling, Felix @ 2019-06-20 15:19 UTC (permalink / raw)
To: Kim, Jonathan,
amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
In-Reply-To: <20190620051811.118880-1-jonathan.kim-5C7GfCeVMHo@public.gmane.org>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
On 2019-06-20 1:18, Kim, Jonathan wrote:
> fixed df permon to 4 and remove not needed ret
>
> Change-Id: Ia9897612937e652e7f8a09c1d23bb1c0e6f3d8f7
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +-
> drivers/gpu/drm/amd/amdgpu/soc15.c | 1 -
> 2 files changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index b227c956b8a9..c3ed09cd2678 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -732,7 +732,7 @@ struct amd_powerplay {
> };
>
> #define AMDGPU_RESET_MAGIC_NUM 64
> -#define AMDGPU_MAX_DF_PERFMONS 16
> +#define AMDGPU_MAX_DF_PERFMONS 4
> struct amdgpu_device {
> struct device *dev;
> struct drm_device *ddev;
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 0afbcc80ea61..014549a30446 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -1067,7 +1067,6 @@ static void soc15_doorbell_range_init(struct amdgpu_device *adev)
> static int soc15_common_hw_init(void *handle)
> {
> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> - int ret;
>
> /* enable pcie gen2/3 link */
> soc15_pcie_gen3_enable(adev);
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply
* [PATCH v2 1/3] mm: add filemap_fdatawait_range_keep_errors()
From: Ross Zwisler @ 2019-06-20 15:18 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Theodore Ts'o, Alexander Viro, Andreas Dilger,
Jan Kara, linux-ext4, linux-fsdevel, linux-mm, Fletcher Woodruff,
Justin TerAvest, Jan Kara, stable
In-Reply-To: <20190620151839.195506-1-zwisler@google.com>
In the spirit of filemap_fdatawait_range() and
filemap_fdatawait_keep_errors(), introduce
filemap_fdatawait_range_keep_errors() which both takes a range upon
which to wait and does not clear errors from the address space.
Signed-off-by: Ross Zwisler <zwisler@google.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org
---
include/linux/fs.h | 2 ++
mm/filemap.c | 22 ++++++++++++++++++++++
2 files changed, 24 insertions(+)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f7fdfe93e25d3..79fec8a8413f4 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2712,6 +2712,8 @@ extern int filemap_flush(struct address_space *);
extern int filemap_fdatawait_keep_errors(struct address_space *mapping);
extern int filemap_fdatawait_range(struct address_space *, loff_t lstart,
loff_t lend);
+extern int filemap_fdatawait_range_keep_errors(struct address_space *mapping,
+ loff_t start_byte, loff_t end_byte);
static inline int filemap_fdatawait(struct address_space *mapping)
{
diff --git a/mm/filemap.c b/mm/filemap.c
index df2006ba0cfa5..e87252ca0835a 100644
--- a/mm/filemap.c
+++ b/mm/filemap.c
@@ -553,6 +553,28 @@ int filemap_fdatawait_range(struct address_space *mapping, loff_t start_byte,
}
EXPORT_SYMBOL(filemap_fdatawait_range);
+/**
+ * filemap_fdatawait_range_keep_errors - wait for writeback to complete
+ * @mapping: address space structure to wait for
+ * @start_byte: offset in bytes where the range starts
+ * @end_byte: offset in bytes where the range ends (inclusive)
+ *
+ * Walk the list of under-writeback pages of the given address space in the
+ * given range and wait for all of them. Unlike filemap_fdatawait_range(),
+ * this function does not clear error status of the address space.
+ *
+ * Use this function if callers don't handle errors themselves. Expected
+ * call sites are system-wide / filesystem-wide data flushers: e.g. sync(2),
+ * fsfreeze(8)
+ */
+int filemap_fdatawait_range_keep_errors(struct address_space *mapping,
+ loff_t start_byte, loff_t end_byte)
+{
+ __filemap_fdatawait_range(mapping, start_byte, end_byte);
+ return filemap_check_and_keep_errors(mapping);
+}
+EXPORT_SYMBOL(filemap_fdatawait_range_keep_errors);
+
/**
* file_fdatawait_range - wait for writeback to complete
* @file: file pointing to address space structure to wait for
--
2.22.0.410.gd8fdbe21b5-goog
^ permalink raw reply related
* [PATCH v2 2/3] jbd2: introduce jbd2_inode dirty range scoping
From: Ross Zwisler @ 2019-06-20 15:18 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Theodore Ts'o, Alexander Viro, Andreas Dilger,
Jan Kara, linux-ext4, linux-fsdevel, linux-mm, Fletcher Woodruff,
Justin TerAvest, Jan Kara, stable
In-Reply-To: <20190620151839.195506-1-zwisler@google.com>
Currently both journal_submit_inode_data_buffers() and
journal_finish_inode_data_buffers() operate on the entire address space
of each of the inodes associated with a given journal entry. The
consequence of this is that if we have an inode where we are constantly
appending dirty pages we can end up waiting for an indefinite amount of
time in journal_finish_inode_data_buffers() while we wait for all the
pages under writeback to be written out.
The easiest way to cause this type of workload is do just dd from
/dev/zero to a file until it fills the entire filesystem. This can
cause journal_finish_inode_data_buffers() to wait for the duration of
the entire dd operation.
We can improve this situation by scoping each of the inode dirty ranges
associated with a given transaction. We do this via the jbd2_inode
structure so that the scoping is contained within jbd2 and so that it
follows the lifetime and locking rules for that structure.
This allows us to limit the writeback & wait in
journal_submit_inode_data_buffers() and
journal_finish_inode_data_buffers() respectively to the dirty range for
a given struct jdb2_inode, keeping us from waiting forever if the inode
in question is still being appended to.
Signed-off-by: Ross Zwisler <zwisler@google.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org
---
fs/jbd2/commit.c | 23 ++++++++++++++------
fs/jbd2/journal.c | 2 ++
fs/jbd2/transaction.c | 49 ++++++++++++++++++++++++-------------------
include/linux/jbd2.h | 22 +++++++++++++++++++
4 files changed, 69 insertions(+), 27 deletions(-)
diff --git a/fs/jbd2/commit.c b/fs/jbd2/commit.c
index efd0ce9489ae9..668f9021cf115 100644
--- a/fs/jbd2/commit.c
+++ b/fs/jbd2/commit.c
@@ -187,14 +187,15 @@ static int journal_wait_on_commit_record(journal_t *journal,
* use writepages() because with dealyed allocation we may be doing
* block allocation in writepages().
*/
-static int journal_submit_inode_data_buffers(struct address_space *mapping)
+static int journal_submit_inode_data_buffers(struct address_space *mapping,
+ loff_t dirty_start, loff_t dirty_end)
{
int ret;
struct writeback_control wbc = {
.sync_mode = WB_SYNC_ALL,
.nr_to_write = mapping->nrpages * 2,
- .range_start = 0,
- .range_end = i_size_read(mapping->host),
+ .range_start = dirty_start,
+ .range_end = dirty_end,
};
ret = generic_writepages(mapping, &wbc);
@@ -218,6 +219,9 @@ static int journal_submit_data_buffers(journal_t *journal,
spin_lock(&journal->j_list_lock);
list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) {
+ loff_t dirty_start = jinode->i_dirty_start;
+ loff_t dirty_end = jinode->i_dirty_end;
+
if (!(jinode->i_flags & JI_WRITE_DATA))
continue;
mapping = jinode->i_vfs_inode->i_mapping;
@@ -230,7 +234,8 @@ static int journal_submit_data_buffers(journal_t *journal,
* only allocated blocks here.
*/
trace_jbd2_submit_inode_data(jinode->i_vfs_inode);
- err = journal_submit_inode_data_buffers(mapping);
+ err = journal_submit_inode_data_buffers(mapping, dirty_start,
+ dirty_end);
if (!ret)
ret = err;
spin_lock(&journal->j_list_lock);
@@ -257,12 +262,16 @@ static int journal_finish_inode_data_buffers(journal_t *journal,
/* For locking, see the comment in journal_submit_data_buffers() */
spin_lock(&journal->j_list_lock);
list_for_each_entry(jinode, &commit_transaction->t_inode_list, i_list) {
+ loff_t dirty_start = jinode->i_dirty_start;
+ loff_t dirty_end = jinode->i_dirty_end;
+
if (!(jinode->i_flags & JI_WAIT_DATA))
continue;
jinode->i_flags |= JI_COMMIT_RUNNING;
spin_unlock(&journal->j_list_lock);
- err = filemap_fdatawait_keep_errors(
- jinode->i_vfs_inode->i_mapping);
+ err = filemap_fdatawait_range_keep_errors(
+ jinode->i_vfs_inode->i_mapping, dirty_start,
+ dirty_end);
if (!ret)
ret = err;
spin_lock(&journal->j_list_lock);
@@ -282,6 +291,8 @@ static int journal_finish_inode_data_buffers(journal_t *journal,
&jinode->i_transaction->t_inode_list);
} else {
jinode->i_transaction = NULL;
+ jinode->i_dirty_start = 0;
+ jinode->i_dirty_end = 0;
}
}
spin_unlock(&journal->j_list_lock);
diff --git a/fs/jbd2/journal.c b/fs/jbd2/journal.c
index 43df0c943229c..288b8e7cf21c7 100644
--- a/fs/jbd2/journal.c
+++ b/fs/jbd2/journal.c
@@ -2574,6 +2574,8 @@ void jbd2_journal_init_jbd_inode(struct jbd2_inode *jinode, struct inode *inode)
jinode->i_next_transaction = NULL;
jinode->i_vfs_inode = inode;
jinode->i_flags = 0;
+ jinode->i_dirty_start = 0;
+ jinode->i_dirty_end = 0;
INIT_LIST_HEAD(&jinode->i_list);
}
diff --git a/fs/jbd2/transaction.c b/fs/jbd2/transaction.c
index 8ca4fddc705fe..990e7b5062e74 100644
--- a/fs/jbd2/transaction.c
+++ b/fs/jbd2/transaction.c
@@ -2565,7 +2565,7 @@ void jbd2_journal_refile_buffer(journal_t *journal, struct journal_head *jh)
* File inode in the inode list of the handle's transaction
*/
static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,
- unsigned long flags)
+ unsigned long flags, loff_t start_byte, loff_t end_byte)
{
transaction_t *transaction = handle->h_transaction;
journal_t *journal;
@@ -2577,26 +2577,17 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,
jbd_debug(4, "Adding inode %lu, tid:%d\n", jinode->i_vfs_inode->i_ino,
transaction->t_tid);
- /*
- * First check whether inode isn't already on the transaction's
- * lists without taking the lock. Note that this check is safe
- * without the lock as we cannot race with somebody removing inode
- * from the transaction. The reason is that we remove inode from the
- * transaction only in journal_release_jbd_inode() and when we commit
- * the transaction. We are guarded from the first case by holding
- * a reference to the inode. We are safe against the second case
- * because if jinode->i_transaction == transaction, commit code
- * cannot touch the transaction because we hold reference to it,
- * and if jinode->i_next_transaction == transaction, commit code
- * will only file the inode where we want it.
- */
- if ((jinode->i_transaction == transaction ||
- jinode->i_next_transaction == transaction) &&
- (jinode->i_flags & flags) == flags)
- return 0;
-
spin_lock(&journal->j_list_lock);
jinode->i_flags |= flags;
+
+ if (jinode->i_dirty_end) {
+ jinode->i_dirty_start = min(jinode->i_dirty_start, start_byte);
+ jinode->i_dirty_end = max(jinode->i_dirty_end, end_byte);
+ } else {
+ jinode->i_dirty_start = start_byte;
+ jinode->i_dirty_end = end_byte;
+ }
+
/* Is inode already attached where we need it? */
if (jinode->i_transaction == transaction ||
jinode->i_next_transaction == transaction)
@@ -2631,12 +2622,28 @@ static int jbd2_journal_file_inode(handle_t *handle, struct jbd2_inode *jinode,
int jbd2_journal_inode_add_write(handle_t *handle, struct jbd2_inode *jinode)
{
return jbd2_journal_file_inode(handle, jinode,
- JI_WRITE_DATA | JI_WAIT_DATA);
+ JI_WRITE_DATA | JI_WAIT_DATA, 0, LLONG_MAX);
}
int jbd2_journal_inode_add_wait(handle_t *handle, struct jbd2_inode *jinode)
{
- return jbd2_journal_file_inode(handle, jinode, JI_WAIT_DATA);
+ return jbd2_journal_file_inode(handle, jinode, JI_WAIT_DATA, 0,
+ LLONG_MAX);
+}
+
+int jbd2_journal_inode_ranged_write(handle_t *handle,
+ struct jbd2_inode *jinode, loff_t start_byte, loff_t length)
+{
+ return jbd2_journal_file_inode(handle, jinode,
+ JI_WRITE_DATA | JI_WAIT_DATA, start_byte,
+ start_byte + length - 1);
+}
+
+int jbd2_journal_inode_ranged_wait(handle_t *handle, struct jbd2_inode *jinode,
+ loff_t start_byte, loff_t length)
+{
+ return jbd2_journal_file_inode(handle, jinode, JI_WAIT_DATA,
+ start_byte, start_byte + length - 1);
}
/*
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 5c04181b7c6d8..0e0393e7f41a4 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -451,6 +451,22 @@ struct jbd2_inode {
* @i_flags: Flags of inode [j_list_lock]
*/
unsigned long i_flags;
+
+ /**
+ * @i_dirty_start:
+ *
+ * Offset in bytes where the dirty range for this inode starts.
+ * [j_list_lock]
+ */
+ loff_t i_dirty_start;
+
+ /**
+ * @i_dirty_end:
+ *
+ * Inclusive offset in bytes where the dirty range for this inode
+ * ends. [j_list_lock]
+ */
+ loff_t i_dirty_end;
};
struct jbd2_revoke_table_s;
@@ -1397,6 +1413,12 @@ extern int jbd2_journal_force_commit(journal_t *);
extern int jbd2_journal_force_commit_nested(journal_t *);
extern int jbd2_journal_inode_add_write(handle_t *handle, struct jbd2_inode *inode);
extern int jbd2_journal_inode_add_wait(handle_t *handle, struct jbd2_inode *inode);
+extern int jbd2_journal_inode_ranged_write(handle_t *handle,
+ struct jbd2_inode *inode, loff_t start_byte,
+ loff_t length);
+extern int jbd2_journal_inode_ranged_wait(handle_t *handle,
+ struct jbd2_inode *inode, loff_t start_byte,
+ loff_t length);
extern int jbd2_journal_begin_ordered_truncate(journal_t *journal,
struct jbd2_inode *inode, loff_t new_size);
extern void jbd2_journal_init_jbd_inode(struct jbd2_inode *jinode, struct inode *inode);
--
2.22.0.410.gd8fdbe21b5-goog
^ permalink raw reply related
* [PATCH v2 3/3] ext4: use jbd2_inode dirty range scoping
From: Ross Zwisler @ 2019-06-20 15:18 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Theodore Ts'o, Alexander Viro, Andreas Dilger,
Jan Kara, linux-ext4, linux-fsdevel, linux-mm, Fletcher Woodruff,
Justin TerAvest, Jan Kara, stable
In-Reply-To: <20190620151839.195506-1-zwisler@google.com>
Use the newly introduced jbd2_inode dirty range scoping to prevent us
from waiting forever when trying to complete a journal transaction.
Signed-off-by: Ross Zwisler <zwisler@google.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Cc: stable@vger.kernel.org
---
fs/ext4/ext4_jbd2.h | 12 ++++++------
fs/ext4/inode.c | 13 ++++++++++---
fs/ext4/move_extent.c | 3 ++-
3 files changed, 18 insertions(+), 10 deletions(-)
diff --git a/fs/ext4/ext4_jbd2.h b/fs/ext4/ext4_jbd2.h
index 75a5309f22315..ef8fcf7d0d3b3 100644
--- a/fs/ext4/ext4_jbd2.h
+++ b/fs/ext4/ext4_jbd2.h
@@ -361,20 +361,20 @@ static inline int ext4_journal_force_commit(journal_t *journal)
}
static inline int ext4_jbd2_inode_add_write(handle_t *handle,
- struct inode *inode)
+ struct inode *inode, loff_t start_byte, loff_t length)
{
if (ext4_handle_valid(handle))
- return jbd2_journal_inode_add_write(handle,
- EXT4_I(inode)->jinode);
+ return jbd2_journal_inode_ranged_write(handle,
+ EXT4_I(inode)->jinode, start_byte, length);
return 0;
}
static inline int ext4_jbd2_inode_add_wait(handle_t *handle,
- struct inode *inode)
+ struct inode *inode, loff_t start_byte, loff_t length)
{
if (ext4_handle_valid(handle))
- return jbd2_journal_inode_add_wait(handle,
- EXT4_I(inode)->jinode);
+ return jbd2_journal_inode_ranged_wait(handle,
+ EXT4_I(inode)->jinode, start_byte, length);
return 0;
}
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
index c7f77c6430085..27fec5c594459 100644
--- a/fs/ext4/inode.c
+++ b/fs/ext4/inode.c
@@ -731,10 +731,16 @@ int ext4_map_blocks(handle_t *handle, struct inode *inode,
!(flags & EXT4_GET_BLOCKS_ZERO) &&
!ext4_is_quota_file(inode) &&
ext4_should_order_data(inode)) {
+ loff_t start_byte =
+ (loff_t)map->m_lblk << inode->i_blkbits;
+ loff_t length = (loff_t)map->m_len << inode->i_blkbits;
+
if (flags & EXT4_GET_BLOCKS_IO_SUBMIT)
- ret = ext4_jbd2_inode_add_wait(handle, inode);
+ ret = ext4_jbd2_inode_add_wait(handle, inode,
+ start_byte, length);
else
- ret = ext4_jbd2_inode_add_write(handle, inode);
+ ret = ext4_jbd2_inode_add_write(handle, inode,
+ start_byte, length);
if (ret)
return ret;
}
@@ -4085,7 +4091,8 @@ static int __ext4_block_zero_page_range(handle_t *handle,
err = 0;
mark_buffer_dirty(bh);
if (ext4_should_order_data(inode))
- err = ext4_jbd2_inode_add_write(handle, inode);
+ err = ext4_jbd2_inode_add_write(handle, inode, from,
+ length);
}
unlock:
diff --git a/fs/ext4/move_extent.c b/fs/ext4/move_extent.c
index 1083a9f3f16a1..c7ded4e2adff5 100644
--- a/fs/ext4/move_extent.c
+++ b/fs/ext4/move_extent.c
@@ -390,7 +390,8 @@ move_extent_per_page(struct file *o_filp, struct inode *donor_inode,
/* Even in case of data=writeback it is reasonable to pin
* inode to transaction, to prevent unexpected data loss */
- *err = ext4_jbd2_inode_add_write(handle, orig_inode);
+ *err = ext4_jbd2_inode_add_write(handle, orig_inode,
+ (loff_t)orig_page_offset << PAGE_SHIFT, replaced_size);
unlock_pages:
unlock_page(pagep[0]);
--
2.22.0.410.gd8fdbe21b5-goog
^ permalink raw reply related
* Re: [Qemu-devel] [PATCH 02/12] block/backup: Add mirror sync mode 'bitmap'
From: Max Reitz @ 2019-06-20 15:00 UTC (permalink / raw)
To: John Snow, qemu-devel, qemu-block
Cc: Kevin Wolf, Fam Zheng, vsementsov, Wen Congyang, Xie Changlong,
Markus Armbruster
In-Reply-To: <20190620010356.19164-3-jsnow@redhat.com>
[-- Attachment #1.1: Type: text/plain, Size: 7971 bytes --]
On 20.06.19 03:03, John Snow wrote:
> We don't need or want a new sync mode for simple differences in
> semantics. Create a new mode simply named "BITMAP" that is designed to
> make use of the new Bitmap Sync Mode field.
>
> Because the only bitmap mode is 'conditional', this adds no new
> functionality to the backup job (yet). The old incremental backup mode
> is maintained as a syntactic sugar for sync=bitmap, mode=conditional.
>
> Add all of the plumbing necessary to support this new instruction.
>
> Signed-off-by: John Snow <jsnow@redhat.com>
> ---
> qapi/block-core.json | 30 ++++++++++++++++++++++--------
> include/block/block_int.h | 6 +++++-
> block/backup.c | 35 ++++++++++++++++++++++++++++-------
> block/mirror.c | 6 ++++--
> block/replication.c | 2 +-
> blockdev.c | 8 ++++++--
> 6 files changed, 66 insertions(+), 21 deletions(-)
>
> diff --git a/qapi/block-core.json b/qapi/block-core.json
> index caf28a71a0..6d05ad8f47 100644
> --- a/qapi/block-core.json
> +++ b/qapi/block-core.json
> @@ -1127,12 +1127,15 @@
> #
> # @none: only copy data written from now on
> #
> -# @incremental: only copy data described by the dirty bitmap. Since: 2.4
> +# @incremental: only copy data described by the dirty bitmap. (since: 2.4)
Why not deprecate this in the process and note that this is equal to
sync=bitmap, bitmap-mode=conditional?
(I don’t think there is a rule that forces us to actually remove
deprecated stuff after two releases if it doesn’t hurt to keep it.)
> +#
> +# @bitmap: only copy data described by the dirty bitmap. (since: 4.1)
> +# Behavior on completion is determined by the BitmapSyncMode.
> #
> # Since: 1.3
> ##
> { 'enum': 'MirrorSyncMode',
> - 'data': ['top', 'full', 'none', 'incremental'] }
> + 'data': ['top', 'full', 'none', 'incremental', 'bitmap'] }
>
> ##
> # @BitmapSyncMode:
> @@ -1352,10 +1355,14 @@
> #
> # @speed: the maximum speed, in bytes per second
> #
> -# @bitmap: the name of dirty bitmap if sync is "incremental".
> -# Must be present if sync is "incremental", must NOT be present
> +# @bitmap: the name of dirty bitmap if sync is "bitmap".
> +# Must be present if sync is "bitmap", must NOT be present
> # otherwise. (Since 2.4)
Er, well, now this is too fast of a deprecation. :-) It must still also
be present if sync is “incremental”.
> #
> +# @bitmap-mode: Specifies the type of data the bitmap should contain after
> +# the operation concludes. Must be present if sync is "bitmap".
> +# Must NOT be present otherwise. (Since 4.1)
Do we have any rule that qemu must enforce “must not”s? :-)
(No, I don’t think so. I think it’s very reasonable that you accept
bitmap-mode=conditional for sync=incremental.)
> # @compress: true to compress data, if the target format supports it.
> # (default: false) (since 2.8)
> #
> @@ -1390,7 +1397,8 @@
> 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
> '*format': 'str', 'sync': 'MirrorSyncMode',
> '*mode': 'NewImageMode', '*speed': 'int',
> - '*bitmap': 'str', '*compress': 'bool',
> + '*bitmap': 'str', '*bitmap-mode': 'BitmapSyncMode',
> + '*compress': 'bool',
> '*on-source-error': 'BlockdevOnError',
> '*on-target-error': 'BlockdevOnError',
> '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
> @@ -1412,10 +1420,14 @@
> # @speed: the maximum speed, in bytes per second. The default is 0,
> # for unlimited.
> #
> -# @bitmap: the name of dirty bitmap if sync is "incremental".
> -# Must be present if sync is "incremental", must NOT be present
> +# @bitmap: the name of dirty bitmap if sync is "bitmap".
> +# Must be present if sync is "bitmap", must NOT be present
> # otherwise. (Since 3.1)
Same as above.
> +# @bitmap-mode: Specifies the type of data the bitmap should contain after
> +# the operation concludes. Must be present if sync is "bitmap".
> +# Must NOT be present otherwise. (Since 4.1)
> +#
> # @compress: true to compress data, if the target format supports it.
> # (default: false) (since 2.8)
> #
> @@ -1449,7 +1461,9 @@
> { 'struct': 'BlockdevBackup',
> 'data': { '*job-id': 'str', 'device': 'str', 'target': 'str',
> 'sync': 'MirrorSyncMode', '*speed': 'int',
> - '*bitmap': 'str', '*compress': 'bool',
> + '*bitmap': 'str',
> + '*bitmap-mode': 'BitmapSyncMode',
> + '*compress': 'bool',
> '*on-source-error': 'BlockdevOnError',
> '*on-target-error': 'BlockdevOnError',
> '*auto-finalize': 'bool', '*auto-dismiss': 'bool' } }
> diff --git a/include/block/block_int.h b/include/block/block_int.h
> index d6415b53c1..89370c1b9b 100644
> --- a/include/block/block_int.h
> +++ b/include/block/block_int.h
> @@ -1132,7 +1132,9 @@ void mirror_start(const char *job_id, BlockDriverState *bs,
> * @target: Block device to write to.
> * @speed: The maximum speed, in bytes per second, or 0 for unlimited.
> * @sync_mode: What parts of the disk image should be copied to the destination.
> - * @sync_bitmap: The dirty bitmap if sync_mode is MIRROR_SYNC_MODE_INCREMENTAL.
> + * @sync_bitmap: The dirty bitmap if sync_mode is 'bitmap' or 'incremental'
> + * @has_bitmap_mode: true if @bitmap_sync carries a meaningful value.
Hmm... If you moved the conversion of incremental/- =>
bitmap/conditional into blockdev.c, you could get rid of this parameter
because it would be equal to (sync_bitmap != NULL).
(It itches me to get rid of this parameter because there is no other
has* parameter for this function yet.)
> + * @bitmap_mode: The bitmap synchronization policy to use.
> * @on_source_error: The action to take upon error reading from the source.
> * @on_target_error: The action to take upon error writing to the target.
> * @creation_flags: Flags that control the behavior of the Job lifetime.
> @@ -1148,6 +1150,8 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
> BlockDriverState *target, int64_t speed,
> MirrorSyncMode sync_mode,
> BdrvDirtyBitmap *sync_bitmap,
> + bool has_bitmap_mode,
> + BitmapSyncMode bitmap_mode,
> bool compress,
> BlockdevOnError on_source_error,
> BlockdevOnError on_target_error,
> diff --git a/block/backup.c b/block/backup.c
> index 715e1d3be8..c4f83d4ef7 100644
> --- a/block/backup.c
> +++ b/block/backup.c
[...]
> @@ -584,9 +586,28 @@ BlockJob *backup_job_create(const char *job_id, BlockDriverState *bs,
> }
>
> if (sync_mode == MIRROR_SYNC_MODE_INCREMENTAL) {
> + if (has_bitmap_mode &&
> + bitmap_mode != BITMAP_SYNC_MODE_CONDITIONAL) {
> + error_setg(errp, "Bitmap sync mode must be 'conditional' "
> + "when using sync mode '%s'",
> + MirrorSyncMode_str(sync_mode));
> + return NULL;
> + }
> + has_bitmap_mode = true;
> + bitmap_mode = BITMAP_SYNC_MODE_CONDITIONAL;
> + effective_mode = MIRROR_SYNC_MODE_BITMAP;
> + }
> +
I also just don’t quite feel like this is the correct place to put this.
It’s a deprecated interface, so it should be translated in the
interface code, i.e. in blockdev.c.
(Sure, this gives you a central place for the translation, but you can
just as well add a function to the same effect to blockdev.c.)
Max
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* [Qemu-devel] [PATCH v4 09/13] vfio: Add load state functions to SaveVMHandlers
From: Kirti Wankhede @ 2019-06-20 14:37 UTC (permalink / raw)
To: alex.williamson, cjia
Cc: Kirti Wankhede, Zhengxiao.zx, kevin.tian, yi.l.liu, yan.y.zhao,
eskultet, ziye.yang, qemu-devel, cohuck, shuangtai.tst, dgilbert,
zhi.a.wang, mlevitsk, pasic, aik, yulei.zhang, eauger, felipe,
jonathan.davies, changpeng.liu, Ken.Xue
In-Reply-To: <1561041461-22326-1-git-send-email-kwankhede@nvidia.com>
During _RESUMING device state:
- If Vendor driver defines mappable region, mmap migration region.
- Load config state.
- For data packet, till VFIO_MIG_FLAG_END_OF_STATE is not reached
- read data_size from packet, read buffer of data_size
- read data_offset from where QEMU should write data.
if region is mmaped, write data of data_size to mmaped region.
- write data_size.
In case of mmapped region, write to data_size indicates kernel
driver that data is written in staging buffer.
- if region is trapped, pwrite() data of data_size from data_offset.
- Repeat above until VFIO_MIG_FLAG_END_OF_STATE.
- Unmap migration region.
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
---
hw/vfio/migration.c | 153 ++++++++++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 153 insertions(+)
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index 0a2f30872316..e4895f91761d 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -212,6 +212,22 @@ static int vfio_save_device_config_state(QEMUFile *f, void *opaque)
return qemu_file_get_error(f);
}
+static int vfio_load_device_config_state(QEMUFile *f, void *opaque)
+{
+ VFIODevice *vbasedev = opaque;
+
+ if (vbasedev->type == VFIO_DEVICE_TYPE_PCI) {
+ vfio_pci_load_config(vbasedev, f);
+ }
+
+ if (qemu_get_be64(f) != VFIO_MIG_FLAG_END_OF_STATE) {
+ error_report("Wrong end of block while loading device config space");
+ return -EINVAL;
+ }
+
+ return qemu_file_get_error(f);
+}
+
/* ---------------------------------------------------------------------- */
static int vfio_save_setup(QEMUFile *f, void *opaque)
@@ -372,12 +388,149 @@ static int vfio_save_complete_precopy(QEMUFile *f, void *opaque)
return ret;
}
+static int vfio_load_setup(QEMUFile *f, void *opaque)
+{
+ VFIODevice *vbasedev = opaque;
+ VFIOMigration *migration = vbasedev->migration;
+ int ret = 0;
+
+ if (migration->region.buffer.mmaps) {
+ ret = vfio_region_mmap(&migration->region.buffer);
+ if (ret) {
+ error_report("Failed to mmap VFIO migration region %d: %s",
+ migration->region.index, strerror(-ret));
+ return ret;
+ }
+ }
+
+ ret = vfio_migration_set_state(vbasedev, VFIO_DEVICE_STATE_RESUMING);
+ if (ret) {
+ error_report("Failed to set state RESUMING");
+ }
+ return ret;
+}
+
+static int vfio_load_cleanup(void *opaque)
+{
+ vfio_save_cleanup(opaque);
+ return 0;
+}
+
+static int vfio_load_state(QEMUFile *f, void *opaque, int version_id)
+{
+ VFIODevice *vbasedev = opaque;
+ VFIOMigration *migration = vbasedev->migration;
+ int ret = 0;
+ uint64_t data, data_size;
+
+ data = qemu_get_be64(f);
+ while (data != VFIO_MIG_FLAG_END_OF_STATE) {
+ switch (data) {
+ case VFIO_MIG_FLAG_DEV_CONFIG_STATE:
+ {
+ ret = vfio_load_device_config_state(f, opaque);
+ if (ret) {
+ return ret;
+ }
+ break;
+ }
+ case VFIO_MIG_FLAG_DEV_SETUP_STATE:
+ {
+ data = qemu_get_be64(f);
+ if (data == VFIO_MIG_FLAG_END_OF_STATE) {
+ return ret;
+ } else {
+ error_report("SETUP STATE: EOS not found 0x%lx", data);
+ return -EINVAL;
+ }
+ break;
+ }
+ case VFIO_MIG_FLAG_DEV_DATA_STATE:
+ {
+ VFIORegion *region = &migration->region.buffer;
+ void *buf = NULL;
+ bool buffer_mmaped = false;
+ uint64_t data_offset = 0;
+
+ data_size = qemu_get_be64(f);
+ if (data_size == 0) {
+ break;
+ }
+
+ ret = pread(vbasedev->fd, &data_offset, sizeof(data_offset),
+ region->fd_offset +
+ offsetof(struct vfio_device_migration_info,
+ data_offset));
+ if (ret != sizeof(data_offset)) {
+ error_report("Failed to get migration buffer data offset %d",
+ ret);
+ return -EINVAL;
+ }
+
+ if (region->mmaps) {
+ int i;
+
+ for (i = 0; i < region->nr_mmaps; i++) {
+ if (region->mmaps[i].mmap &&
+ (data_offset >= region->mmaps[i].offset) &&
+ (data_offset < region->mmaps[i].offset +
+ region->mmaps[i].size)) {
+ buf = region->mmaps[i].mmap + (data_offset -
+ region->mmaps[i].offset);
+ buffer_mmaped = true;
+ break;
+ }
+ }
+ }
+
+ if (!buffer_mmaped) {
+ buf = g_malloc0(data_size);
+ }
+
+ qemu_get_buffer(f, buf, data_size);
+
+ ret = pwrite(vbasedev->fd, &data_size, sizeof(data_size),
+ region->fd_offset +
+ offsetof(struct vfio_device_migration_info, data_size));
+ if (ret != sizeof(data_size)) {
+ error_report("Failed to set migration buffer data size %d",
+ ret);
+ return -EINVAL;
+ }
+
+ if (!buffer_mmaped) {
+ ret = pwrite(vbasedev->fd, buf, data_size,
+ region->fd_offset + data_offset);
+ g_free(buf);
+
+ if (ret != data_size) {
+ error_report("Failed to set migration buffer %d", ret);
+ return -EINVAL;
+ }
+ }
+ break;
+ }
+ }
+
+ ret = qemu_file_get_error(f);
+ if (ret) {
+ return ret;
+ }
+ data = qemu_get_be64(f);
+ }
+
+ return ret;
+}
+
static SaveVMHandlers savevm_vfio_handlers = {
.save_setup = vfio_save_setup,
.save_cleanup = vfio_save_cleanup,
.save_live_pending = vfio_save_pending,
.save_live_iterate = vfio_save_iterate,
.save_live_complete_precopy = vfio_save_complete_precopy,
+ .load_setup = vfio_load_setup,
+ .load_cleanup = vfio_load_cleanup,
+ .load_state = vfio_load_state,
};
/* ---------------------------------------------------------------------- */
--
2.7.0
^ permalink raw reply related
* [PATCH v2 0/3] Add dirty range scoping to jbd2
From: Ross Zwisler @ 2019-06-20 15:18 UTC (permalink / raw)
To: linux-kernel
Cc: Ross Zwisler, Theodore Ts'o, Alexander Viro, Andreas Dilger,
Jan Kara, linux-ext4, linux-fsdevel, linux-mm, Fletcher Woodruff,
Justin TerAvest
Changes from v1:
- Relocated the code which resets dirty range upon transaction completion.
(Jan)
- Cc'd stable@vger.kernel.org because we see this issue with v4.14 and
v4.19 stable kernels in the field.
---
This patch series fixes the issue I described here:
https://www.spinics.net/lists/linux-block/msg38274.html
Essentially the issue is that journal_finish_inode_data_buffers() operates
on the entire address space of each of the inodes associated with a given
journal entry. This means that if we have an inode where we are constantly
appending dirty pages we can end up waiting for an indefinite amount of
time in journal_finish_inode_data_buffers().
This series improves this situation in ext4 by scoping each of the inode
dirty ranges associated with a given transaction. Other users of jbd2
which don't (yet?) take advantage of this scoping (ocfs2) will continue to
have the old behavior.
Ross Zwisler (3):
mm: add filemap_fdatawait_range_keep_errors()
jbd2: introduce jbd2_inode dirty range scoping
ext4: use jbd2_inode dirty range scoping
fs/ext4/ext4_jbd2.h | 12 +++++------
fs/ext4/inode.c | 13 +++++++++---
fs/ext4/move_extent.c | 3 ++-
fs/jbd2/commit.c | 23 ++++++++++++++------
fs/jbd2/journal.c | 2 ++
fs/jbd2/transaction.c | 49 ++++++++++++++++++++++++-------------------
include/linux/fs.h | 2 ++
include/linux/jbd2.h | 22 +++++++++++++++++++
mm/filemap.c | 22 +++++++++++++++++++
9 files changed, 111 insertions(+), 37 deletions(-)
--
2.22.0.410.gd8fdbe21b5-goog
^ permalink raw reply
* Re: [PATCH] mfd: stmfx: Fix an endian bug in stmfx_irq_handler()
From: Amelie DELAUNAY @ 2019-06-20 15:18 UTC (permalink / raw)
To: Lee Jones, Linus Torvalds
Cc: Alexandre TORGUE, kernel-janitors@vger.kernel.org,
Linux List Kernel Mailing, Dan Carpenter, Maxime Coquelin,
linux-stm32@st-md-mailman.stormreply.com, Linux ARM
In-Reply-To: <20190619055816.GF18371@dell>
On 6/19/19 7:58 AM, Lee Jones wrote:
> On Tue, 18 Jun 2019, Linus Torvalds wrote:
>
>> On Tue, Jun 18, 2019 at 1:16 AM Lee Jones <lee.jones@linaro.org> wrote:
>>>
>>>> Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
>>>
>>> Ideally we can get a review too.
>>
>> Looks fine to me, but obviously somebody should actually _test_ it too.
>
> Amelie, would you be so kind?
>
Tested on stm32mp157c-ev1.
Tested-by: Amelie Delaunay <amelie.delaunay@st.com>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
^ permalink raw reply
* Re: [PATCH] mfd: stmfx: Fix an endian bug in stmfx_irq_handler()
From: Amelie DELAUNAY @ 2019-06-20 15:18 UTC (permalink / raw)
To: Lee Jones, Linus Torvalds
Cc: Alexandre TORGUE, kernel-janitors@vger.kernel.org,
Linux List Kernel Mailing, Dan Carpenter, Maxime Coquelin,
linux-stm32@st-md-mailman.stormreply.com, Linux ARM
In-Reply-To: <20190619055816.GF18371@dell>
T24gNi8xOS8xOSA3OjU4IEFNLCBMZWUgSm9uZXMgd3JvdGU6DQo+IE9uIFR1ZSwgMTggSnVuIDIw
MTksIExpbnVzIFRvcnZhbGRzIHdyb3RlOg0KPiANCj4+IE9uIFR1ZSwgSnVuIDE4LCAyMDE5IGF0
IDE6MTYgQU0gTGVlIEpvbmVzIDxsZWUuam9uZXNAbGluYXJvLm9yZz4gd3JvdGU6DQo+Pj4NCj4+
Pj4gUmVwb3J0ZWQtYnk6IExpbnVzIFRvcnZhbGRzIDx0b3J2YWxkc0BsaW51eC1mb3VuZGF0aW9u
Lm9yZz4NCj4+Pg0KPj4+IElkZWFsbHkgd2UgY2FuIGdldCBhIHJldmlldyB0b28uDQo+Pg0KPj4g
TG9va3MgZmluZSB0byBtZSwgYnV0IG9idmlvdXNseSBzb21lYm9keSBzaG91bGQgYWN0dWFsbHkg
X3Rlc3RfIGl0IHRvby4NCj4gDQo+IEFtZWxpZSwgd291bGQgeW91IGJlIHNvIGtpbmQ/DQo+IA0K
DQpUZXN0ZWQgb24gc3RtMzJtcDE1N2MtZXYxLg0KDQpUZXN0ZWQtYnk6IEFtZWxpZSBEZWxhdW5h
eSA8YW1lbGllLmRlbGF1bmF5QHN0LmNvbT4
^ permalink raw reply
* Re: [PATCH RFC] mm: fix regression with deferred struct page init
From: Alexander Duyck @ 2019-06-20 15:17 UTC (permalink / raw)
To: Juergen Gross, xen-devel, linux-mm, linux-kernel
In-Reply-To: <20190620094015.21206-1-jgross@suse.com>
On Thu, 2019-06-20 at 11:40 +0200, Juergen Gross wrote:
> Commit 0e56acae4b4dd4a9 ("mm: initialize MAX_ORDER_NR_PAGES at a time
> instead of doing larger sections") is causing a regression on some
> systems when the kernel is booted as Xen dom0.
>
> The system will just hang in early boot.
>
> Reason is an endless loop in get_page_from_freelist() in case the first
> zone looked at has no free memory. deferred_grow_zone() is always
> returning true due to the following code snipplet:
>
> /* If the zone is empty somebody else may have cleared out the zone */
> if (!deferred_init_mem_pfn_range_in_zone(&i, zone, &spfn, &epfn,
> first_deferred_pfn)) {
> pgdat->first_deferred_pfn = ULONG_MAX;
> pgdat_resize_unlock(pgdat, &flags);
> return true;
> }
>
> This in turn results in the loop as get_page_from_freelist() is
> assuming forward progress can be made by doing some more struct page
> initialization.
>
> Fixes: 0e56acae4b4dd4a9 ("mm: initialize MAX_ORDER_NR_PAGES at a time instead of doing larger sections")
> ---
> This patch makes my system boot again as Xen dom0, but I'm not really
> sure it is the correct way to do it, hence the RFC.
> Signed-off-by: Juergen Gross <jgross@suse.com>
> ---
> mm/page_alloc.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index d66bc8abe0af..6ee754b5cd92 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -1826,7 +1826,7 @@ deferred_grow_zone(struct zone *zone, unsigned int order)
> first_deferred_pfn)) {
> pgdat->first_deferred_pfn = ULONG_MAX;
> pgdat_resize_unlock(pgdat, &flags);
> - return true;
> + return false;
> }
>
> /*
The one change I might make to this would be to do:
return first_deferred_pfn != ULONG_MAX;
That way in the event the previous caller did free up the last of the
pages and empty the zone just before we got here then we will try one more
time. Otherwise if it was already done before we got here we exit.
^ permalink raw reply
* RE: [PATCH 1/2] drm/amdgpu: update df_v3_6 for xgmi perfmons
From: Kim, Jonathan @ 2019-06-20 15:17 UTC (permalink / raw)
To: Alex Deucher; +Cc: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
In-Reply-To: <CADnq5_O81Mmf=4N+EL8P6ARrbhAo8wXRVKZB78N5Dj7e6+upLw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Sorry for the miss Alex. I also did an early-merge by mistake before Felix had a chance to review some simplifications.
I just sent out a post merge fix patch for review to address comments.
Thanks,
Jon
-----Original Message-----
From: Alex Deucher <alexdeucher@gmail.com>
Sent: Thursday, June 20, 2019 9:50 AM
To: Kim, Jonathan <Jonathan.Kim@amd.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH 1/2] drm/amdgpu: update df_v3_6 for xgmi perfmons
[CAUTION: External Email]
On Wed, Jun 19, 2019 at 8:53 PM Kim, Jonathan <Jonathan.Kim@amd.com> wrote:
>
> v4: fixed kzalloc error check and modified df func init to return
> error code
>
> v3: fixed cleanup by adding fini to free up adev df config counters
>
> v2: simplified by removing xgmi references in function names and
> moving to generic df function names. fixed issue by removing
> hardcoded cake tx data events. streamlined error handling by having
> df_v3_6_pmc_get_ctrl return error code.
>
> add pmu attribute groups and structures for perf events.
> add sysfs to track available df perfmon counters fix overflow handling
> in perfmon counter reads.
>
> Change-Id: I61f731c0066b17834656c746e7efe038c4f62acf
> Signed-off-by: Jonathan Kim <Jonathan.Kim@amd.com>
> ---
> drivers/gpu/drm/amd/amdgpu/amdgpu.h | 17 +
> drivers/gpu/drm/amd/amdgpu/df_v3_6.c | 449 ++++++++++++---------------
> drivers/gpu/drm/amd/amdgpu/df_v3_6.h | 19 +-
> drivers/gpu/drm/amd/amdgpu/soc15.c | 4 +
> 4 files changed, 231 insertions(+), 258 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> index d355e9a09ad1..91cfcc7be5c1 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
> @@ -732,6 +732,7 @@ struct amd_powerplay { };
>
> #define AMDGPU_RESET_MAGIC_NUM 64
> +#define AMDGPU_MAX_DF_PERFMONS 16
> struct amdgpu_device {
> struct device *dev;
> struct drm_device *ddev;
> @@ -962,6 +963,7 @@ struct amdgpu_device {
> long compute_timeout;
>
> uint64_t unique_id;
> + uint64_t df_perfmon_config_assign_mask[AMDGPU_MAX_DF_PERFMONS];
> };
>
> static inline struct amdgpu_device *amdgpu_ttm_adev(struct
> ttm_bo_device *bdev) @@ -1201,4 +1203,19 @@ static inline int
> amdgpu_dm_display_resume(struct amdgpu_device *adev) { return #endif
>
> #include "amdgpu_object.h"
> +
> +/* used by df_v3_6.c and amdgpu_pmu.c */
> +#define AMDGPU_PMU_ATTR(_name, _object) \
> +static ssize_t \
> +_name##_show(struct device *dev, \
> + struct device_attribute *attr, \
> + char *page) \
> +{ \
> + BUILD_BUG_ON(sizeof(_object) >= PAGE_SIZE - 1); \
> + return sprintf(page, _object "\n"); \
> +} \
> +
> +\ static struct device_attribute pmu_attr_##_name = __ATTR_RO(_name)
> +
> #endif
> +
> diff --git a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> index 8c09bf994acd..12e3e67013d9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> +++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.c
> @@ -30,8 +30,104 @@
> static u32 df_v3_6_channel_number[] = {1, 2, 0, 4, 0, 8, 0,
> 16, 32, 0, 0, 0, 2, 4, 8};
>
> +/* init df format attrs */
> +AMDGPU_PMU_ATTR(event, "config:0-7");
> +AMDGPU_PMU_ATTR(instance, "config:8-15");
> +AMDGPU_PMU_ATTR(umask, "config:16-23");
> +
> +/* df format attributes */
> +static struct attribute *df_v3_6_format_attrs[] = {
> + &pmu_attr_event.attr,
> + &pmu_attr_instance.attr,
> + &pmu_attr_umask.attr,
> + NULL
> +};
> +
> +/* df format attribute group */
> +static struct attribute_group df_v3_6_format_attr_group = {
> + .name = "format",
> + .attrs = df_v3_6_format_attrs, };
> +
> +/* df event attrs */
> +AMDGPU_PMU_ATTR(cake0_pcsout_txdata,
> + "event=0x7,instance=0x46,umask=0x2");
> +AMDGPU_PMU_ATTR(cake1_pcsout_txdata,
> + "event=0x7,instance=0x47,umask=0x2");
> +AMDGPU_PMU_ATTR(cake0_pcsout_txmeta,
> + "event=0x7,instance=0x46,umask=0x4");
> +AMDGPU_PMU_ATTR(cake1_pcsout_txmeta,
> + "event=0x7,instance=0x47,umask=0x4");
> +AMDGPU_PMU_ATTR(cake0_ftiinstat_reqalloc,
> + "event=0xb,instance=0x46,umask=0x4");
> +AMDGPU_PMU_ATTR(cake1_ftiinstat_reqalloc,
> + "event=0xb,instance=0x47,umask=0x4");
> +AMDGPU_PMU_ATTR(cake0_ftiinstat_rspalloc,
> + "event=0xb,instance=0x46,umask=0x8");
> +AMDGPU_PMU_ATTR(cake1_ftiinstat_rspalloc,
> + "event=0xb,instance=0x47,umask=0x8");
> +
> +/* df event attributes */
> +static struct attribute *df_v3_6_event_attrs[] = {
> + &pmu_attr_cake0_pcsout_txdata.attr,
> + &pmu_attr_cake1_pcsout_txdata.attr,
> + &pmu_attr_cake0_pcsout_txmeta.attr,
> + &pmu_attr_cake1_pcsout_txmeta.attr,
> + &pmu_attr_cake0_ftiinstat_reqalloc.attr,
> + &pmu_attr_cake1_ftiinstat_reqalloc.attr,
> + &pmu_attr_cake0_ftiinstat_rspalloc.attr,
> + &pmu_attr_cake1_ftiinstat_rspalloc.attr,
> + NULL
> +};
> +
> +/* df event attribute group */
> +static struct attribute_group df_v3_6_event_attr_group = {
> + .name = "events",
> + .attrs = df_v3_6_event_attrs
> +};
> +
> +/* df event attr groups */
> +const struct attribute_group *df_v3_6_attr_groups[] = {
> + &df_v3_6_format_attr_group,
> + &df_v3_6_event_attr_group,
> + NULL
> +};
> +
> +/* get the number of df counters available */ static ssize_t
> +df_v3_6_get_df_cntr_avail(struct device *dev,
> + struct device_attribute *attr,
> + char *buf)
> +{
> + struct amdgpu_device *adev;
> + struct drm_device *ddev;
> + int i, count;
> +
> + ddev = dev_get_drvdata(dev);
> + adev = ddev->dev_private;
> + count = 0;
> +
> + for (i = 0; i < DF_V3_6_MAX_COUNTERS; i++) {
> + if (adev->df_perfmon_config_assign_mask[i] == 0)
> + count++;
> + }
> +
> + return snprintf(buf, PAGE_SIZE, "%i\n", count); }
> +
> +/* device attr for available perfmon counters */ static
> +DEVICE_ATTR(df_cntr_avail, S_IRUGO, df_v3_6_get_df_cntr_avail, NULL);
> +
> +/* init perfmons */
> static void df_v3_6_init(struct amdgpu_device *adev) {
> + int i, ret;
> +
> + ret = device_create_file(adev->dev, &dev_attr_df_cntr_avail);
> + if (ret)
> + DRM_ERROR("failed to create file for available df
> + counters\n");
> +
> + for (i = 0; i < AMDGPU_MAX_DF_PERFMONS; i++)
> + adev->df_perfmon_config_assign_mask[i] = 0;
> }
You never addressed my comments about df init from before. df_init gets called from hw_init, so you shouldn't create files. Move df init to being called from soc15 sw_init/fini and probably rename the df callbacks to sw_init and sw_fini so we know not to add hw state to those functions. As is now, we'll end up needlessly creating and destorying files on suspend/resume.
Alex
>
> static void df_v3_6_enable_broadcast_mode(struct amdgpu_device *adev,
> @@ -105,28 +201,19 @@ static void df_v3_6_get_clockgating_state(struct amdgpu_device *adev,
> *flags |= AMD_CG_SUPPORT_DF_MGCG; }
>
> -/* hold counter assignment per gpu struct */ -struct
> df_v3_6_event_mask {
> - struct amdgpu_device gpu;
> - uint64_t config_assign_mask[AMDGPU_DF_MAX_COUNTERS];
> -};
> -
> /* get assigned df perfmon ctr as int */ -static void
> df_v3_6_pmc_config_2_cntr(struct amdgpu_device *adev,
> - uint64_t config,
> - int *counter)
> +static int df_v3_6_pmc_config_2_cntr(struct amdgpu_device *adev,
> + uint64_t config)
> {
> - struct df_v3_6_event_mask *mask;
> int i;
>
> - mask = container_of(adev, struct df_v3_6_event_mask, gpu);
> -
> - for (i = 0; i < AMDGPU_DF_MAX_COUNTERS; i++) {
> - if ((config & 0x0FFFFFFUL) == mask->config_assign_mask[i]) {
> - *counter = i;
> - return;
> - }
> + for (i = 0; i < DF_V3_6_MAX_COUNTERS; i++) {
> + if ((config & 0x0FFFFFFUL) ==
> + adev->df_perfmon_config_assign_mask[i])
> + return i;
> }
> +
> + return -EINVAL;
> }
>
> /* get address based on counter assignment */ @@ -136,10 +223,7 @@
> static void df_v3_6_pmc_get_addr(struct amdgpu_device *adev,
> uint32_t *lo_base_addr,
> uint32_t *hi_base_addr) {
> -
> - int target_cntr = -1;
> -
> - df_v3_6_pmc_config_2_cntr(adev, config, &target_cntr);
> + int target_cntr = df_v3_6_pmc_config_2_cntr(adev, config);
>
> if (target_cntr < 0)
> return;
> @@ -177,40 +261,38 @@ static void df_v3_6_pmc_get_read_settings(struct
> amdgpu_device *adev, }
>
> /* get control counter settings i.e. address and values to set */
> -static void df_v3_6_pmc_get_ctrl_settings(struct amdgpu_device *adev,
> +static int df_v3_6_pmc_get_ctrl_settings(struct amdgpu_device *adev,
> uint64_t config,
> uint32_t *lo_base_addr,
> uint32_t *hi_base_addr,
> uint32_t *lo_val,
> uint32_t *hi_val) {
> -
> - uint32_t eventsel, instance, unitmask;
> - uint32_t es_5_0, es_13_0, es_13_6, es_13_12, es_11_8, es_7_0;
> -
> df_v3_6_pmc_get_addr(adev, config, 1, lo_base_addr,
> hi_base_addr);
>
> - if (lo_val == NULL || hi_val == NULL)
> - return;
> -
> if ((*lo_base_addr == 0) || (*hi_base_addr == 0)) {
> - DRM_ERROR("DF PMC addressing not retrieved! Lo: %x, Hi: %x",
> + DRM_ERROR("[DF PMC] addressing not retrieved! Lo: %x,
> + Hi: %x",
> *lo_base_addr, *hi_base_addr);
> - return;
> + return -ENXIO;
> + }
> +
> + if (lo_val && hi_val) {
> + uint32_t eventsel, instance, unitmask;
> + uint32_t instance_10, instance_5432, instance_76;
> +
> + eventsel = DF_V3_6_GET_EVENT(config) & 0x3f;
> + unitmask = DF_V3_6_GET_UNITMASK(config) & 0xf;
> + instance = DF_V3_6_GET_INSTANCE(config);
> +
> + instance_10 = instance & 0x3;
> + instance_5432 = (instance >> 2) & 0xf;
> + instance_76 = (instance >> 6) & 0x3;
> +
> + *lo_val = (unitmask << 8) | (instance_10 << 6) | eventsel;
> + *hi_val = (instance_76 << 29) | instance_5432;
> }
>
> - eventsel = GET_EVENT(config);
> - instance = GET_INSTANCE(config);
> - unitmask = GET_UNITMASK(config);
> -
> - es_5_0 = eventsel & 0x3FUL;
> - es_13_6 = instance;
> - es_13_0 = (es_13_6 << 6) + es_5_0;
> - es_13_12 = (es_13_0 & 0x03000UL) >> 12;
> - es_11_8 = (es_13_0 & 0x0F00UL) >> 8;
> - es_7_0 = es_13_0 & 0x0FFUL;
> - *lo_val = (es_7_0 & 0xFFUL) | ((unitmask & 0x0FUL) << 8);
> - *hi_val = (es_11_8 | ((es_13_12)<<(29)));
> + return 0;
> }
>
> /* assign df performance counters for read */ @@ -218,26 +300,21 @@
> static int df_v3_6_pmc_assign_cntr(struct amdgpu_device *adev,
> uint64_t config,
> int *is_assigned) {
> -
> - struct df_v3_6_event_mask *mask;
> int i, target_cntr;
>
> - target_cntr = -1;
> -
> *is_assigned = 0;
>
> - df_v3_6_pmc_config_2_cntr(adev, config, &target_cntr);
> + target_cntr = df_v3_6_pmc_config_2_cntr(adev, config);
>
> if (target_cntr >= 0) {
> *is_assigned = 1;
> return 0;
> }
>
> - mask = container_of(adev, struct df_v3_6_event_mask, gpu);
> -
> - for (i = 0; i < AMDGPU_DF_MAX_COUNTERS; i++) {
> - if (mask->config_assign_mask[i] == 0ULL) {
> - mask->config_assign_mask[i] = config & 0x0FFFFFFUL;
> + for (i = 0; i < DF_V3_6_MAX_COUNTERS; i++) {
> + if (adev->df_perfmon_config_assign_mask[i] == 0U) {
> + adev->df_perfmon_config_assign_mask[i] =
> + config &
> + 0x0FFFFFFUL;
> return 0;
> }
> }
> @@ -249,66 +326,17 @@ static int df_v3_6_pmc_assign_cntr(struct
> amdgpu_device *adev, static void df_v3_6_pmc_release_cntr(struct amdgpu_device *adev,
> uint64_t config) {
> -
> - struct df_v3_6_event_mask *mask;
> - int target_cntr;
> -
> - target_cntr = -1;
> -
> - df_v3_6_pmc_config_2_cntr(adev, config, &target_cntr);
> -
> - mask = container_of(adev, struct df_v3_6_event_mask, gpu);
> + int target_cntr = df_v3_6_pmc_config_2_cntr(adev, config);
>
> if (target_cntr >= 0)
> - mask->config_assign_mask[target_cntr] = 0ULL;
> -
> + adev->df_perfmon_config_assign_mask[target_cntr] =
> + 0ULL;
> }
>
> -/*
> - * get xgmi link counters via programmable data fabric (df) counters
> (max 4)
> - * using cake tx event.
> - *
> - * @adev -> amdgpu device
> - * @instance-> currently cake has 2 links to poll on vega20
> - * @count -> counters to pass
> - *
> - */
> -
> -static void df_v3_6_get_xgmi_link_cntr(struct amdgpu_device *adev,
> - int instance,
> - uint64_t *count)
> -{
> - uint32_t lo_base_addr, hi_base_addr, lo_val, hi_val;
> - uint64_t config;
> -
> - config = GET_INSTANCE_CONFIG(instance);
> -
> - df_v3_6_pmc_get_read_settings(adev, config, &lo_base_addr,
> - &hi_base_addr);
> -
> - if ((lo_base_addr == 0) || (hi_base_addr == 0))
> - return;
> -
> - lo_val = RREG32_PCIE(lo_base_addr);
> - hi_val = RREG32_PCIE(hi_base_addr);
>
> - *count = ((hi_val | 0ULL) << 32) | (lo_val | 0ULL);
> -}
> -
> -/*
> - * reset xgmi link counters
> - *
> - * @adev -> amdgpu device
> - * @instance-> currently cake has 2 links to poll on vega20
> - *
> - */
> -static void df_v3_6_reset_xgmi_link_cntr(struct amdgpu_device *adev,
> - int instance)
> +static void df_v3_6_reset_perfmon_cntr(struct amdgpu_device *adev,
> + uint64_t config)
> {
> uint32_t lo_base_addr, hi_base_addr;
> - uint64_t config;
> -
> - config = 0ULL | (0x7ULL) | ((0x46ULL + instance) << 8) | (0x2 << 16);
>
> df_v3_6_pmc_get_read_settings(adev, config, &lo_base_addr,
> &hi_base_addr); @@ -320,185
> +348,106 @@ static void df_v3_6_reset_xgmi_link_cntr(struct amdgpu_device *adev,
> WREG32_PCIE(hi_base_addr, 0UL); }
>
> -/*
> - * add xgmi link counters
> - *
> - * @adev -> amdgpu device
> - * @instance-> currently cake has 2 links to poll on vega20
> - *
> - */
>
> -static int df_v3_6_add_xgmi_link_cntr(struct amdgpu_device *adev,
> - int instance)
> +static int df_v3_6_add_perfmon_cntr(struct amdgpu_device *adev,
> + uint64_t config)
> {
> uint32_t lo_base_addr, hi_base_addr, lo_val, hi_val;
> - uint64_t config;
> int ret, is_assigned;
>
> - if (instance < 0 || instance > 1)
> - return -EINVAL;
> -
> - config = GET_INSTANCE_CONFIG(instance);
> -
> ret = df_v3_6_pmc_assign_cntr(adev, config, &is_assigned);
>
> if (ret || is_assigned)
> return ret;
>
> - df_v3_6_pmc_get_ctrl_settings(adev,
> + ret = df_v3_6_pmc_get_ctrl_settings(adev,
> config,
> &lo_base_addr,
> &hi_base_addr,
> &lo_val,
> &hi_val);
>
> + if (ret)
> + return ret;
> +
> + DRM_DEBUG_DRIVER("config=%llx addr=%08x:%08x val=%08x:%08x",
> + config, lo_base_addr, hi_base_addr, lo_val,
> + hi_val);
> +
> WREG32_PCIE(lo_base_addr, lo_val);
> WREG32_PCIE(hi_base_addr, hi_val);
>
> return ret;
> }
>
> -
> -/*
> - * start xgmi link counters
> - *
> - * @adev -> amdgpu device
> - * @instance-> currently cake has 2 links to poll on vega20
> - * @is_enable -> either resume or assign event via df perfmon
> - *
> - */
> -
> -static int df_v3_6_start_xgmi_link_cntr(struct amdgpu_device *adev,
> - int instance,
> - int is_enable)
> +static int df_v3_6_pmc_start(struct amdgpu_device *adev, uint64_t config,
> + int is_enable)
> {
> uint32_t lo_base_addr, hi_base_addr, lo_val;
> - uint64_t config;
> - int ret;
> -
> - if (instance < 0 || instance > 1)
> - return -EINVAL;
> -
> - if (is_enable) {
> + int ret = 0;
>
> - ret = df_v3_6_add_xgmi_link_cntr(adev, instance);
> -
> - if (ret)
> - return ret;
> + switch (adev->asic_type) {
> + case CHIP_VEGA20:
>
> - } else {
> + df_v3_6_reset_perfmon_cntr(adev, config);
>
> - config = GET_INSTANCE_CONFIG(instance);
> + if (is_enable) {
> + ret = df_v3_6_add_perfmon_cntr(adev, config);
> + } else {
> + ret = df_v3_6_pmc_get_ctrl_settings(adev,
> + config,
> + &lo_base_addr,
> + &hi_base_addr,
> + NULL,
> + NULL);
>
> - df_v3_6_pmc_get_ctrl_settings(adev,
> - config,
> - &lo_base_addr,
> - &hi_base_addr,
> - NULL,
> - NULL);
> + if (ret)
> + return ret;
>
> - if (lo_base_addr == 0)
> - return -EINVAL;
> + lo_val = RREG32_PCIE(lo_base_addr);
>
> - lo_val = RREG32_PCIE(lo_base_addr);
> + DRM_DEBUG_DRIVER("config=%llx addr=%08x:%08x val=%08x",
> + config, lo_base_addr, hi_base_addr,
> + lo_val);
>
> - WREG32_PCIE(lo_base_addr, lo_val | (1ULL << 22));
> + WREG32_PCIE(lo_base_addr, lo_val | (1ULL << 22));
> + }
>
> - ret = 0;
> + break;
> + default:
> + break;
> }
>
> return ret;
> -
> }
>
> -/*
> - * start xgmi link counters
> - *
> - * @adev -> amdgpu device
> - * @instance-> currently cake has 2 links to poll on vega20
> - * @is_enable -> either pause or unassign event via df perfmon
> - *
> - */
> -
> -static int df_v3_6_stop_xgmi_link_cntr(struct amdgpu_device *adev,
> - int instance,
> - int is_disable)
> +static int df_v3_6_pmc_stop(struct amdgpu_device *adev, uint64_t config,
> + int is_disable)
> {
> -
> uint32_t lo_base_addr, hi_base_addr, lo_val;
> - uint64_t config;
> -
> - config = GET_INSTANCE_CONFIG(instance);
> -
> - if (is_disable) {
> - df_v3_6_reset_xgmi_link_cntr(adev, instance);
> - df_v3_6_pmc_release_cntr(adev, config);
> - } else {
> -
> - df_v3_6_pmc_get_ctrl_settings(adev,
> - config,
> - &lo_base_addr,
> - &hi_base_addr,
> - NULL,
> - NULL);
> -
> - if ((lo_base_addr == 0) || (hi_base_addr == 0))
> - return -EINVAL;
> -
> - lo_val = RREG32_PCIE(lo_base_addr);
> -
> - WREG32_PCIE(lo_base_addr, lo_val & ~(1ULL << 22));
> - }
> -
> - return 0;
> -}
> -
> -static int df_v3_6_pmc_start(struct amdgpu_device *adev, uint64_t config,
> - int is_enable)
> -{
> - int xgmi_tx_link, ret = 0;
> + int ret = 0;
>
> switch (adev->asic_type) {
> case CHIP_VEGA20:
> - xgmi_tx_link = IS_DF_XGMI_0_TX(config) ? 0
> - : (IS_DF_XGMI_1_TX(config) ? 1 : -1);
> -
> - if (xgmi_tx_link >= 0)
> - ret = df_v3_6_start_xgmi_link_cntr(adev, xgmi_tx_link,
> - is_enable);
> + ret = df_v3_6_pmc_get_ctrl_settings(adev,
> + config,
> + &lo_base_addr,
> + &hi_base_addr,
> + NULL,
> + NULL);
>
> if (ret)
> return ret;
>
> - ret = 0;
> - break;
> - default:
> - break;
> - }
> + lo_val = RREG32_PCIE(lo_base_addr);
>
> - return ret;
> -}
> + DRM_DEBUG_DRIVER("config=%llx addr=%08x:%08x val=%08x",
> + config, lo_base_addr, hi_base_addr,
> + lo_val);
>
> -static int df_v3_6_pmc_stop(struct amdgpu_device *adev, uint64_t config,
> - int is_disable)
> -{
> - int xgmi_tx_link, ret = 0;
> + WREG32_PCIE(lo_base_addr, lo_val & ~(1ULL << 22));
>
> - switch (adev->asic_type) {
> - case CHIP_VEGA20:
> - xgmi_tx_link = IS_DF_XGMI_0_TX(config) ? 0
> - : (IS_DF_XGMI_1_TX(config) ? 1 : -1);
> -
> - if (xgmi_tx_link >= 0) {
> - ret = df_v3_6_stop_xgmi_link_cntr(adev,
> - xgmi_tx_link,
> - is_disable);
> - if (ret)
> - return ret;
> - }
> -
> - ret = 0;
> - break;
> + if (is_disable)
> + df_v3_6_pmc_release_cntr(adev, config);
> +
> + break;
> default:
> break;
> }
> @@ -510,24 +459,34 @@ static void df_v3_6_pmc_get_count(struct amdgpu_device *adev,
> uint64_t config,
> uint64_t *count) {
> -
> - int xgmi_tx_link;
> + uint32_t lo_base_addr, hi_base_addr, lo_val, hi_val;
> + *count = 0;
>
> switch (adev->asic_type) {
> case CHIP_VEGA20:
> - xgmi_tx_link = IS_DF_XGMI_0_TX(config) ? 0
> - : (IS_DF_XGMI_1_TX(config) ? 1 : -1);
>
> - if (xgmi_tx_link >= 0) {
> - df_v3_6_reset_xgmi_link_cntr(adev, xgmi_tx_link);
> - df_v3_6_get_xgmi_link_cntr(adev, xgmi_tx_link, count);
> - }
> + df_v3_6_pmc_get_read_settings(adev, config, &lo_base_addr,
> + &hi_base_addr);
> +
> + if ((lo_base_addr == 0) || (hi_base_addr == 0))
> + return;
> +
> + lo_val = RREG32_PCIE(lo_base_addr);
> + hi_val = RREG32_PCIE(hi_base_addr);
> +
> + *count = ((hi_val | 0ULL) << 32) | (lo_val | 0ULL);
> +
> + if (*count >= DF_V3_6_PERFMON_OVERFLOW)
> + *count = 0;
> +
> + DRM_DEBUG_DRIVER("config=%llx addr=%08x:%08x val=%08x:%08x",
> + config, lo_base_addr, hi_base_addr, lo_val,
> + hi_val);
>
> break;
> +
> default:
> break;
> }
> -
> }
>
> const struct amdgpu_df_funcs df_v3_6_funcs = { diff --git
> a/drivers/gpu/drm/amd/amdgpu/df_v3_6.h
> b/drivers/gpu/drm/amd/amdgpu/df_v3_6.h
> index fcffd807764d..76998541bc30 100644
> --- a/drivers/gpu/drm/amd/amdgpu/df_v3_6.h
> +++ b/drivers/gpu/drm/amd/amdgpu/df_v3_6.h
> @@ -36,22 +36,15 @@ enum DF_V3_6_MGCG { };
>
> /* Defined in global_features.h as FTI_PERFMON_VISIBLE */
> -#define AMDGPU_DF_MAX_COUNTERS 4
> +#define DF_V3_6_MAX_COUNTERS 4
>
> /* get flags from df perfmon config */
> -#define GET_EVENT(x) (x & 0xFFUL)
> -#define GET_INSTANCE(x) ((x >> 8) & 0xFFUL)
> -#define GET_UNITMASK(x) ((x >> 16) & 0xFFUL)
> -#define GET_INSTANCE_CONFIG(x) (0ULL | (0x07ULL) \
> - | ((0x046ULL + x) << 8) \
> - | (0x02 << 16))
> -
> -/* df event conf macros */
> -#define IS_DF_XGMI_0_TX(x) (GET_EVENT(x) == 0x7 \
> - && GET_INSTANCE(x) == 0x46 && GET_UNITMASK(x) == 0x2)
> -#define IS_DF_XGMI_1_TX(x) (GET_EVENT(x) == 0x7 \
> - && GET_INSTANCE(x) == 0x47 && GET_UNITMASK(x) == 0x2)
> +#define DF_V3_6_GET_EVENT(x) (x & 0xFFUL)
> +#define DF_V3_6_GET_INSTANCE(x) ((x >> 8) & 0xFFUL)
> +#define DF_V3_6_GET_UNITMASK(x) ((x >> 16) & 0xFFUL)
> +#define DF_V3_6_PERFMON_OVERFLOW 0xFFFFFFFFFFFFULL
>
> +extern const struct attribute_group *df_v3_6_attr_groups[];
> extern const struct amdgpu_df_funcs df_v3_6_funcs;
>
> #endif
> diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c
> b/drivers/gpu/drm/amd/amdgpu/soc15.c
> index 78bd4fc07bab..7fee24ea7863 100644
> --- a/drivers/gpu/drm/amd/amdgpu/soc15.c
> +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c
> @@ -1066,6 +1066,7 @@ static void soc15_doorbell_range_init(struct
> amdgpu_device *adev) static int soc15_common_hw_init(void *handle) {
> struct amdgpu_device *adev = (struct amdgpu_device *)handle;
> + int ret;
>
> /* enable pcie gen2/3 link */
> soc15_pcie_gen3_enable(adev);
> @@ -1079,6 +1080,9 @@ static int soc15_common_hw_init(void *handle)
> */
> if (adev->nbio_funcs->remap_hdp_registers)
> adev->nbio_funcs->remap_hdp_registers(adev);
> +
> + adev->df_funcs->init(adev);
> +
> /* enable the doorbell aperture */
> soc15_enable_doorbell_aperture(adev, true);
> /* HW doorbell routing policy: doorbell writing not
> --
> 2.17.1
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
^ permalink raw reply
* Re: [PATCH net] af_packet: Block execution of tasks waiting for transmit to complete in AF_PACKET
From: Willem de Bruijn @ 2019-06-20 15:16 UTC (permalink / raw)
To: Neil Horman; +Cc: Network Development, Matteo Croce, David S. Miller
In-Reply-To: <20190620142354.GB18890@hmswarspite.think-freely.org>
On Thu, Jun 20, 2019 at 10:24 AM Neil Horman <nhorman@tuxdriver.com> wrote:
>
> On Thu, Jun 20, 2019 at 09:41:30AM -0400, Willem de Bruijn wrote:
> > On Wed, Jun 19, 2019 at 4:26 PM Neil Horman <nhorman@tuxdriver.com> wrote:
> > >
> > > When an application is run that:
> > > a) Sets its scheduler to be SCHED_FIFO
> > > and
> > > b) Opens a memory mapped AF_PACKET socket, and sends frames with the
> > > MSG_DONTWAIT flag cleared, its possible for the application to hang
> > > forever in the kernel. This occurs because when waiting, the code in
> > > tpacket_snd calls schedule, which under normal circumstances allows
> > > other tasks to run, including ksoftirqd, which in some cases is
> > > responsible for freeing the transmitted skb (which in AF_PACKET calls a
> > > destructor that flips the status bit of the transmitted frame back to
> > > available, allowing the transmitting task to complete).
> > >
> > > However, when the calling application is SCHED_FIFO, its priority is
> > > such that the schedule call immediately places the task back on the cpu,
> > > preventing ksoftirqd from freeing the skb, which in turn prevents the
> > > transmitting task from detecting that the transmission is complete.
> > >
> > > We can fix this by converting the schedule call to a completion
> > > mechanism. By using a completion queue, we force the calling task, when
> > > it detects there are no more frames to send, to schedule itself off the
> > > cpu until such time as the last transmitted skb is freed, allowing
> > > forward progress to be made.
> > >
> > > Tested by myself and the reporter, with good results
> > >
> > > Appies to the net tree
> > >
> > > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
> > > Reported-by: Matteo Croce <mcroce@redhat.com>
> > > CC: "David S. Miller" <davem@davemloft.net>
> > > ---
> >
> > This is a complex change for a narrow configuration. Isn't a
> > SCHED_FIFO process preempting ksoftirqd a potential problem for other
> > networking workloads as well? And the right configuration to always
> > increase ksoftirqd priority when increasing another process's
> > priority? Also, even when ksoftirqd kicks in, isn't some progress
> > still made on the local_bh_enable reached from schedule()?
> >
>
> A few questions here to answer:
Thanks for the detailed explanation.
> Regarding other protocols having this problem, thats not the case, because non
> packet sockets honor the SK_SNDTIMEO option here (i.e. they sleep for a period
> of time specified by the SNDTIMEO option if MSG_DONTWAIT isn't set. We could
> certainly do that, but the current implementation doesn't (opting instead to
> wait indefinately until the respective packet(s) have transmitted or errored
> out), and I wanted to maintain that behavior. If there is consensus that packet
> sockets should honor SNDTIMEO, then I can certainly do that.
>
> As for progress made by calling local_bh_enable, My read of the code doesn't
> have the scheduler calling local_bh_enable at all. Instead schedule uses
> preempt_disable/preempt_enable_no_resched() to gain exlcusive access to the cpu,
> which ignores pending softirqs on re-enablement.
Ah, I'm mistaken there, then.
> Perhaps that needs to change,
> but I'm averse to making scheduler changes for this (the aforementioned concern
> about complex changes for a narrow use case)
>
> Regarding raising the priority of ksoftirqd, that could be a solution, but the
> priority would need to be raised to a high priority SCHED_FIFO parameter, and
> that gets back to making complex changes for a narrow problem domain
>
> As for the comlexity of the of the solution, I think this is, given your
> comments the least complex and intrusive change to solve the given problem.
Could it be simpler to ensure do_softirq() gets run here? That would
allow progress for this case.
> We
> need to find a way to force the calling task off the cpu while the asynchronous
> operations in the transmit path complete, and we can do that this way, or by
> honoring SK_SNDTIMEO. I'm fine with doing the latter, but I didn't want to
> alter the current protocol behavior without consensus on that.
In general SCHED_FIFO is dangerous with regard to stalling other
progress, incl. ksoftirqd. But it does appear that this packet socket
case is special inside networking in calling schedule() directly here.
If converting that, should it convert to logic more akin to other
sockets, like sock_wait_for_wmem? I haven't had a chance to read up on
the pros and cons of completion here yet, sorry. Didn't want to delay
responding until after I get a chance.
^ permalink raw reply
* [PATCH v3] drm/i915: Check backlight type while doing eDP backlight initializaiton
From: Lee Shawn C @ 2019-06-20 15:44 UTC (permalink / raw)
To: intel-gfx; +Cc: Jani Nikula, Cooper Chiou
In-Reply-To: <1560933806-5184-1-git-send-email-shawn.c.lee@intel.com>
If LFP backlight type setting from VBT was "VESA eDP AUX Interface".
Driver should check panel capability and try to initialize aux backlight.
No matter i915_modparams.enable_dpcd_backlight was enabled or not.
v2: access dev_priv->vbt.backlight.type directly and remove unused function.
v3: 1. Modify i915.enable_dpcd_backlight type from bool to int and give default
value as 0 (disable).
2. Add a judgement to check LFP backlight type was aux interface or not.
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Cc: Jose Roberto de Souza <jose.souza@intel.com>
Cc: Cooper Chiou <cooper.chiou@intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee@intel.com>
---
drivers/gpu/drm/i915/display/intel_bios.h | 1 +
drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 5 ++++-
drivers/gpu/drm/i915/i915_params.c | 5 +++--
drivers/gpu/drm/i915/i915_params.h | 2 +-
4 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_bios.h b/drivers/gpu/drm/i915/display/intel_bios.h
index 4e42cfaf61a7..0b7be6389a07 100644
--- a/drivers/gpu/drm/i915/display/intel_bios.h
+++ b/drivers/gpu/drm/i915/display/intel_bios.h
@@ -42,6 +42,7 @@ enum intel_backlight_type {
INTEL_BACKLIGHT_DISPLAY_DDI,
INTEL_BACKLIGHT_DSI_DCS,
INTEL_BACKLIGHT_PANEL_DRIVER_INTERFACE,
+ INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE,
};
struct edp_power_seq {
diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
index 7ded95a334db..6b0b73479fb8 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c
@@ -264,8 +264,11 @@ intel_dp_aux_display_control_capable(struct intel_connector *connector)
int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector)
{
struct intel_panel *panel = &intel_connector->panel;
+ struct drm_i915_private *dev_priv = to_i915(intel_connector->base.dev);
- if (!i915_modparams.enable_dpcd_backlight)
+ if (i915_modparams.enable_dpcd_backlight == 0 ||
+ (i915_modparams.enable_dpcd_backlight == -1 &&
+ dev_priv->vbt.backlight.type != INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE))
return -ENODEV;
if (!intel_dp_aux_display_control_capable(intel_connector))
diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i915_params.c
index 5b07766a1c26..296452f9efe4 100644
--- a/drivers/gpu/drm/i915/i915_params.c
+++ b/drivers/gpu/drm/i915/i915_params.c
@@ -169,8 +169,9 @@ i915_param_named_unsafe(inject_load_failure, uint, 0400,
"Force an error after a number of failure check points (0:disabled (default), N:force failure at the Nth failure check point)");
#endif
-i915_param_named(enable_dpcd_backlight, bool, 0600,
- "Enable support for DPCD backlight control (default:false)");
+i915_param_named(enable_dpcd_backlight, int, 0600,
+ "Enable support for DPCD backlight control"
+ "(-1=use per-VBT LFP backlight type setting, 0=disabled [default], 1=enabled)");
#if IS_ENABLED(CONFIG_DRM_I915_GVT)
i915_param_named(enable_gvt, bool, 0400,
diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i915_params.h
index a4770ce46bd2..d29ade3b7de6 100644
--- a/drivers/gpu/drm/i915/i915_params.h
+++ b/drivers/gpu/drm/i915/i915_params.h
@@ -64,6 +64,7 @@ struct drm_printer;
param(int, reset, 2) \
param(unsigned int, inject_load_failure, 0) \
param(int, fastboot, -1) \
+ param(int, enable_dpcd_backlight, 0) \
param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE) \
/* leave bools at the end to not create holes */ \
param(bool, alpha_support, IS_ENABLED(CONFIG_DRM_I915_ALPHA_SUPPORT)) \
@@ -76,7 +77,6 @@ struct drm_printer;
param(bool, verbose_state_checks, true) \
param(bool, nuclear_pageflip, false) \
param(bool, enable_dp_mst, true) \
- param(bool, enable_dpcd_backlight, false) \
param(bool, enable_gvt, false)
#define MEMBER(T, member, ...) T member;
--
2.7.4
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related
* Re: drm connectors, tegra, and the web they weave (was Re: [PATCH 58/59] drm/todo: Add new debugfs todo)
From: Thierry Reding @ 2019-06-20 15:16 UTC (permalink / raw)
To: Jon Hunter
Cc: Greg Kroah-Hartman, Intel Graphics Development, DRI Development,
Daniel Vetter, linux-tegra, Daniel Vetter
In-Reply-To: <3271ab62-43dc-a845-45ff-c3dae62ad2d6@nvidia.com>
[-- Attachment #1.1: Type: text/plain, Size: 3250 bytes --]
On Tue, Jun 18, 2019 at 04:37:16PM +0100, Jon Hunter wrote:
>
> On 18/06/2019 16:19, Greg Kroah-Hartman wrote:
> > On Fri, Jun 14, 2019 at 10:36:14PM +0200, Daniel Vetter wrote:
> >> Greg is busy already, but maybe he won't do everything ...
> >>
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> >> ---
> >> Documentation/gpu/todo.rst | 3 +++
> >> 1 file changed, 3 insertions(+)
> >>
> >> diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
> >> index 9717540ee28f..026e55c517e1 100644
> >> --- a/Documentation/gpu/todo.rst
> >> +++ b/Documentation/gpu/todo.rst
> >> @@ -375,6 +375,9 @@ There's a bunch of issues with it:
> >> this (together with the drm_minor->drm_device move) would allow us to remove
> >> debugfs_init.
> >>
> >> +- Drop the return code and error checking from all debugfs functions. Greg KH is
> >> + working on this already.
> >
> >
> > Part of this work was to try to delete drm_debugfs_remove_files().
> >
> > There are only 4 files that currently still call this function:
> > drivers/gpu/drm/tegra/dc.c
> > drivers/gpu/drm/tegra/dsi.c
> > drivers/gpu/drm/tegra/hdmi.c
> > drivers/gpu/drm/tegra/sor.c
> >
> > For dc.c, the driver wants to add debugfs files to the struct drm_crtc
> > debugfs directory. Which is fine, but it has to do some special memory
> > allocation to get the debugfs callback to point not to the struct
> > drm_minor pointer, but rather the drm_crtc structure.
> >
> > So, to remove this call, I need to remove this special memory allocation
> > and to do that, I need to somehow be able to cast from drm_minor back to
> > the drm_crtc structure being used in this driver. And I can't figure
> > how they are related at all.
> >
> > Any pointers here (pun intended) would be appreciated.
> >
> > For the other 3 files, the situation is much the same, but I need to get
> > from a 'struct drm_minor' pointer to a 'struct drm_connector' pointer.
> >
> > I could just "open code" a bunch of calls to debugfs_create_file() for
> > these drivers, which would solve this issue, but in a more "non-drm"
> > way. Is it worth to just do that instead of overthinking the whole
> > thing and trying to squish it into the drm "model" of drm debugfs calls?
> >
> > Either way, who can test these changes? I can't even build the tegra
> > driver without digging up an arm64 cross-compiler, and can't test it as
> > I have no hardware at all.
>
> We can definitely compile and boot test these no problem. In fact
> anything that lands in -next we will boot test. However, I can do some
> quick sanity if you have something to test.
>
> Thierry may have more specific Tegra DRM tests.
We don't have any automated tests for this yet, unfortunately. Let me
work on something. In the meantime I can manually test any of the
patches that Greg sends out. These should be fairly trivial to test.
It's difficult to check for success/failure on something like the
register dump or the CRC, but I think for now we don't really need much
more than just validating that things don't crash when we read one of
these debugfs files.
Thierry
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* [Buildroot] [PATCH 0/3] Update Busybox to 1.31 and use mdev daemon mode
From: Peter Korsgaard @ 2019-06-20 15:16 UTC (permalink / raw)
To: buildroot
In-Reply-To: <20190620163154.7a6b743b@windsurf>
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:
> On Wed, 19 Jun 2019 18:42:54 +0200
> Titouan Christophe <titouan.christophe@railnova.eu> wrote:
>> Titouan Christophe (3):
>> package/busybox: bump version to 1.31.0
>> package/busybox: convert S10mdev to the canonical init script format
>> package/busybox: run mdev in daemon mode
> Series applied. Thanks!
Yes, thanks. We still need to force CONFIG_NET=y in the Linux kernel if
mdev is enabled, right?
--
Bye, Peter Korsgaard
^ permalink raw reply
* Re: [RFC PATCH 1/4] dt-bindings: display: Convert common panel bindings to DT schema
From: Rob Herring @ 2019-06-20 15:15 UTC (permalink / raw)
To: Sam Ravnborg
Cc: dri-devel, devicetree, Maxime Ripard, Thierry Reding,
linux-kernel@vger.kernel.org, Laurent Pinchart
In-Reply-To: <20190620065508.GA24739@ravnborg.org>
On Thu, Jun 20, 2019 at 12:55 AM Sam Ravnborg <sam@ravnborg.org> wrote:
>
> Hi Rob.
>
> Thanks for starting the conversion of panel bindings to yaml.
>
> On Wed, Jun 19, 2019 at 03:51:53PM -0600, Rob Herring wrote:
> > Convert the common panel bindings to DT schema consolidating scattered
> > definitions to a single schema file.
> >
> > The 'simple-panel' binding just a collection of properties and not a
> > complete binding itself. All of the 'simple-panel' properties are
> > covered by the panel-common.txt binding with the exception of the
> > 'no-hpd' property, so add that to the schema.
> >
> > As there are lots of references to simple-panel.txt, just keep the file
> > with a reference to panel-common.yaml for now until all the bindings are
> > converted.
> Good idea.
>
> >
> > Cc: Thierry Reding <thierry.reding@gmail.com>
> > Cc: Sam Ravnborg <sam@ravnborg.org>
> > Cc: Maxime Ripard <maxime.ripard@bootlin.com>
> > Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> > Cc: dri-devel@lists.freedesktop.org
> > Signed-off-by: Rob Herring <robh@kernel.org>
> > ---
> > Note there's still some references to panel-common.txt that I need to
> > update or just go ahead and convert to schema.
> Better let it point to the .yaml variant, so this patchset does not
> depend on too much other bindings to be converted.
There's only 8 files referencing panel-common.txt which was why I was
debating just converting all of them.
> Then we can start the conversion of the remaining panel bindings.
> Any tooling that helps the conversions?
I have a doc2yaml script that helps with some of the boilerplate. It's
in my yaml-bindings-v2 branch[1].
> When this hits upstream I assume all future panel bindings shall be yaml
> based - so we have a few pending contributions that need to do something.
That would be ideal, but not strictly required. For pending things, no
reason to make folks redo things. Requiring schema really depends on
whomever is applying things to run at least 'make dt_binding_check'
before accepting.
>
> For the actual conversion below:
> Acked-by: Sam Ravnborg <sam@ravnborg.org>
Thanks.
Rob
[1] https://git.kernel.org/pub/scm/linux/kernel/git/robh/linux.git/log/?h=yaml-bindings-v2
^ permalink raw reply
* ✓ Fi.CI.IGT: success for series starting with [v6,1/4] drm/i915/bdw+: Move misc display IRQ handling to it own function
From: Patchwork @ 2019-06-20 15:15 UTC (permalink / raw)
To: Souza, Jose; +Cc: intel-gfx
In-Reply-To: <20190619230222.4346-1-jose.souza@intel.com>
== Series Details ==
Series: series starting with [v6,1/4] drm/i915/bdw+: Move misc display IRQ handling to it own function
URL : https://patchwork.freedesktop.org/series/62416/
State : success
== Summary ==
CI Bug Log - changes from CI_DRM_6312_full -> Patchwork_13355_full
====================================================
Summary
-------
**SUCCESS**
No regressions found.
Known issues
------------
Here are the changes found in Patchwork_13355_full that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@gem_eio@in-flight-contexts-1us:
- shard-kbl: [PASS][1] -> [DMESG-WARN][2] ([fdo#110913 ]) +2 similar issues
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-kbl6/igt@gem_eio@in-flight-contexts-1us.html
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-kbl6/igt@gem_eio@in-flight-contexts-1us.html
* igt@gem_eio@in-flight-suspend:
- shard-kbl: [PASS][3] -> [FAIL][4] ([fdo#110667])
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-kbl3/igt@gem_eio@in-flight-suspend.html
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-kbl2/igt@gem_eio@in-flight-suspend.html
* igt@gem_persistent_relocs@forked-faulting-reloc-thrashing:
- shard-snb: [PASS][5] -> [DMESG-WARN][6] ([fdo#110789] / [fdo#110913 ])
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-snb6/igt@gem_persistent_relocs@forked-faulting-reloc-thrashing.html
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-snb5/igt@gem_persistent_relocs@forked-faulting-reloc-thrashing.html
* igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing:
- shard-apl: [PASS][7] -> [DMESG-WARN][8] ([fdo#110913 ])
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-apl8/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-apl6/igt@gem_persistent_relocs@forked-interruptible-faulting-reloc-thrashing.html
* igt@gem_tiled_swapping@non-threaded:
- shard-hsw: [PASS][9] -> [FAIL][10] ([fdo#108686])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-hsw8/igt@gem_tiled_swapping@non-threaded.html
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-hsw8/igt@gem_tiled_swapping@non-threaded.html
* igt@i915_pm_rc6_residency@rc6-accuracy:
- shard-snb: [PASS][11] -> [SKIP][12] ([fdo#109271])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-snb1/igt@i915_pm_rc6_residency@rc6-accuracy.html
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-snb6/igt@i915_pm_rc6_residency@rc6-accuracy.html
* igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy:
- shard-hsw: [PASS][13] -> [FAIL][14] ([fdo#105767])
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-hsw7/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-hsw4/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-legacy.html
* igt@kms_flip@2x-plain-flip-ts-check-interruptible:
- shard-hsw: [PASS][15] -> [SKIP][16] ([fdo#109271]) +38 similar issues
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-hsw6/igt@kms_flip@2x-plain-flip-ts-check-interruptible.html
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-hsw1/igt@kms_flip@2x-plain-flip-ts-check-interruptible.html
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc:
- shard-skl: [PASS][17] -> [FAIL][18] ([fdo#108040])
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-skl3/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc.html
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-skl2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-pri-indfb-draw-mmap-wc.html
* igt@kms_frontbuffer_tracking@psr-suspend:
- shard-skl: [PASS][19] -> [INCOMPLETE][20] ([fdo#104108] / [fdo#106978])
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-skl5/igt@kms_frontbuffer_tracking@psr-suspend.html
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-skl2/igt@kms_frontbuffer_tracking@psr-suspend.html
* igt@kms_pipe_crc_basic@hang-read-crc-pipe-c:
- shard-skl: [PASS][21] -> [FAIL][22] ([fdo#103191])
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-skl3/igt@kms_pipe_crc_basic@hang-read-crc-pipe-c.html
[22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-skl7/igt@kms_pipe_crc_basic@hang-read-crc-pipe-c.html
* igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
- shard-apl: [PASS][23] -> [DMESG-WARN][24] ([fdo#108566]) +3 similar issues
[23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-apl1/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
[24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-apl2/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
* igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
- shard-skl: [PASS][25] -> [FAIL][26] ([fdo#108145]) +2 similar issues
[25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-skl3/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
[26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
* igt@kms_setmode@basic:
- shard-apl: [PASS][27] -> [FAIL][28] ([fdo#99912])
[27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-apl6/igt@kms_setmode@basic.html
[28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-apl8/igt@kms_setmode@basic.html
#### Possible fixes ####
* igt@gem_eio@wait-10ms:
- shard-apl: [DMESG-WARN][29] ([fdo#110913 ]) -> [PASS][30]
[29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-apl8/igt@gem_eio@wait-10ms.html
[30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-apl5/igt@gem_eio@wait-10ms.html
* igt@gem_persistent_relocs@forked-interruptible-thrashing:
- shard-snb: [DMESG-WARN][31] ([fdo#110789] / [fdo#110913 ]) -> [PASS][32]
[31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-snb4/igt@gem_persistent_relocs@forked-interruptible-thrashing.html
[32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-snb1/igt@gem_persistent_relocs@forked-interruptible-thrashing.html
* igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
- shard-kbl: [DMESG-WARN][33] ([fdo#110913 ]) -> [PASS][34] +1 similar issue
[33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-kbl1/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
[34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-kbl7/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
* igt@kms_cursor_edge_walk@pipe-b-128x128-top-edge:
- shard-snb: [SKIP][35] ([fdo#109271] / [fdo#109278]) -> [PASS][36]
[35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-snb2/igt@kms_cursor_edge_walk@pipe-b-128x128-top-edge.html
[36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-snb2/igt@kms_cursor_edge_walk@pipe-b-128x128-top-edge.html
* igt@kms_flip@2x-flip-vs-expired-vblank-interruptible:
- shard-hsw: [SKIP][37] ([fdo#109271]) -> [PASS][38] +33 similar issues
[37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-hsw1/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
[38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-hsw8/igt@kms_flip@2x-flip-vs-expired-vblank-interruptible.html
* igt@kms_frontbuffer_tracking@fbc-suspend:
- shard-apl: [DMESG-WARN][39] ([fdo#108566]) -> [PASS][40]
[39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-apl3/igt@kms_frontbuffer_tracking@fbc-suspend.html
[40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-apl2/igt@kms_frontbuffer_tracking@fbc-suspend.html
* igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
- shard-skl: [INCOMPLETE][41] ([fdo#104108]) -> [PASS][42]
[41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-skl4/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html
[42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-skl7/igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c.html
* igt@kms_plane@plane-panning-bottom-right-pipe-b-planes:
- shard-snb: [SKIP][43] ([fdo#109271]) -> [PASS][44] +1 similar issue
[43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-snb2/igt@kms_plane@plane-panning-bottom-right-pipe-b-planes.html
[44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-snb2/igt@kms_plane@plane-panning-bottom-right-pipe-b-planes.html
* igt@kms_setmode@basic:
- shard-kbl: [FAIL][45] ([fdo#99912]) -> [PASS][46]
[45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-kbl1/igt@kms_setmode@basic.html
[46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-kbl2/igt@kms_setmode@basic.html
#### Warnings ####
* igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt:
- shard-skl: [FAIL][47] ([fdo#103167]) -> [FAIL][48] ([fdo#108040])
[47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6312/shard-skl1/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt.html
[48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/shard-skl5/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-spr-indfb-draw-mmap-gtt.html
[fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
[fdo#103191]: https://bugs.freedesktop.org/show_bug.cgi?id=103191
[fdo#104108]: https://bugs.freedesktop.org/show_bug.cgi?id=104108
[fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
[fdo#106978]: https://bugs.freedesktop.org/show_bug.cgi?id=106978
[fdo#108040]: https://bugs.freedesktop.org/show_bug.cgi?id=108040
[fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
[fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
[fdo#108686]: https://bugs.freedesktop.org/show_bug.cgi?id=108686
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#109278]: https://bugs.freedesktop.org/show_bug.cgi?id=109278
[fdo#110667]: https://bugs.freedesktop.org/show_bug.cgi?id=110667
[fdo#110789]: https://bugs.freedesktop.org/show_bug.cgi?id=110789
[fdo#110913 ]: https://bugs.freedesktop.org/show_bug.cgi?id=110913
[fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912
Participating hosts (10 -> 9)
------------------------------
Missing (1): shard-iclb
Build changes
-------------
* Linux: CI_DRM_6312 -> Patchwork_13355
CI_DRM_6312: 034e3ac6a2d180d188da927388b60c7e62c5655b @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5061: c88ced79a7b71aec58f1d9c5c599ac2f431bcf7a @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_13355: 413c4f5206bbad8c1ec87fbee44d6013659e600d @ git://anongit.freedesktop.org/gfx-ci/linux
piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_13355/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply
* [PATCH next] softirq: enable MAX_SOFTIRQ_TIME tuning with sysctl max_softirq_time_usecs
From: Zhiqiang Liu @ 2019-06-20 15:14 UTC (permalink / raw)
To: corbet, mcgrof, Kees Cook
Cc: akpm, manfred, jwilk, dvyukov, feng.tang, sunilmut,
quentin.perret, linux, alex.popov, tglx, linux-doc, linux-kernel,
linux-fsdevel, wangxiaogang (F), Zhoukang (A), Mingfangsen,
tedheadster, Eric Dumazet
From: Zhiqiang liu <liuzhiqiang26@huawei.com>
In __do_softirq func, MAX_SOFTIRQ_TIME was set to 2ms via experimentation by
commit c10d73671 ("softirq: reduce latencies") in 2013, which was designed
to reduce latencies for various network workloads. The key reason is that the
maximum number of microseconds in one NAPI polling cycle in net_rx_action func
was set to 2 jiffies, so different HZ settting will lead to different latencies.
However, commit 7acf8a1e8 ("Replace 2 jiffies with sysctl netdev_budget_usecs
to enable softirq tuning") adopts netdev_budget_usecs to tun maximum number of
microseconds in one NAPI polling cycle. So the latencies of net_rx_action can be
controlled by sysadmins to copy with hardware changes over time.
Correspondingly, the MAX_SOFTIRQ_TIME should be able to be tunned by sysadmins,
who knows best about hardware performance, for excepted tradeoff between latence
and fairness.
Here, we add sysctl variable max_softirq_time_usecs to replace MAX_SOFTIRQ_TIME
with 2ms default value.
Signed-off-by: Zhiqiang liu <liuzhiqiang26@huawei.com>
---
Documentation/sysctl/kernel.txt | 7 +++++++
kernel/softirq.c | 10 ++++++----
kernel/sysctl.c | 9 +++++++++
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/Documentation/sysctl/kernel.txt b/Documentation/sysctl/kernel.txt
index f0c86fbb3b48..647233faf896 100644
--- a/Documentation/sysctl/kernel.txt
+++ b/Documentation/sysctl/kernel.txt
@@ -44,6 +44,7 @@ show up in /proc/sys/kernel:
- kexec_load_disabled
- kptr_restrict
- l2cr [ PPC only ]
+- max_softirq_time_usecs
- modprobe ==> Documentation/debugging-modules.txt
- modules_disabled
- msg_next_id [ sysv ipc ]
@@ -445,6 +446,12 @@ This flag controls the L2 cache of G3 processor boards. If
==============================================================
+max_softirq_time_usecs:
+Maximum number of microseconds to break the loop of restarting softirq
+processing for at most MAX_SOFTIRQ_RESTART times in __do_softirq().
+
+==============================================================
+
modules_disabled:
A toggle value indicating if modules are allowed to be loaded
diff --git a/kernel/softirq.c b/kernel/softirq.c
index a6b81c6b6bff..32f93d82e2e8 100644
--- a/kernel/softirq.c
+++ b/kernel/softirq.c
@@ -199,8 +199,9 @@ EXPORT_SYMBOL(__local_bh_enable_ip);
/*
* We restart softirq processing for at most MAX_SOFTIRQ_RESTART times,
- * but break the loop if need_resched() is set or after 2 ms.
- * The MAX_SOFTIRQ_TIME provides a nice upper bound in most cases, but in
+ * but break the loop if need_resched() is set or after
+ * max_softirq_time_usecs usecs.
+ * The max_softirq_time_usecs provides a nice upper bound in most cases, but in
* certain cases, such as stop_machine(), jiffies may cease to
* increment and so we need the MAX_SOFTIRQ_RESTART limit as
* well to make sure we eventually return from this method.
@@ -210,7 +211,7 @@ EXPORT_SYMBOL(__local_bh_enable_ip);
* we want to handle softirqs as soon as possible, but they
* should not be able to lock up the box.
*/
-#define MAX_SOFTIRQ_TIME msecs_to_jiffies(2)
+unsigned int __read_mostly max_softirq_time_usecs = 2000;
#define MAX_SOFTIRQ_RESTART 10
#ifdef CONFIG_TRACE_IRQFLAGS
@@ -248,7 +249,8 @@ static inline void lockdep_softirq_end(bool in_hardirq) { }
asmlinkage __visible void __softirq_entry __do_softirq(void)
{
- unsigned long end = jiffies + MAX_SOFTIRQ_TIME;
+ unsigned long end = jiffies +
+ usecs_to_jiffies(max_softirq_time_usecs);
unsigned long old_flags = current->flags;
int max_restart = MAX_SOFTIRQ_RESTART;
struct softirq_action *h;
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 1beca96fb625..db4bc18f84de 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -118,6 +118,7 @@ extern unsigned int sysctl_nr_open_min, sysctl_nr_open_max;
#ifndef CONFIG_MMU
extern int sysctl_nr_trim_pages;
#endif
+extern unsigned int max_softirq_time_usecs;
/* Constants used for minimum and maximum */
#ifdef CONFIG_LOCKUP_DETECTOR
@@ -1276,6 +1277,14 @@ static struct ctl_table kern_table[] = {
.extra2 = &one,
},
#endif
+ {
+ .procname = "max_softirq_time_usecs",
+ .data = &max_softirq_time_usecs,
+ .maxlen = sizeof(unsigned int),
+ .mode = 0644,
+ .proc_handler = proc_dointvec_minmax,
+ .extra1 = &zero,
+ },
{ }
};
--
2.19.1
^ permalink raw reply related
* Re: [PATCH v5 4/7] i2c: core: Make i2c_acpi_get_irq available to the rest of the I2C core
From: Charles Keepax @ 2019-06-20 15:12 UTC (permalink / raw)
To: Andy Shevchenko
Cc: wsa, mika.westerberg, jarkko.nikula, linux-i2c, linux-acpi,
linux-kernel, benjamin.tissoires, jbroadus, patches
In-Reply-To: <20190620145950.GE9224@smile.fi.intel.com>
On Thu, Jun 20, 2019 at 05:59:50PM +0300, Andy Shevchenko wrote:
> On Thu, Jun 20, 2019 at 02:34:17PM +0100, Charles Keepax wrote:
> > In preparation for more refactoring make i2c_acpi_get_irq available
> > outside i2c-core-acpi.c.
>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> I'm not sure Rb tags are suitable for patches 4 and 5 since the changes made.
>
Apologies I figured the changes were small enough will remove for
any changes in future.
> > +struct acpi_device;
>
> Hmm... Doesn't acpi.h define that for !ACPI case?
>
Pretty sure I was getting a build error in that case.
> > #ifdef CONFIG_ACPI
> > const struct acpi_device_id *
> > i2c_acpi_match_device(const struct acpi_device_id *matches,
> > struct i2c_client *client);
> > void i2c_acpi_register_devices(struct i2c_adapter *adap);
> > +
> > +int i2c_acpi_get_irq(struct acpi_device *adev);
>
> Since you call this afterwards with struct device from which companion is
> derived, can't we directly use struct device as a parameter?
>
> Yes, in case of adev call, it might be &adev->dev I suppose?
>
A good idea I will investigate and do a respin taking in the
other comments too.
Thanks,
Charles
^ permalink raw reply
* Re: [dpdk-dev] [RFC] app/testpmd: add profiling for Rx/Tx burst routines
From: Iremonger, Bernard @ 2019-06-20 15:15 UTC (permalink / raw)
To: Slava Ovsiienko, dev@dpdk.org; +Cc: Yigit, Ferruh
In-Reply-To: <AM4PR05MB32651491F4B46F7F4FED6608D2130@AM4PR05MB3265.eurprd05.prod.outlook.com>
Hi Slava,
> -----Original Message-----
> From: Slava Ovsiienko [mailto:viacheslavo@mellanox.com]
> Sent: Monday, June 10, 2019 5:40 AM
> To: Iremonger, Bernard <bernard.iremonger@intel.com>; dev@dpdk.org
> Cc: Yigit, Ferruh <ferruh.yigit@intel.com>
> Subject: RE: [dpdk-dev] [RFC] app/testpmd: add profiling for Rx/Tx burst
> routines
>
<snip>
> > > static void
> > > diff --git a/config/common_base b/config/common_base index
> > > 6b96e0e..6e84af4 100644
> > > --- a/config/common_base
> > > +++ b/config/common_base
> > > @@ -998,6 +998,8 @@ CONFIG_RTE_PROC_INFO=n #
> > CONFIG_RTE_TEST_PMD=y
> > > CONFIG_RTE_TEST_PMD_RECORD_CORE_CYCLES=n
> > > +CONFIG_RTE_TEST_PMD_RECORD_CORE_RX_CYCLES=n
> > > +CONFIG_RTE_TEST_PMD_RECORD_CORE_TX_CYCLES=n
> > > CONFIG_RTE_TEST_PMD_RECORD_BURST_STATS=n
> >
> > Should the RECORD macros be documented in the run_app.rst file ?
You missed the above comment in your reply.
There seems to be no documentation on the RECORD macros at present, there probably should be some.
Regards,
Bernard.
^ permalink raw reply
* [Qemu-devel] [PATCH v4 12/13] vfio: Make vfio-pci device migration capable.
From: Kirti Wankhede @ 2019-06-20 14:37 UTC (permalink / raw)
To: alex.williamson, cjia
Cc: Kirti Wankhede, Zhengxiao.zx, kevin.tian, yi.l.liu, yan.y.zhao,
eskultet, ziye.yang, qemu-devel, cohuck, shuangtai.tst, dgilbert,
zhi.a.wang, mlevitsk, pasic, aik, yulei.zhang, eauger, felipe,
jonathan.davies, changpeng.liu, Ken.Xue
In-Reply-To: <1561041461-22326-1-git-send-email-kwankhede@nvidia.com>
Call vfio_migration_probe() and vfio_migration_finalize() functions for
vfio-pci device to enable migration for vfio PCI device.
Removed vfio_pci_vmstate structure.
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
---
hw/vfio/pci.c | 14 ++++++++------
1 file changed, 8 insertions(+), 6 deletions(-)
diff --git a/hw/vfio/pci.c b/hw/vfio/pci.c
index 09a0821a5b1c..b230b0ab9282 100644
--- a/hw/vfio/pci.c
+++ b/hw/vfio/pci.c
@@ -2839,6 +2839,7 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
vdev->vbasedev.ops = &vfio_pci_ops;
vdev->vbasedev.type = VFIO_DEVICE_TYPE_PCI;
vdev->vbasedev.dev = DEVICE(vdev);
+ vdev->vbasedev.device_state = VFIO_DEVICE_STATE_STOPPED;
tmp = g_strdup_printf("%s/iommu_group", vdev->vbasedev.sysfsdev);
len = readlink(tmp, group_path, sizeof(group_path));
@@ -3099,6 +3100,11 @@ static void vfio_realize(PCIDevice *pdev, Error **errp)
}
}
+ ret = vfio_migration_probe(&vdev->vbasedev, errp);
+ if (ret) {
+ error_report("Failed to setup migration region");
+ }
+
vfio_register_err_notifier(vdev);
vfio_register_req_notifier(vdev);
vfio_setup_resetfn_quirk(vdev);
@@ -3118,6 +3124,7 @@ static void vfio_instance_finalize(Object *obj)
VFIOPCIDevice *vdev = PCI_VFIO(obj);
VFIOGroup *group = vdev->vbasedev.group;
+ vdev->vbasedev.device_state = VFIO_DEVICE_STATE_STOPPED;
vfio_display_finalize(vdev);
vfio_bars_finalize(vdev);
g_free(vdev->emulated_config_bits);
@@ -3146,6 +3153,7 @@ static void vfio_exitfn(PCIDevice *pdev)
}
vfio_teardown_msi(vdev);
vfio_bars_exit(vdev);
+ vfio_migration_finalize(&vdev->vbasedev);
}
static void vfio_pci_reset(DeviceState *dev)
@@ -3254,11 +3262,6 @@ static Property vfio_pci_dev_properties[] = {
DEFINE_PROP_END_OF_LIST(),
};
-static const VMStateDescription vfio_pci_vmstate = {
- .name = "vfio-pci",
- .unmigratable = 1,
-};
-
static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
{
DeviceClass *dc = DEVICE_CLASS(klass);
@@ -3266,7 +3269,6 @@ static void vfio_pci_dev_class_init(ObjectClass *klass, void *data)
dc->reset = vfio_pci_reset;
dc->props = vfio_pci_dev_properties;
- dc->vmsd = &vfio_pci_vmstate;
dc->desc = "VFIO-based PCI device assignment";
set_bit(DEVICE_CATEGORY_MISC, dc->categories);
pdc->realize = vfio_realize;
--
2.7.0
^ permalink raw reply related
* [Qemu-devel] [PATCH v4 10/13] vfio: Add function to get dirty page list
From: Kirti Wankhede @ 2019-06-20 14:37 UTC (permalink / raw)
To: alex.williamson, cjia
Cc: Kirti Wankhede, Zhengxiao.zx, kevin.tian, yi.l.liu, yan.y.zhao,
eskultet, ziye.yang, qemu-devel, cohuck, shuangtai.tst, dgilbert,
zhi.a.wang, mlevitsk, pasic, aik, yulei.zhang, eauger, felipe,
jonathan.davies, changpeng.liu, Ken.Xue
In-Reply-To: <1561041461-22326-1-git-send-email-kwankhede@nvidia.com>
Dirty page tracking (.log_sync) is part of RAM copying state, where
vendor driver provides the bitmap of pages which are dirtied by vendor
driver through migration region and as part of RAM copy, those pages
gets copied to file stream.
To get dirty page bitmap:
- write start address, page_size and pfn count.
- read count of pfns copied.
- Vendor driver should return 0 if driver doesn't have any page to
report dirty in given range.
- Vendor driver should return -1 to mark all pages dirty for given range.
- read data_offset, where vendor driver has written bitmap.
- read bitmap from the region or mmaped part of the region. This copy is
iterated till page bitmap for all requested pfns are copied.
Signed-off-by: Kirti Wankhede <kwankhede@nvidia.com>
Reviewed-by: Neo Jia <cjia@nvidia.com>
---
hw/vfio/migration.c | 119 ++++++++++++++++++++++++++++++++++++++++++
include/hw/vfio/vfio-common.h | 2 +
2 files changed, 121 insertions(+)
diff --git a/hw/vfio/migration.c b/hw/vfio/migration.c
index e4895f91761d..68775b5dec11 100644
--- a/hw/vfio/migration.c
+++ b/hw/vfio/migration.c
@@ -228,6 +228,125 @@ static int vfio_load_device_config_state(QEMUFile *f, void *opaque)
return qemu_file_get_error(f);
}
+void vfio_get_dirty_page_list(VFIODevice *vbasedev,
+ uint64_t start_pfn,
+ uint64_t pfn_count,
+ uint64_t page_size)
+{
+ VFIOMigration *migration = vbasedev->migration;
+ VFIORegion *region = &migration->region.buffer;
+ uint64_t count = 0;
+ int64_t copied_pfns = 0;
+ int ret;
+
+ qemu_mutex_lock(&migration->lock);
+ ret = pwrite(vbasedev->fd, &start_pfn, sizeof(start_pfn),
+ region->fd_offset + offsetof(struct vfio_device_migration_info,
+ start_pfn));
+ if (ret < 0) {
+ error_report("Failed to set dirty pages start address %d %s",
+ ret, strerror(errno));
+ goto dpl_unlock;
+ }
+
+ ret = pwrite(vbasedev->fd, &page_size, sizeof(page_size),
+ region->fd_offset + offsetof(struct vfio_device_migration_info,
+ page_size));
+ if (ret < 0) {
+ error_report("Failed to set dirty page size %d %s",
+ ret, strerror(errno));
+ goto dpl_unlock;
+ }
+
+ ret = pwrite(vbasedev->fd, &pfn_count, sizeof(pfn_count),
+ region->fd_offset + offsetof(struct vfio_device_migration_info,
+ total_pfns));
+ if (ret < 0) {
+ error_report("Failed to set dirty page total pfns %d %s",
+ ret, strerror(errno));
+ goto dpl_unlock;
+ }
+
+ do {
+ uint64_t bitmap_size, data_offset = 0;
+ void *buf = NULL;
+ bool buffer_mmaped = false;
+
+ /* Read copied dirty pfns */
+ ret = pread(vbasedev->fd, &copied_pfns, sizeof(copied_pfns),
+ region->fd_offset + offsetof(struct vfio_device_migration_info,
+ copied_pfns));
+ if (ret < 0) {
+ error_report("Failed to get dirty pages bitmap count %d %s",
+ ret, strerror(errno));
+ goto dpl_unlock;
+ }
+
+ if (copied_pfns == 0) {
+ /*
+ * copied_pfns could be 0 if driver doesn't have any page to
+ * report dirty in given range
+ */
+ break;
+ } else if (copied_pfns == -1) {
+ /* Mark all pages dirty for this range */
+ cpu_physical_memory_set_dirty_range(start_pfn * page_size,
+ pfn_count * page_size,
+ DIRTY_MEMORY_MIGRATION);
+ break;
+ }
+
+ bitmap_size = (BITS_TO_LONGS(copied_pfns) + 1) * sizeof(unsigned long);
+
+ ret = pread(vbasedev->fd, &data_offset, sizeof(data_offset),
+ region->fd_offset + offsetof(struct vfio_device_migration_info,
+ data_offset));
+ if (ret != sizeof(data_offset)) {
+ error_report("Failed to get migration buffer data offset %d",
+ ret);
+ goto dpl_unlock;
+ }
+
+ if (region->mmaps) {
+ int i;
+ for (i = 0; i < region->nr_mmaps; i++) {
+ if ((region->mmaps[i].offset >= data_offset) &&
+ (data_offset < region->mmaps[i].offset +
+ region->mmaps[i].size)) {
+ buf = region->mmaps[i].mmap + (data_offset -
+ region->mmaps[i].offset);
+ buffer_mmaped = true;
+ break;
+ }
+ }
+ }
+
+ if (!buffer_mmaped) {
+ buf = g_malloc0(bitmap_size);
+
+ ret = pread(vbasedev->fd, buf, bitmap_size,
+ region->fd_offset + data_offset);
+ if (ret != bitmap_size) {
+ error_report("Failed to get dirty pages bitmap %d", ret);
+ g_free(buf);
+ goto dpl_unlock;
+ }
+ }
+
+ cpu_physical_memory_set_dirty_lebitmap((unsigned long *)buf,
+ (start_pfn + count) * page_size,
+ copied_pfns);
+ count += copied_pfns;
+
+ if (!buffer_mmaped) {
+ g_free(buf);
+ }
+ } while (count < pfn_count);
+
+dpl_unlock:
+ qemu_mutex_unlock(&migration->lock);
+}
+
/* ---------------------------------------------------------------------- */
static int vfio_save_setup(QEMUFile *f, void *opaque)
diff --git a/include/hw/vfio/vfio-common.h b/include/hw/vfio/vfio-common.h
index 1d26e6be8d48..423d6dbccace 100644
--- a/include/hw/vfio/vfio-common.h
+++ b/include/hw/vfio/vfio-common.h
@@ -224,5 +224,7 @@ int vfio_spapr_remove_window(VFIOContainer *container,
int vfio_migration_probe(VFIODevice *vbasedev, Error **errp);
void vfio_migration_finalize(VFIODevice *vbasedev);
+void vfio_get_dirty_page_list(VFIODevice *vbasedev, uint64_t start_pfn,
+ uint64_t pfn_count, uint64_t page_size);
#endif /* HW_VFIO_VFIO_COMMON_H */
--
2.7.0
^ permalink raw reply related
* Re: [PATCH v1] backlight: gpio_backlight: Enable ACPI enumeration
From: Andy Shevchenko @ 2019-06-20 15:12 UTC (permalink / raw)
To: Daniel Thompson; +Cc: Jingoo Han, Lee Jones, dri-devel
In-Reply-To: <8919f52e-c745-503d-806d-aa605ddc8325@linaro.org>
On Thu, Jun 20, 2019 at 03:12:05PM +0100, Daniel Thompson wrote:
> On 19/06/2019 16:21, Andy Shevchenko wrote:
> > ACPI allows to enumerate specific devices by using compatible strings.
> > Enable that enumeration for GPIO based backlight devices.
> > + dev_err(&pdev->dev,
> > + "failed to find platform data or device tree node.\n");
>
> Should the string also be updated?
I don't think it's necessary. The device tree compatible mode is for DT
drivers, so, it is assumed that person knows much enough and this message would
be useful as is.
> If what is updated to acknoledge option to use ACPI then:
> Acked-by: Daniel Thompson <daniel.thompson@linaro.org>
Thanks!
--
With Best Regards,
Andy Shevchenko
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
^ permalink raw reply
* Re: [PATCH v5 4/7] i2c: core: Make i2c_acpi_get_irq available to the rest of the I2C core
From: Charles Keepax @ 2019-06-20 15:12 UTC (permalink / raw)
To: Andy Shevchenko
Cc: wsa, mika.westerberg, jarkko.nikula, linux-i2c, linux-acpi,
linux-kernel, benjamin.tissoires, jbroadus, patches
In-Reply-To: <20190620145950.GE9224@smile.fi.intel.com>
On Thu, Jun 20, 2019 at 05:59:50PM +0300, Andy Shevchenko wrote:
> On Thu, Jun 20, 2019 at 02:34:17PM +0100, Charles Keepax wrote:
> > In preparation for more refactoring make i2c_acpi_get_irq available
> > outside i2c-core-acpi.c.
>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Reviewed-by: Mika Westerberg <mika.westerberg@linux.intel.com>
>
> I'm not sure Rb tags are suitable for patches 4 and 5 since the changes made.
>
Apologies I figured the changes were small enough will remove for
any changes in future.
> > +struct acpi_device;
>
> Hmm... Doesn't acpi.h define that for !ACPI case?
>
Pretty sure I was getting a build error in that case.
> > #ifdef CONFIG_ACPI
> > const struct acpi_device_id *
> > i2c_acpi_match_device(const struct acpi_device_id *matches,
> > struct i2c_client *client);
> > void i2c_acpi_register_devices(struct i2c_adapter *adap);
> > +
> > +int i2c_acpi_get_irq(struct acpi_device *adev);
>
> Since you call this afterwards with struct device from which companion is
> derived, can't we directly use struct device as a parameter?
>
> Yes, in case of adev call, it might be &adev->dev I suppose?
>
A good idea I will investigate and do a respin taking in the
other comments too.
Thanks,
Charles
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.