Add comment to memory barrier
Subsystems (2)
v2 cover Add comment to memory barrier
Include outreachy mailing list in "cc" list. No change
Evan Chime (3):
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrier
drivers/staging/media/omap4iss/iss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
Signature · 1 line
2.17.1
PATCH v2 1/3 Staging: media: omap4iss: Add comment to memory barrier
Fix "WARNING: memory barrier without comment" from checkpath. Add comment to memory barrier smp_wmb() on line 635
--- drivers/staging/media/omap4iss/iss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/omap4iss/iss.c +1 -1
@@ -632,7 +632,7 @@ int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait,* scenario. We'll call it here to avoid race conditions. */ atomic_set (stopping,1 ); -smp_wmb (); +smp_wmb ();/* Prevents stores from being reordered across the barrier */ /* * If module is the last one, it's writing to memory. In this case,
Signature · 1 line
2.17.1
PATCH v2 2/3 Staging: media: omap4iss: Add comment to memory barrier
In reply to Evan ChimeFix "WARNING: memory barrier without comment" from checkpath. Add comment to memory barrier smp_wmb() on line 653
--- drivers/staging/media/omap4iss/iss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/omap4iss/iss.c +1 -1
@@ -650,7 +650,7 @@ int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait,if (video->dmaqueue_flags &ISS_VIDEO_DMAQUEUE_UNDERRUN ) {spin_unlock_irqrestore (&video->qlock, flags);atomic_set (stopping,0 ); -smp_wmb (); +smp_wmb ();/* Prevent stores reordering across the barrier */ return 0 ; }spin_unlock_irqrestore (&video->qlock, flags);
Signature · 1 line
2.17.1
PATCH v2 3/3 Staging: media: omap4iss: Add comment to memory barrier
In reply to Evan ChimeFix "WARNING: memory barrier without comment" from checkpath. Add comment to memory barrier smp_wmb() on line 660
--- drivers/staging/media/omap4iss/iss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/omap4iss/iss.c +1 -1
@@ -657,7 +657,7 @@ int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait,if (!wait_event_timeout (*wait, !atomic_read (stopping),msecs_to_jiffies (1000 ))) {atomic_set (stopping,0 ); -smp_wmb (); +smp_wmb ();/* Prevent stores reordering across the barrier */ return -ETIMEDOUT ; }
Signature · 1 line
2.17.1
Re: [Outreachy kernel] [PATCH v2 3/3] Staging: media: omap4iss: Add comment to memory barrier
Quoted 13 lines · Evan Chime
Fix "WARNING: memory barrier without comment" from checkpath. Add comment to memory barrier
smp_wmb()on line 660Signed-off-by Evan Chime <[email protected]>--- drivers/staging/media/omap4iss/iss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/omap4iss/iss.c +0
-0
drivers/staging/media/omap4iss/iss.c int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait, · line 660
Quoted 5 lines
drivers/staging/media/omap4iss/iss.c +1
-1@@ -657,7 +657,7 @@ int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait,if (!wait_event_timeout (*wait, !atomic_read (stopping),msecs_to_jiffies (1000 ))) {atomic_set (stopping,0 ); -smp_wmb (); +smp_wmb ();/* Prevent stores reordering across the barrier */
Which stores?
julia
Quoted 11 lines
drivers/staging/media/omap4iss/iss.c +0
-1return -ETIMEDOUT ; } --2.17.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/62b034d416bc0b0f2fc2a10c225bcf1441b4eecc.1572797322.git.chime.evan.dri.devel%40gmail.com.
Quoted 6 lines · Evan Chime
Include outreachy mailing list in "cc" list. No change
Evan Chime (3):
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrier
Each patch should have a different subject. If you end up with patches with the same subject, you should make the subjects more specific or merge them.
In this case, though, I think that this is an issue that only someone with a deep knowledge of the code could really address. The question is not what a memory barrier does, but why one is needed at a particular place in the code.
julia
Quoted 12 lines
drivers/staging/media/omap4iss/iss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)--
2.17.1--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/cover.1572797322.git.chime.evan.dri.devel%40gmail.com.
Re: [Outreachy kernel] [PATCH v2 3/3] Staging: media: omap4iss: Add comment to memory barrier
In reply to Julia LawallQuoted 24 lines · Julia Lawall
Review
Quoted 9 lines · Evan Chime
Fix "WARNING: memory barrier without comment" from checkpath. Add comment to memory barrier
smp_wmb()on line 660Signed-off-by Evan Chime <[email protected]>--- drivers/staging/media/omap4iss/iss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/media/omap4iss/iss.cdrivers/staging/media/omap4iss/iss.c int omap4iss_module_sync_idle(struct media_entity
Quoted 4 lines
index
ce34c19874c7..85b0d9cbaa14100644drivers/staging/media/omap4iss/iss.c +0
-0@@ -657,7 +657,7 @@ int omap4iss_module_sync_idle(struct media_entity*me,
wait_queue_head_t*wait,drivers/staging/media/omap4iss/iss.c int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait,
Quoted 5 lines
drivers/staging/media/omap4iss/iss.c +1
-1if (!wait_event_timeout (*wait, !atomic_read (stopping),msecs_to_jiffies (1000 ))) {atomic_set (stopping,0 ); -smp_wmb (); +smp_wmb ();/* Prevent stores reordering across the barrier
Quoted 6 lines
*/
Which stores?
julia
Memory writes
Kind regards
Evan
Quoted 25 lines
Quoted 8 lines
drivers/staging/media/omap4iss/iss.c +0
-1return -ETIMEDOUT ; } --2.17.1
--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 1 line
To view this discussion on the web visit
Quoted 1 line
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1911031716020.2557%40hadrien
.
Quoted 15 lines · Julia Lawall
Quoted 6 lines · Evan Chime
Include outreachy mailing list in "cc" list. No change
Evan Chime (3):
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrierEach patch should have a different subject. If you end up with patches with the same subject, you should make the subjects more specific or merge them.
Quoted 6 lines
In this case, though, I think that this is an issue that only someone with a deep knowledge of the code could really address. The question is not what a memory barrier does, but why one is needed at a particular place in the code.
julia
Thanks for the feedback Julia
Kind Regards
Evan
Quoted 27 lines
Quoted 10 lines
drivers/staging/media/omap4iss/iss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)--
2.17.1--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 1 line
To view this discussion on the web visit
Quoted 1 line
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1911031716390.2557%40hadrien
.
Greg KH
maintainerRe: [PATCH v2 1/3] Staging: media: omap4iss: Add comment to memory barrier
In reply to Evan ChimeQuoted 13 lines · Evan Chime
Fix "WARNING: memory barrier without comment" from checkpath. Add comment to memory barrier
smp_wmb()on line 635Signed-off-by Evan Chime <[email protected]>--- drivers/staging/media/omap4iss/iss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/staging/media/omap4iss/iss.c +0
-0
drivers/staging/media/omap4iss/iss.c int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait, · line 635
Quoted 5 lines
drivers/staging/media/omap4iss/iss.c +1
-1@@ -632,7 +632,7 @@ int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait,* scenario. We'll call it here to avoid race conditions. */ atomic_set (stopping,1 ); -smp_wmb (); +smp_wmb ();/* Prevents stores from being reordered across the barrier */
We all know what smp_wmb() does, what you need to document is what exactly it is here for. What is it preventing from happening to what data that is being touched elsewhere where?
If you don't know the code, solving something like this might be very difficult, sorry.
greg k-h
Re: [PATCH v2 1/3] Staging: media: omap4iss: Add comment to memory barrier
Quoted 23 lines · Greg KH
Review
Quoted 9 lines · Evan Chime
Fix "WARNING: memory barrier without comment" from checkpath. Add comment to memory barrier
smp_wmb()on line 635Signed-off-by Evan Chime <[email protected]>--- drivers/staging/media/omap4iss/iss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)(quoted diff) +0
-0
b/drivers/staging/media/omap4iss/iss.cdrivers/staging/media/omap4iss/iss.c int omap4iss_module_sync_idle(struct media_entity
Quoted 4 lines
index
1a966cb2f3a6..5156ad8e4b96100644drivers/staging/media/omap4iss/iss.c +0
-0@@ -632,7 +632,7 @@ int omap4iss_module_sync_idle(struct media_entity*me,
wait_queue_head_t*wait,drivers/staging/media/omap4iss/iss.c int omap4iss_module_sync_idle(struct media_entity *me, wait_queue_head_t *wait,
Quoted 5 lines
drivers/staging/media/omap4iss/iss.c +1
-1* scenario. We'll call it here to avoid race conditions. */ atomic_set (stopping,1 ); -smp_wmb (); +smp_wmb ();/* Prevents stores from being reordered across the barrier */
Quoted 8 lines
We all know what
smp_wmb()does, what you need to document is what exactly it is here for. What is it preventing from happening to what data that is being touched elsewhere where?If you don't know the code, solving something like this might be very difficult, sorry.
greg k-h
Thanks for your feedback Greg. I will have a look at the code
Kind regards
Evan
Quoted 1 line
Quoted 23 lines · evan chime
Quoted 20 lines · Julia Lawall
Quoted 6 lines · Evan Chime
Include outreachy mailing list in "cc" list. No change
Evan Chime (3):
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrierEach patch should have a different subject. If you end up with patches with the same subject, you should make the subjects more specific or merge them.
In this case, though, I think that this is an issue that only someone with a deep knowledge of the code could really address. The question is not what a memory barrier does, but why one is needed at a particular place in the code.
Quoted 8 lines
Quoted 1 line
julia
Thanks for the feedback Julia
Kind Regards
Evan
Please I have studied the function. From what I understand, the function checks if ISS submodule needs to wait for next interrupt. If yes, makes the caller to sleep while waiting for such event.
The atomic_set(stopping, 1) indicates whether the submodule needs to wait, where stopping is the flag, and atomic_set(stopping, 0) indicates no need to wait
According to the comment before the first atomic_set() call and the smp_wmb() call that follows which says:
/* Atomic set() doesn’t include memory barrier on ARM platform for SMP scenario. We’ll call it here to avoid race conditions */, the smp_wmb() call is I think, to avoid reordering of the atomic_set() operation
So can I use one of the following, as the comment
A) prevent reordering of atomic_set()
B) sync module with it’s idle state(from the comment that introduced the function)
C) ensures *stopping is persistent
D) none of the above :)
Quoted 30 lines
Quoted 29 lines
Quoted 4 lines
Quoted 8 lines
drivers/staging/media/omap4iss/iss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)--
2.17.1--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 1 line
To view this discussion on the web visit
Quoted 1 line
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1911031716390.2557%40hadrien
.
Quoted 64 lines · evan chime
Quoted 26 lines · evan chime
Quoted 23 lines · Julia Lawall
Quoted 6 lines · Evan Chime
Include outreachy mailing list in "cc" list. No change
Evan Chime (3):
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrier
Staging: media: omap4iss: Add comment to memory barrierEach patch should have a different subject. If you end up with patches with the same subject, you should make the subjects more specific or merge
them.In this case, though, I think that this is an issue that only someone with
a deep knowledge of the code could really address. The question is not what a memory barrier does, but why one is needed at a particular place in
the code.Quoted 8 lines
Quoted 1 line
julia
Thanks for the feedback Julia
Kind Regards
EvanPlease I have studied the function. From what I understand, the function checks if ISS submodule needs to wait for next interrupt. If yes, makes the caller to sleep while waiting for such event.
The
atomic_set(stopping, 1)indicates whether the submodule needs to wait, where stopping is the flag, andatomic_set(stopping, 0)indicates no need to waitAccording to the comment before the first
atomic_set()call and thesmp_wmb()call that follows which says:/* Atomic
set()doesn’t include memory barrier on ARM platform for SMP scenario. We’ll call it here to avoid race conditions */, thesmp_wmb()call is I think, to avoid reordering of theatomic_set()operationSo can I use one of the following, as the comment
A) prevent reordering of
atomic_set()
Quoted 9 lines
B) sync module with it’s idle state(from the comment that introduced the function)
C) ensures *stopping is persistent
D) none of the above :)
Please forgive me for the first email, just noticed I didn’t say who it was coming from at the end.
I have studied the function. From what I understand, the function checks if ISS submodule needs to wait for next interrupt. If yes, makes the caller to sleep while waiting for such event.
The atomic_set(stopping, 1) indicates whether the submodule needs to wait, where stopping is the flag, and atomic_set(stopping, 0) indicates no need to wait
According to the comment before the first atomic_set() call and the smp_wmb() call that follows which says:
/* Atomic set() doesn’t include memory barrier on ARM platform for SMP scenario. We’ll call it here to avoid race conditions */, the smp_wmb() call is I think, to avoid reordering of the atomic_set() operation
So can I use one of the following, as the comment
A) prevent reordering of atomic_set()
B) sync module with it’s idle state(from the comment that introduced the function)
C) ensures *stopping is persistent
D) none of the above :)
Kind regards
Evan
Quoted 32 lines
Quoted 32 lines
Quoted 31 lines
Quoted 6 lines
Quoted 8 lines
drivers/staging/media/omap4iss/iss.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)--
2.17.1--
You received this message because you are subscribed to the GoogleGroups "outreachy-kernel" group.
Quoted 1 line
To unsubscribe from this group and stop receiving emails from it, send
an email to [email protected].
Quoted 1 line
To view this discussion on the web visit
Quoted 1 line
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit
https://groups.google.com/d/msgid/outreachy-kernel/alpine.DEB.2.21.1911031716390.2557%40hadrien
.
v2 cover Add comment to memory barrier
In reply to Evan ChimeComment