Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3843710pxb; Tue, 10 Nov 2020 01:11:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJyMT5RtDZEcd1VAzKjXRJS3fpx7M8fQwQ7Hh3KjLt0coZl1eIPhUOmvggMYcePIiDle6In/ X-Received: by 2002:a50:ff02:: with SMTP id a2mr19311069edu.364.1604999474287; Tue, 10 Nov 2020 01:11:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604999474; cv=none; d=google.com; s=arc-20160816; b=b59cX+TAU+3xphtmoXnyfK3us+yKwon93lsiNmYoVuJBtpTfrB0s5sTjBlA9SjHeYG eH9wLlRAQ8C+Zl98uWF8TbRQ3vnFrfmTJqqbWVetf4C+A2x2yfpUjgxRV13GrvQGD+NY 6rSM463cIcrCYb6OYXgHYrOBS1g5DwUshy3+USefzQIPz8tYz7bV3fWJI3SomzTHLeMC JH5ESLcvxCzf1MXYe3xX+hd/nyMwwmWnXeJLgV2a/o//jPx04eGPv8bPST1D+A9kS9t7 NvVZCzI1A5s32VS0p79Zm00THXwAyXuNn+cogDxY3FRjnuOz3pgdllmD6oZ08clnLnyS k7zg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=/y4zlDG72nanpKLG5zhqO8iSJJlOUu7cGEEvi9Tm6W4=; b=MvlWCSgm86CiYoCf8lEZZxa27A8yWcoMfmNHQzraEVqezZf9z8fQbZ4rsyXGZllIT+ W1gwT7PtLN4iqYhRHp3KG9wTo7cS9EiZis18/Tl3dorMFkRCxgJgjoKIxZcwdQu7ndWX Uy7Z4EJy81/Y3Pqd6j0J+00VGXuv83LFfFpybiGqmxTD9DuMjj597dKb5QB9sL4tCFbG 07PMa38PVMyLxN767agyVCjKlCdCcNvm41INTgs+CUZAOFSESPRdm3TQtDWaIfOjxF2I CxO0r/5NIUz+KUEXZh4k73lsQ3WeDq5Io90QI8R2/f6P0yUCAbz3eEYIyxjmVmvCeqb/ mwEg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h5si9273954edn.68.2020.11.10.01.10.51; Tue, 10 Nov 2020 01:11:14 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731787AbgKJJJF (ORCPT + 99 others); Tue, 10 Nov 2020 04:09:05 -0500 Received: from szxga01-in.huawei.com ([45.249.212.187]:3659 "EHLO szxga01-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726467AbgKJJJD (ORCPT ); Tue, 10 Nov 2020 04:09:03 -0500 Received: from dggeme756-chm.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4CVhqq2HC0zXlLy; Tue, 10 Nov 2020 17:08:55 +0800 (CST) Received: from [10.174.177.103] (10.174.177.103) by dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1913.5; Tue, 10 Nov 2020 17:09:01 +0800 Subject: Re: [PATCH -next] irq-chip/gic-v3-its: Fixed an issue where the ITS executes the residual commands in the queue again when the ITS wakes up from sleep mode. To: Marc Zyngier CC: , , References: <20201107104226.14282-1-xuqiang36@huawei.com> <32592d73-9800-f420-eb00-474d9ded6155@huawei.com> <338d65dfeac0cc026c74d9e78ec6f0c1@kernel.org> From: "xuqiang (M)" Message-ID: <96243568-01ad-31c2-e927-6b85738c9bc3@huawei.com> Date: Tue, 10 Nov 2020 17:09:00 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.2.2 MIME-Version: 1.0 In-Reply-To: <338d65dfeac0cc026c74d9e78ec6f0c1@kernel.org> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.177.103] X-ClientProxiedBy: dggeme712-chm.china.huawei.com (10.1.199.108) To dggeme756-chm.china.huawei.com (10.3.19.102) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/11/9 18:43, Marc Zyngier 写道: > On 2020-11-09 03:05, xuqiang (M) wrote: >> 在 2020/11/8 0:54, Marc Zyngier 写道: >>> [dropping Jason, whose email address has been bouncing for weeks now] >>> >>> On 2020-11-07 10:42, Xu Qiang wrote: >>>> On my platform, ITS_FLAGS_SAVE_SUSPEND_STATE is not set,thus do >>>> nothing >>> >>> Which platform? >> Hisi Ascend platform >>> >>>> in its suspend and resuse function.On the other hand,firmware stores >>>> GITS_CTRL,GITS_CBASER,GITS_CWRITER and GITS_BASER in the suspend, >>>> and restores these registers in the resume. As a result, the ITS >>>> executes >>>> the residual commands in the queue. >>> >>> Which firmware are you using? I just had a look at the trusted >>> firmware source >>> code, and while it definitely does something that *looks* like what >>> you are >>> describing, it doesn't re-enable the ITS on resume. >>> >>> So what are you running? >> >> I am using ATF. Since ITS_FLAGS_SAVE_SUSPEND_STATE is not set,ITS >> driver of OS will >> >> not re-enable ITS in th resume. To make ITS work properly, we changed >> the ATF code >> >> to re-enable ITS on resume. > > I don't think the words "work properly" apply here. > > The kernel didn't do what you wanted, so instead of fixing the kernel, > you > introduced a bug that results in memory corruption from the firmware. > > What are you plans to fix your firmware? Because from an upstream ATF > compatibility PoV, all there is to do is to fixup the command queue and > enable the ITS. > >         M. I'm sorry I didn't make it clear how to do this. I'm going to reset commit which re-enable ITS  on the ATF, and drop the checks for ITS_FLAGS_SAVE_SUSPEND_STATE in the OS. In other words, the ATF does not re-enable ITS, and OS itself re-enables ITS when it resumes. To do this, I have to remove the check of ITS_FLAGS_SAVE_SUSPEND_STATE because it is not set. Thanks         Xu.