Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13861442ybl; Sun, 29 Dec 2019 22:46:30 -0800 (PST) X-Google-Smtp-Source: APXvYqx2stoSSyx2M2veI2OEPwUW8QMBVMF0mh8PVVu0x1dGXIhyASQZNj8wQSwEHLC/QJZ1Cneh X-Received: by 2002:a05:6830:10f:: with SMTP id i15mr73602549otp.199.1577688390261; Sun, 29 Dec 2019 22:46:30 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577688390; cv=none; d=google.com; s=arc-20160816; b=FDue7LehIKCL8tpeMZZH6jFwujLaJvfFoQY/uwZWiswbT/nrFlYX+QLfcc/2UIXOrd 49eQlNptHtb8WrvZVKTRZg83KPbqpTa8KXZ/dxZDZJ0tU9rym6TJy3CyCWZLJ+tMTuEk xJxFGRE20TIWYwE3/PynY9/8HT9wLXcfjGcanNn5g8hlnQVmMeOeEIavYVdbA3/NrBfs Wz2A+2oZLX3gvJlS4ckENk2f88wapFs2NbeSsrvjmBmtsH7Mz/Uw4G8MRLg39Zq9AsOp xhgccAwUYNc/hwjRuLNQBSPSrR7Mo07Z5vmQqBHmhw/xWp8WiF+7Z4jVW6EMMjjbSRQg mqow== 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 :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=2JEQv42DFUUU456BpXiLJVg53m301BGWjGWt9M3Fzlk=; b=MkagED1I4p9wGLiN8SBQFQ9BD5i9uyw6LMba3d984XA4aYZpVsqJCd1mpZvsMjfvkx 9wGzHNOhVH/wtew0t79LzRSKbqIQmXtFmtuLr7xm+myQS9ytDaQQI5pC0C4aoSsvwPc0 pJFzGHqS2by2mfwjdGrUQa4nvZuL45RQ/f6g6pniXVjGLaJ2owxvrjsTufP1UcgasEwQ YfXmZI+EzXx4OYVYe3jgxcbiLze4F2ziuwzpxd3vaudGh1jkH800BGbeDh0bAFBNk71/ uiJrLgCfqKgfci2YZVG3TAqlw7kfIUFQx/7PdO+q2idAePXj9WMZUCFBIffM5wxGBY8L Ub5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=CKwzmNAP; 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 d188si16499215oib.273.2019.12.29.22.46.05; Sun, 29 Dec 2019 22:46:30 -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=CKwzmNAP; 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 S1727161AbfL3Go0 (ORCPT + 99 others); Mon, 30 Dec 2019 01:44:26 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:52005 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727136AbfL3Go0 (ORCPT ); Mon, 30 Dec 2019 01:44:26 -0500 X-UUID: c1c4b10a17914d3e9de8771be33c59d6-20191230 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:MIME-Version:Content-Type:References:In-Reply-To:Date:CC:To:From:Subject:Message-ID; bh=2JEQv42DFUUU456BpXiLJVg53m301BGWjGWt9M3Fzlk=; b=CKwzmNAP1rTKSzbkV2j7fTUsbsmVECe4+IZdSxgi86YLM8WBxSkQrAYldL3zQCCIDZtckDOYMGMIgQy03Lk6IOWpG7W4rWB2tdS6Z4GyCNzhPl7wFCNp6/nRaTo37Vj0Qe7ZkJ8s3WPSG8f/g5GHKkFusVrYIO6cRKvYEqwSSII=; X-UUID: c1c4b10a17914d3e9de8771be33c59d6-20191230 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1251939889; Mon, 30 Dec 2019 14:44:21 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs05n2.mediatek.inc (172.21.101.140) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 30 Dec 2019 14:43:51 +0800 Received: from [172.21.77.4] (172.21.77.4) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 30 Dec 2019 14:44:36 +0800 Message-ID: <1577688253.17931.11.camel@mtksdaap41> Subject: Re: [PATCH] soc: mediatek: cmdq: avoid racing condition with mutex From: CK Hu To: Bibby Hsieh CC: Jassi Brar , Matthias Brugger , Rob Herring , , , , , , Nicolas Boichat , Dennis-YC Hsieh , Houlong Wei Date: Mon, 30 Dec 2019 14:44:13 +0800 In-Reply-To: <20191121072910.31665-1-bibby.hsieh@mediatek.com> References: <20191121072910.31665-1-bibby.hsieh@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.10.4-0ubuntu2 MIME-Version: 1.0 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 SGksIEJpYmJ5Og0KDQpPbiBUaHUsIDIwMTktMTEtMjEgYXQgMTU6MjkgKzA4MDAsIEJpYmJ5IEhz aWVoIHdyb3RlOg0KPiBJZiBjbWRxIGNsaWVudCBpcyBtdWx0aSB0aHJlYW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