From patchwork Wed Feb 26 11:01:45 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 3723391 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DEED09F2F7 for ; Wed, 26 Feb 2014 11:05:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0F498201D3 for ; Wed, 26 Feb 2014 11:05:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 397B82017B for ; Wed, 26 Feb 2014 11:05:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752082AbaBZLCu (ORCPT ); Wed, 26 Feb 2014 06:02:50 -0500 Received: from moutng.kundenserver.de ([212.227.126.130]:49946 "EHLO moutng.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752057AbaBZLCs (ORCPT ); Wed, 26 Feb 2014 06:02:48 -0500 Received: from wuerfel.lan (HSI-KBW-5-56-226-176.hsi17.kabel-badenwuerttemberg.de [5.56.226.176]) by mrelayeu.kundenserver.de (node=mreue003) with ESMTP (Nemesis) id 0Ly8x7-1XL5K63lkj-015dur; Wed, 26 Feb 2014 12:02:40 +0100 From: Arnd Bergmann To: linux-kernel@vger.kernel.org Cc: Arnd Bergmann , Mauro Carvalho Chehab , linux-media@vger.kernel.org Subject: [PATCH 05/16] [media] omap_vout: avoid sleep_on race Date: Wed, 26 Feb 2014 12:01:45 +0100 Message-Id: <1393412516-3762435-6-git-send-email-arnd@arndb.de> X-Mailer: git-send-email 1.8.3.2 In-Reply-To: <1393412516-3762435-1-git-send-email-arnd@arndb.de> References: <1393412516-3762435-1-git-send-email-arnd@arndb.de> X-Provags-ID: V02:K0:4oSMKQGpcEFweb3lSl1smCtu0Fo33fe3vUqf2A8rosk 0srvVuYrN/YnQY+sEakf7JWlEvSbfmaQhWClymO8grDJLdGmBq Mfmq6Yiff6MVgeG9wNRY0KvWxRA7VvinfEY4hlzlErJ2XWaGQt NsR8UqNzpRODmm37yIKaJwOzGvOMY3L5fE51jq7qSzHgYpfve4 1wJtwRKyfy4+kGsvzX8zJS/UIJCwf9zrZ9oPEpVOVHNaXOBGrx HX7MfrJ/QeSR4ig0wb2+pkTtUhZIFiMxgmrQcggT44n4CDvRqj cqp8zRrRvOPYErwsvhhEr1SPz0+MCLrqzrg/LvwhfeAcHaiTEH MZ4BTIoZqDY1ttRyvutszO2UOv4YOJ/4YVchDn2fg Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP sleep_on and its variants are broken and going away soon. This changes the omap vout driver to use interruptible_sleep_on_timeout instead, which fixes potential race where the dma is complete before we schedule. Signed-off-by: Arnd Bergmann Reviewed-by: Hans Verkuil Cc: Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org --- drivers/media/platform/omap/omap_vout_vrfb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/omap/omap_vout_vrfb.c b/drivers/media/platform/omap/omap_vout_vrfb.c index cf1c437..62e7e57 100644 --- a/drivers/media/platform/omap/omap_vout_vrfb.c +++ b/drivers/media/platform/omap/omap_vout_vrfb.c @@ -270,7 +270,8 @@ int omap_vout_prepare_vrfb(struct omap_vout_device *vout, omap_dma_set_global_params(DMA_DEFAULT_ARB_RATE, 0x20, 0); omap_start_dma(tx->dma_ch); - interruptible_sleep_on_timeout(&tx->wait, VRFB_TX_TIMEOUT); + wait_event_interruptible_timeout(tx->wait, tx->tx_status == 1, + VRFB_TX_TIMEOUT); if (tx->tx_status == 0) { omap_stop_dma(tx->dma_ch);