Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3714017pxk; Mon, 7 Sep 2020 23:46:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw+EGH2mFISpmyyPaX+NWivbVkEi5c4UG0Fzmknc9cz3iOrcwukulge/Uq6E0Pp1XZG6CO5 X-Received: by 2002:a50:b046:: with SMTP id i64mr26499860edd.9.1599547598661; Mon, 07 Sep 2020 23:46:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599547598; cv=none; d=google.com; s=arc-20160816; b=VjSCr7sXuyXDOQiCcrroxmmjx9y4j4PSFknyqikOx1M6WlM9D7mX4Fc7Yqr5ALGBuW ErWWcGzuEYDbj3uFop4tNiabKdsBPH7xe7po4TyNXk8sNiQAjKfvfn/Anen7cf7WzuYk eISjS0j+8Bjgn2/BHPjkhKboWxOZTFut7QJC7fsaPuI+mgiwd4nZVV3l/SGg7p7kAqaq k4FG1BGlexl7H/zXEEpn85BSyZ7sPRPLkcpbUmS4ERbP52gds9Xd7WRltDKAadh8VhOB s7FatLhVkkDuf5Qz5V/53Yd9eabeWi2efLPmj9cUd1v39Uck2e2TCHrYEZZ3Sj1i9AQq Sh8w== 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:message-id:date:subject:cc:to:from :dkim-signature; bh=vkAchY3C2WddVlo+HHoOzkA8z5hp05WmN9gYTWWqPaI=; b=NcZqSzpK2o+SbK21KFMzrzINleOn7tqaWi/7hnu8pIL74g1IQvFZA6D+CUll4OEdyT 6oBrUJMXP/RsoslWMkj/KnyitKSDx4F7DfpSv9xdO5t35DIvnn4JpGxp8xVAP8G0xGLn fHA/WBpfmKBdmFhQPRgeu7PYfTBYQaVQVxfg+Xr3z4zKtOdgLbdeTtYlMH+dsUDTMMxh FNDQin0HT6IKGiuvuHxX6JFByRyqFBuCxY0BATks9zpaS7gKq0QY1+6WQvwrs4ozE6gj Ed7bDrV7JB/vmedGwQtpeXFeKqlydrZcM34TgpQz0YJrtHYs+ZoIR9Bc1ue/dGje5Tw+ JJAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=tzjS+Klg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id yd22si8021390ejb.346.2020.09.07.23.46.16; Mon, 07 Sep 2020 23:46:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=tzjS+Klg; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1729003AbgIHGp2 (ORCPT + 99 others); Tue, 8 Sep 2020 02:45:28 -0400 Received: from mailgw02.mediatek.com ([210.61.82.184]:2238 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1728625AbgIHGpT (ORCPT ); Tue, 8 Sep 2020 02:45:19 -0400 X-UUID: f643ba82369d428ea25f684f86921498-20200908 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:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=vkAchY3C2WddVlo+HHoOzkA8z5hp05WmN9gYTWWqPaI=; b=tzjS+KlgCtKvL3faXFbkAS2GHYlMteLeI9tGWYxOF3Ht2By59bTEqreKQSp3vjPbLgHMZgVZU3zz16rdZOgkEPfyIZyRdGhdYa/kRFeQ0u3LVmDatHnAeU3KTq8ZnEwjHNhj0dq0IRztp5yScCllvXza3ugdVroXM9Ne9fXEOA8=; X-UUID: f643ba82369d428ea25f684f86921498-20200908 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 301193689; Tue, 08 Sep 2020 14:45:12 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs05n1.mediatek.inc (172.21.101.15) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 8 Sep 2020 14:45:10 +0800 Received: from mtksdccf07.mediatek.inc (172.21.84.99) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 8 Sep 2020 14:45:10 +0800 From: Stanley Chu To: , , , , CC: , , , , , , , , , , , Stanley Chu Subject: [PATCH 4/4] scsi: ufs-mediatek: Add host reset mechanism Date: Tue, 8 Sep 2020 14:45:07 +0800 Message-ID: <20200908064507.30774-5-stanley.chu@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200908064507.30774-1-stanley.chu@mediatek.com> References: <20200908064507.30774-1-stanley.chu@mediatek.com> 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 QWRkIGhvc3QgcmVzZXQgbWVjaGFuaXNtIHRvIHRyeSB0byByZWNvdmVyIGhvc3Qtc2lkZSBlcnJv cnMNCmR1cmluZyByZWNvdmVyeSBmbG93Lg0KDQpTaWduZWQtb2ZmLWJ5OiBTdGFubGV5IENodSA8 c3RhbmxleS5jaHVAbWVkaWF0ZWsuY29tPg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