Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp2897740ybc; Wed, 20 Nov 2019 23:33:08 -0800 (PST) X-Google-Smtp-Source: APXvYqzYYYaEiw/4AIFJ8HtkoHpIF3FM6sWq+vMjfKrYc6jdN4FavVcFd9NCJ94J5biBvQyuh2mr X-Received: by 2002:a17:906:158f:: with SMTP id k15mr11493521ejd.226.1574321588044; Wed, 20 Nov 2019 23:33:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574321588; cv=none; d=google.com; s=arc-20160816; b=g0oMxpbh7enq6nitnFQQasP/4LxS9ZuLXMmMZU8whZ/v+nqXHjo2Ek5ab4WI6lN05d Pv9D+Y+WGUx6EdqzfsVowYW5Zu9mZ7Dl1mQLmh2wru6+gSzNnrW/Lizh0JEZcZmcv7ih f5GEXPgezH96aIoW8V3Ywrju0uENctktwwmyHLQ0YOOHBC2SVEj1EigPQDLO+euyG8Ix NUXd++ppCIT3FVGrQJWn5LbFHW/HOfDswEdvC2oV0eCiueszhCywQrBPtahB3wuSOLej 9C+qPcEG3zjQ2KiVWYYhF6W+EUY/OKRAHWJodkz1M/XgLQt7pAq7P9oajDyNZ5UZkyLi EdpA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=DdOBazdkEY8z3b9oLQBOBsUR+PwkBxvsgtd16bL2wP8=; b=AUYKpGwHS3UFVtxaTOHdemJ6EMTn7Wlz8E82XneeQuEYJRiqz8Vygg9Ji0yAeQwWJ+ sL7Zlf93XMCo0FQVsg98dLxcwSigJj7VeZEU/MOg6QNM1QX0u+Y6sQcoaW3XOhmV0C1j pObIZiUYWrRvxe0P9qW/0unZajkgI8NuCpRWtt3SKaYNjfF9rzUjOVEIGKFz0wheRGYp w4mLmsRCHrmxcpekNHuAhmr5XBOAPUg2beHRTje4j3slgeEO93kmIznivyKW7MIWaSqZ KBS++5Y5LEV4qbV6sCfEvWOj4/X/sZvHmpD29zX1KOl8ddUAaJVsg46jOINCZmxfsbu3 a75g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b="dF7WIzR/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v3si1318265edq.359.2019.11.20.23.32.43; Wed, 20 Nov 2019 23:33:08 -0800 (PST) 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=@mediatek.com header.s=dk header.b="dF7WIzR/"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726967AbfKUH3T (ORCPT + 99 others); Thu, 21 Nov 2019 02:29:19 -0500 Received: from mailgw01.mediatek.com ([210.61.82.183]:8629 "EHLO mailgw01.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1725842AbfKUH3S (ORCPT ); Thu, 21 Nov 2019 02:29:18 -0500 X-UUID: 50003c530eab45729dc643b5b631aaf2-20191121 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=DdOBazdkEY8z3b9oLQBOBsUR+PwkBxvsgtd16bL2wP8=; b=dF7WIzR/p2XrAtxWVR+Uau04hx1SguyHDCvtAL0bumQpo8ZGhIzB07H26eHEYfdMkn2/o/0CgR9ItlVNh8Tz6g35yZIUMZs4km/tPhXQSPOFehPH3nUmb72k9cxTI3ZY5Io2WtdLG+tBJ8+lHghSvJ+oEnk/4FWL1CZdQVzL55o=; X-UUID: 50003c530eab45729dc643b5b631aaf2-20191121 Received: from mtkcas09.mediatek.inc [(172.21.101.178)] by mailgw01.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 2015701134; Thu, 21 Nov 2019 15:29:12 +0800 Received: from mtkcas08.mediatek.inc (172.21.101.126) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 21 Nov 2019 15:29:05 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by mtkcas08.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 21 Nov 2019 15:29:07 +0800 From: Bibby Hsieh To: Jassi Brar , Matthias Brugger , Rob Herring , CK HU CC: , , , , , Nicolas Boichat , Dennis-YC Hsieh , Houlong Wei , Bibby Hsieh Subject: [PATCH] soc: mediatek: cmdq: avoid racing condition with mutex Date: Thu, 21 Nov 2019 15:29:10 +0800 Message-ID: <20191121072910.31665-1-bibby.hsieh@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Content-Transfer-Encoding: base64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SWYgY21kcSBjbGllbnQgaXMgbXVsdGkgdGhyZWFkIHVzZXIsIHJhY2luZyB3aWxsIG9jY3VyIHdp dGhvdXQgbXV0ZXgNCnByb3RlY3Rpb24uIEl0IHdpbGwgbWFrZSB0aGUgQyBtZXNzYWdlIHF1ZXVl ZCBpbiBtYWlsYm94J3MgcXVldWUNCmFsd2F5cyBuZWVkIEQgbWVzc2FnZSdzIHRyaWd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