From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 98990C388F7 for ; Tue, 10 Nov 2020 09:09:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 459F920781 for ; Tue, 10 Nov 2020 09:09:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731831AbgKJJJF (ORCPT ); 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.