From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 364BC1C2B98 for ; Fri, 24 Jul 2015 20:35:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 303F48A906 for ; Fri, 24 Jul 2015 20:35:53 +0000 (UTC) Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id R35fxDcyCOg7 for ; Fri, 24 Jul 2015 20:35:52 +0000 (UTC) Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) by hemlock.osuosl.org (Postfix) with ESMTPS id 3A9158A7BD for ; Fri, 24 Jul 2015 20:35:52 +0000 (UTC) Date: Fri, 24 Jul 2015 13:35:51 -0700 From: Greg KH Subject: Re: [PATCH 1/7] staging: unisys: visornic: fix serialization mechanism around usage atomic Message-ID: <20150724203551.GA15778@kroah.com> References: <1437753625-28701-1-git-send-email-benjamin.romer@unisys.com> <1437753625-28701-2-git-send-email-benjamin.romer@unisys.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1437753625-28701-2-git-send-email-benjamin.romer@unisys.com> List-Id: Linux Driver Project Developer List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: driverdev-devel-bounces@linuxdriverproject.org Sender: "devel" To: Benjamin Romer Cc: Jes.Sorensen@redhat.com, sparmaintainer@unisys.com, driverdev-devel@linuxdriverproject.org, Neil Horman On Fri, Jul 24, 2015 at 12:00:19PM -0400, Benjamin Romer wrote: > From: Neil Horman > > 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 > Signed-off-by: Benjamin Romer > --- > 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 _______________________________________________ devel mailing list devel@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel