Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2088646ybl; Tue, 3 Dec 2019 18:23:15 -0800 (PST) X-Google-Smtp-Source: APXvYqzfyu2DpqEnLKyvAvQ9VIWjhcs7BW4geK0aSgWSmMMaM+LiTQrQXklUvuMkPZjL02DVU7+/ X-Received: by 2002:a05:6830:1141:: with SMTP id x1mr907625otq.120.1575426195264; Tue, 03 Dec 2019 18:23:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575426195; cv=none; d=google.com; s=arc-20160816; b=wdM7iYuKJsSPCOF3OC6IVrr3tqnlsuksCEvhnLgv6LqttKI+Tu5eJ++46IkMbO+9ut sighLqkNsn2RzcUeeYWOTRT7y7yJ7gr8bLZeVKQwRAYa5f7nA8gP3w4x/5tA5Xz5ZhQi rztlqaAHbV1+sKx51V3Ds+Y+JfQ6CPUr6GuGMiEYKEokGWcIUCZp/XqelVCLJHDgALN8 RWqrz4LvfgRmUstcwBgC8m02Sv/WqYLIZ4RdOVGIgDgCrholiGyE1OUTewgB0yJBDQS1 YhclUhLNk0KH7gu55IhNwmSB2dW51EQU5TnBAWvauUkQhWoydMP0TcRGtbkPzfzC23a/ 1jmQ== 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=gASy9TDuVsH5zwpxeW0BE8bxVb8mYW76DT6995xQhXA=; b=C9oJbY6pPlUcj4Pohx7B/L2q5fmwm3vDsBBsIizPN8ydRdnlpoMUqm82+RqpDIBNSp JuGhPLVkowT0eztgZ+N3TBqMq86oo3hCASfB11FLbXzFlG+U49En99D0u0K/qSJpEn02 pxs3PU+0hn41efQhTHMnFxKWp7z5oW8Rx4u4a19dalRdWnCX1MuZnEv5GHg7mZ69FEsd baNQ6CqwPDotZmSHMqCztQcLO1nLcf7dvpm/uMdcMC//i/CrpfPrSyhfN0a8SPvfO6b1 2wx6z+3derJcdQuxZWcDWozy/pOPX7/Ibey40SviD2gLDO1BdwKQbQ9GSCkedDkanGTL pcjA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=QOHYHgfv; 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 f65si2592482oib.0.2019.12.03.18.22.54; Tue, 03 Dec 2019 18:23:15 -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=QOHYHgfv; 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 S1726521AbfLDCWV (ORCPT + 99 others); Tue, 3 Dec 2019 21:22:21 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:29015 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726179AbfLDCWV (ORCPT ); Tue, 3 Dec 2019 21:22:21 -0500 X-UUID: 68ec0c3ab67948ca9baeb7e60e3fa6c4-20191204 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=gASy9TDuVsH5zwpxeW0BE8bxVb8mYW76DT6995xQhXA=; b=QOHYHgfvSFD8m0DDWMic4GaD7zRffTP057Ws/SsQ1lzOhPCh3ga0IqjcmI/q4SbsWBKQZETxYEECbKtQFrKxv++xGGl9RZ7/J8ZXJdIbkji55JlP82QR1jYNIWi1oqgTPlTwy1VxLGwLqfEtrtULsmD3/Cv4N6yU+hnZYI5ienI=; X-UUID: 68ec0c3ab67948ca9baeb7e60e3fa6c4-20191204 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 1382334364; Wed, 04 Dec 2019 10:22:16 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 4 Dec 2019 10:22:03 +0800 Received: from [172.21.77.4] (172.21.77.4) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 4 Dec 2019 10:21:56 +0800 Message-ID: <1575426135.31411.2.camel@mtksdaap41> Subject: Re: [PATCH] soc: mediatek: cmdq: avoid racing condition with mutex From: CK Hu To: Bibby Hsieh , Jassi Brar CC: Matthias Brugger , Rob Herring , , , , , , "Nicolas Boichat" , Dennis-YC Hsieh , Houlong Wei Date: Wed, 4 Dec 2019 10:22:15 +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 SGksIEphc3NpOg0KDQpBcmUgbWJveF9zZW5kX21lc3NhZ2UoKSBhbmQgbWJveF9jbGllbnRfdHhk b25lKCkgdGhyZWFkLXNhZmU/IElmIHRoZXNlDQp0d28gYXJlIHRocmVhZC1zY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