Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp249665ybi; Wed, 29 May 2019 20:38:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwt5I3EnZgib7IM+T6vodFEcZJpXwGg2SiCNYVZd8q8xXmGbk/508SRi3ES97bY56wJEmnh X-Received: by 2002:a17:902:2d:: with SMTP id 42mr1734262pla.34.1559187486936; Wed, 29 May 2019 20:38:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559187486; cv=none; d=google.com; s=arc-20160816; b=ZFSStV6tBofP31bSsfVrTtn5x3sqQLXciENQcPbTEg9CMFkaiJGYmXOohPAbAZTbnT MUfcAOSDdy98j154ita3FDTqj9TCMPYfJ37ja670MMjwJVbE3AclYkWhuHdULoDHFbQR uU+EkxkvWg4Ltv/Z6mWPlvS13atobbCsXEP97z/7Nyhnx86ggOCAeJ6jymxBR4TVObSU J4Bg0vMkcKtFYAcXn9TmpQXBp60tCaAwLT4FlNknCeSQEtSgtEwIy7pVO0gdw1pG/6DZ T6aC9XkcWfjSj17vV4ZN9UD9lnL1ivWZwKh2to286HtfWFwnvqkqDpEkpxoi55FFjQgM tNbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=OA6DaZ9b44qmM9CAmlWJ1uOBCHZQQwxMLWwSi07ixvQ=; b=yOsH08/tbEdrbU1Jgo3ZMyxKQCFA/Kc5Ea+57AToc2DpMEP0AhxPOIp/QncFzbXL94 jiJBLPhCm4eaHAWBf3TbPvkdZbYXTUKPQK+mzXtnNybBFuy4Ujx9GOpMd/eXSgtmetlL J6Gm7LbPF3dFRGnUSM/qoKsXDGpi3osasvBOr2WPqfefsd7FzVjStgUnrQnBESOOlcIi 6D3dfAH/JKd/C1fUw0jYheo4ivUfXg9n7XdvkyyW6nYB7o/o/Vyw9mVWVDPJPnDI2hoR +7slUDK3gTI4a8M3JwdG0DXMnx+opDryFBrFOfbNRnBvdAQYwDKI65Ay+PhDaMyo0pcB hSWw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Ic3IR/fv"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n12si1873472plp.114.2019.05.29.20.37.51; Wed, 29 May 2019 20:38:06 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="Ic3IR/fv"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387433AbfE3DYp (ORCPT + 99 others); Wed, 29 May 2019 23:24:45 -0400 Received: from mail.kernel.org ([198.145.29.99]:50450 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729911AbfE3DSQ (ORCPT ); Wed, 29 May 2019 23:18:16 -0400 Received: from localhost (ip67-88-213-2.z213-88-67.customer.algx.net [67.88.213.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53A2F2478F; Thu, 30 May 2019 03:18:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1559186295; bh=Wa7TcyT+ufSchs5dR12KCtbsY23wB+eK/kdXfxO7PYM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ic3IR/fvvcHLoDvU3OztIDqTr3HS4ctJ2efk3XokqMKDzfRo9jl6wsogu6m8WS2rT 8+ZbBh2ud2CVmImL8SEhQLUM54GO1/707KZ9imTaHN7Pg4Fu8+GKuBFouSZpVzvGaN glGAELZI7YTnpKMQDVvPBTe6dBHEVD92AcnT8/uc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Hans Verkuil , Helen Koike , Hans Verkuil , Mauro Carvalho Chehab , Sasha Levin Subject: [PATCH 4.19 256/276] media: vimc: stream: fix thread state before sleep Date: Wed, 29 May 2019 20:06:54 -0700 Message-Id: <20190530030541.173404684@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190530030523.133519668@linuxfoundation.org> References: <20190530030523.133519668@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 2978a505aaa981b279ef359f74ba93d25098e0a0 ] The state TASK_UNINTERRUPTIBLE should be set just before schedule_timeout() call, so it knows the sleep mode it should enter. There is no point in setting TASK_UNINTERRUPTIBLE at the initialization of the thread as schedule_timeout() will set the state back to TASK_RUNNING. This fixes a warning in __might_sleep() call, as it's expecting the task to be in TASK_RUNNING state just before changing the state to a sleeping state. Reported-by: Hans Verkuil Signed-off-by: Helen Koike Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab Signed-off-by: Sasha Levin --- drivers/media/platform/vimc/vimc-streamer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/platform/vimc/vimc-streamer.c b/drivers/media/platform/vimc/vimc-streamer.c index fcc897fb247bc..392754c18046c 100644 --- a/drivers/media/platform/vimc/vimc-streamer.c +++ b/drivers/media/platform/vimc/vimc-streamer.c @@ -120,7 +120,6 @@ static int vimc_streamer_thread(void *data) int i; set_freezable(); - set_current_state(TASK_UNINTERRUPTIBLE); for (;;) { try_to_freeze(); @@ -137,6 +136,7 @@ static int vimc_streamer_thread(void *data) break; } //wait for 60hz + set_current_state(TASK_UNINTERRUPTIBLE); schedule_timeout(HZ / 60); } -- 2.20.1