All of lore.kernel.org
 help / color / mirror / Atom feed
From: Neil Horman <nhorman@redhat.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Benjamin Romer <benjamin.romer@unisys.com>,
	Jes.Sorensen@redhat.com, driverdev-devel@linuxdriverproject.org,
	sparmaintainer@unisys.com
Subject: Re: [PATCH 1/7] staging: unisys: visornic: fix serialization mechanism around usage atomic
Date: Fri, 24 Jul 2015 19:11:02 -0400	[thread overview]
Message-ID: <20150724231101.GA30741@hmsreliant.think-freely.org> (raw)
In-Reply-To: <20150724203551.GA15778@kroah.com>

On Fri, Jul 24, 2015 at 01:35:51PM -0700, Greg KH wrote:
> On Fri, Jul 24, 2015 at 12:00:19PM -0400, Benjamin Romer wrote:
> > From: Neil Horman <nhorman@redhat.com>
> > 
> > Missed this in my initial review.  The usage counter that guards against
> > kthread task is horribly racy.  The atomic is self consistent, but theres
> > nothing that prevents the service_resp_queue function from re-incrementing
> > it immediately after the check in disable_with_timeout is complete.  Its
> > just a improper usage of atomics as a serialization mechanism.
> > 
> > Instead use kthread_park to pause the thread in its activity so that
> > buffers can be properly freed without racing against usage in
> > service_resp_queue
> > 
> > Signed-off-by: Neil Horman <nhorman@redhat.com>
> > Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
> > ---
> >  drivers/staging/unisys/visornic/visornic_main.c | 23 ++++++-----------------
> >  kernel/kthread.c                                |  4 ++++
> 
> Sorry, staging drivers can not modify other parts of the kernel.  Adding
> exports for these kthread functions needs to happen as a "real" patch
> that the kthread maintainer accepts, I can't take this.
> 
> greg k-h

Thats fine, we can split out the kthread_park exports and propose them on lkml
separately. 

Thanks
Neil

  reply	other threads:[~2015-07-24 23:11 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 16:00 [PATCH 0/7] staging: unisys: visornic testing fix series Benjamin Romer
2015-07-24 16:00 ` [PATCH 1/7] staging: unisys: visornic: fix serialization mechanism around usage atomic Benjamin Romer
2015-07-24 20:35   ` Greg KH
2015-07-24 23:11     ` Neil Horman [this message]
2015-07-24 16:00 ` [PATCH 2/7] staging: unisys: add simple error-check into visornic receive path Benjamin Romer
2015-07-24 20:36   ` Greg KH
2015-07-24 16:00 ` [PATCH 3/7] staging: unisys: Process more than one response per check Benjamin Romer
2015-07-24 16:00 ` [PATCH 4/7] staging: unisys: visornic - ensure proper net locking in tx reset logic Benjamin Romer
2015-07-24 16:00 ` [PATCH 5/7] staging: unisys: visornic - check visorchannel_signalinsert/remove failures Benjamin Romer
2015-07-24 16:00 ` [PATCH 6/7] staging: unisys: visornic - consolidate+simplify xmit watermark checks Benjamin Romer
2015-07-24 20:43   ` Greg KH
2015-07-27  8:17   ` Dan Carpenter
2015-07-24 16:00 ` [PATCH 7/7] staging: unisys: visornic - prevent NETDEV WATCHDOG timeouts after IO recovery Benjamin Romer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150724231101.GA30741@hmsreliant.think-freely.org \
    --to=nhorman@redhat.com \
    --cc=Jes.Sorensen@redhat.com \
    --cc=benjamin.romer@unisys.com \
    --cc=driverdev-devel@linuxdriverproject.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=sparmaintainer@unisys.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.