Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp13683160ybl; Sun, 29 Dec 2019 18:03:37 -0800 (PST) X-Google-Smtp-Source: APXvYqw6I3eSmXo+/1cgACQMDyYeZklbjtwzlLBYOG02cCm9aSxTIV9q2UeDuhpMLJ3/iysyLYpV X-Received: by 2002:a05:6830:1615:: with SMTP id g21mr74596550otr.49.1577671417655; Sun, 29 Dec 2019 18:03:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1577671417; cv=none; d=google.com; s=arc-20160816; b=rwSx7c9s1BrUVVz5Xl/f46X2HMFANgsKn03oHXOspRk0FPn5sgVXoGqQ2+teAQpLPB IPUK87jK3Fc73bkyU+RmrOM8p1b1Ymdble9O/c/ou+Q/OkU1a1s7Che5LkMmV61C0m80 SBDpI3b8b73p5Z3B7yc3XogrJ77vReoLe0LKw0aKl9/C+LGtc5VcTaAXloYUFmYTDVsV L8cDBd8JfsI5qYl6RugfBgxRgS0VNvxHTW8z0KIWEKe09qTekDHMLiqliuazv1u0RWM9 9v1pKAAAISDRkOEtI4arb2xIjdt8CrhKGt1ZyKuTqMivpByqcX5lUDwvV/sUI5yFIsDu YMSA== 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=zs3wqU0/rTaxSd+jOFQHg8yAjxKsG5qsZDhljNgTpew=; b=sr8SNXJZgOwJcNUvZV5ZmMou69oFb21HQouCcCynVS5LDPCQqDViCtHJZPUNyEuPel zeT/9eg5IFVzKo0Yv/dKcj2JQrt/YZ8v8MgtVlLYJvsUBG+JM4Ku/vavszI/Y2yMvUgk VMt3KC9yM4zeQYg24jKIwvui2DoDrvxAf2fX6H8FVKKJn+cVjDZznipp3XSk+/XnqvLN vhTHsyr32UcXhYmzsxIm/Yz9DEt+q4z+CNu2YBmdsqkAwX069oTTmh91T5ma8BbN0b+L EmEvg4UW86TYjqDHvBXiP5haQYi6hlwC7E8UGcPBQt9IYREPPRvgYR/WqxZNLClxcVgX DTew== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=Q2umEATI; 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 u84si14628954oib.34.2019.12.29.18.03.26; Sun, 29 Dec 2019 18:03:37 -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=Q2umEATI; 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 S1726729AbfL3CCp (ORCPT + 99 others); Sun, 29 Dec 2019 21:02:45 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:58322 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726343AbfL3CCp (ORCPT ); Sun, 29 Dec 2019 21:02:45 -0500 X-UUID: 631568d282b346eea7c344ff6a4ca3f7-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=zs3wqU0/rTaxSd+jOFQHg8yAjxKsG5qsZDhljNgTpew=; b=Q2umEATIEYiHqozWXZcwK0YOuRDfKw2mUSzZs4rA/HI7fGWtJhA/xeiNU7BDRolk8Cp8JwVIVE5Tmpo1MZ3P3OLVSxAO8qT7ossqzs8D0W0iLTreYRsorvTl8iCNEu7GHRzr4JUD5FLMx47En8ecJ7TssN9/wjdG89XbgB2ws9g=; X-UUID: 631568d282b346eea7c344ff6a4ca3f7-20191230 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1006649543; Mon, 30 Dec 2019 10:02:42 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 30 Dec 2019 10:02:18 +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 10:03:03 +0800 Message-ID: <1577671361.8160.2.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 10:02:41 +0800 In-Reply-To: <1575426135.31411.2.camel@mtksdaap41> References: <20191121072910.31665-1-bibby.hsieh@mediatek.com> <1575426135.31411.2.camel@mtksdaap41> 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 SGksIEphc3NpOg0KDQpQaW5nIGFnYWluLg0KDQpBcmUgbWJveF9zZW5kX21lc3NhZ2UoKSBhbmQg bWJveF9jbGllbnRfdHhkb25lKCkgdGhyZWFkLXNhZmU/IElmIHRoZXNlDQp0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