* [PATCH 2/5] video: Add missing annotation for cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() [not found] ` <20200403160505.2832-1-jbi.octave@gmail.com> @ 2020-04-03 16:05 ` Jules Irenge 2020-04-07 19:48 ` Sam Ravnborg 0 siblings, 1 reply; 2+ messages in thread From: Jules Irenge @ 2020-04-03 16:05 UTC (permalink / raw) To: linux-kernel Cc: open list:FRAMEBUFFER LAYER, Bartlomiej Zolnierkiewicz, boqun.feng, Russell King, open list:FRAMEBUFFER LAYER, moderated list:CYBERPRO FB DRIVER Sparse reports warnings at cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() warning: context imbalance in cyber2000fb_enable_ddc() - wrong count at exit warning: context imbalance in cyber2000fb_disable_ddc() - unexpected unlock The root cause is the missing annotation at cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() Add the missing __acquires(&cfb->reg_b0_lock) annotation Add the missing __releases(&cfb->reg_b0_lock) annotation Signed-off-by: Jules Irenge <jbi.octave@gmail.com> --- drivers/video/fbdev/cyber2000fb.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c index 460826a7ad55..513f58f28b0f 100644 --- a/drivers/video/fbdev/cyber2000fb.c +++ b/drivers/video/fbdev/cyber2000fb.c @@ -1160,12 +1160,14 @@ EXPORT_SYMBOL(cyber2000fb_detach); #define DDC_SDA_IN (1 << 6) static void cyber2000fb_enable_ddc(struct cfb_info *cfb) + __acquires(&cfb->reg_b0_lock) { spin_lock(&cfb->reg_b0_lock); cyber2000fb_writew(0x1bf, 0x3ce, cfb); } static void cyber2000fb_disable_ddc(struct cfb_info *cfb) + __releases(&cfb->reg_b0_lock) { cyber2000fb_writew(0x0bf, 0x3ce, cfb); spin_unlock(&cfb->reg_b0_lock); -- 2.24.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/5] video: Add missing annotation for cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() 2020-04-03 16:05 ` [PATCH 2/5] video: Add missing annotation for cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() Jules Irenge @ 2020-04-07 19:48 ` Sam Ravnborg 0 siblings, 0 replies; 2+ messages in thread From: Sam Ravnborg @ 2020-04-07 19:48 UTC (permalink / raw) To: Jules Irenge Cc: open list:FRAMEBUFFER LAYER, Bartlomiej Zolnierkiewicz, boqun.feng, Russell King, open list:FRAMEBUFFER LAYER, linux-kernel, moderated list:CYBERPRO FB DRIVER Hi Jules. On Fri, Apr 03, 2020 at 05:05:02PM +0100, Jules Irenge wrote: > Sparse reports warnings at cyber2000fb_enable_ddc() > and cyber2000fb_disable_ddc() > > warning: context imbalance in cyber2000fb_enable_ddc() > - wrong count at exit > > warning: context imbalance in cyber2000fb_disable_ddc() > - unexpected unlock > > The root cause is the missing annotation at cyber2000fb_enable_ddc() > and cyber2000fb_disable_ddc() > > Add the missing __acquires(&cfb->reg_b0_lock) annotation > Add the missing __releases(&cfb->reg_b0_lock) annotation > > Signed-off-by: Jules Irenge <jbi.octave@gmail.com> Thanks, added to drm-misc-next, so the patch will hit the kernel when the merge windows opens the next time. Was this the only locking relevant warning in fbdev? I would expect a few more. Sam > --- > drivers/video/fbdev/cyber2000fb.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/video/fbdev/cyber2000fb.c b/drivers/video/fbdev/cyber2000fb.c > index 460826a7ad55..513f58f28b0f 100644 > --- a/drivers/video/fbdev/cyber2000fb.c > +++ b/drivers/video/fbdev/cyber2000fb.c > @@ -1160,12 +1160,14 @@ EXPORT_SYMBOL(cyber2000fb_detach); > #define DDC_SDA_IN (1 << 6) > > static void cyber2000fb_enable_ddc(struct cfb_info *cfb) > + __acquires(&cfb->reg_b0_lock) > { > spin_lock(&cfb->reg_b0_lock); > cyber2000fb_writew(0x1bf, 0x3ce, cfb); > } > > static void cyber2000fb_disable_ddc(struct cfb_info *cfb) > + __releases(&cfb->reg_b0_lock) > { > cyber2000fb_writew(0x0bf, 0x3ce, cfb); > spin_unlock(&cfb->reg_b0_lock); > -- > 2.24.1 > > _______________________________________________ > dri-devel mailing list > dri-devel@lists.freedesktop.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel ^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-04-07 19:48 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <0/5>
[not found] ` <20200403160505.2832-1-jbi.octave@gmail.com>
2020-04-03 16:05 ` [PATCH 2/5] video: Add missing annotation for cyber2000fb_enable_ddc() and cyber2000fb_disable_ddc() Jules Irenge
2020-04-07 19:48 ` Sam Ravnborg
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).