Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2382918rwb; Fri, 11 Nov 2022 08:33:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf6mjLXEyGqj1Rv28vgPbs+3bKN5qzEusdreZPL4JzS2p4sRs7EKOVyjAGjO3z4njN1knQbq X-Received: by 2002:a17:906:7707:b0:78d:9324:6f18 with SMTP id q7-20020a170906770700b0078d93246f18mr2572397ejm.664.1668184387365; Fri, 11 Nov 2022 08:33:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668184387; cv=none; d=google.com; s=arc-20160816; b=tTQa8fT+zlMRrWRTdLfTmnUyxsSNsPhJYqrKpRTuUW6tSaz+5O+VKkTLA0N2SUmMUO q0VvSCeCKQDhnegea2TTLFX5hElnz6TZgSL7J4OrXHto6dtjCpuLGgWyfUn39/ZCltIj v/Cg0PTgrWHjziPiBIAGhUnwuvoOhTx58WPM/jK9+jCsgKlFBGPjzB82VIB8gdmiD1m/ AhIhQOZlnT6SKzMWn2KpOieVo26+hU9k9lOvEDlDt4CNioVL45ASxiJNK9bNeHA0u3gp 3w19QtiEFIHJDnuc8JxaGjdHv3SxD6nIsprKN4cPtEOr6HPvaf54UaKuOg4zIE9SM6h/ pNMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Ma5nKDqHPamKpmmuVATHYQSYqpS5EZLJN/j6mCZeW7E=; b=wTTDVCEuCr9WNuUwWbeXeRm1hFeo5Uisl1Moa3wqH8jSxWlbwAnE46Ca8+SVo1m3tD XyLtEyveAOvBhNWJrKhJTXiE7/rulSz61IjGOs8FgcFac0RavuXBfIRI5a2dzNfSPnEd OuZ3Iwg/DztdlOO+OrjFkycADvLKd8uaWDhmowh6+Z2bo287Y2norX0HIBsgu+gB0YVP MmsJgd5EYhysPKRfHB8rfHD/poJU6Wdp0B2yuzeskg4Jm5x9OccsdtGo0xLPkSGJMiMq MS63+zakNmdSNXcIz6a8QzqIkAqqpglHOpRxSe6er96FX9EhWfytk5MXCJuC5fH3BogA N61A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z16-20020a1709060f1000b007806a130086si2048762eji.302.2022.11.11.08.32.45; Fri, 11 Nov 2022 08:33:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232949AbiKKOWJ (ORCPT + 91 others); Fri, 11 Nov 2022 09:22:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234348AbiKKOVq (ORCPT ); Fri, 11 Nov 2022 09:21:46 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8001645ECF; Fri, 11 Nov 2022 06:14:07 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 322781FB; Fri, 11 Nov 2022 06:14:13 -0800 (PST) Received: from bogus (e103737-lin.cambridge.arm.com [10.1.197.49]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 57C313F73D; Fri, 11 Nov 2022 06:14:05 -0800 (PST) Date: Fri, 11 Nov 2022 14:14:02 +0000 From: Sudeep Holla To: Huisong Li Cc: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, rafael@kernel.org, rafael.j.wysocki@intel.com, wanghuiqiang@huawei.com, zhangzekun11@huawei.com, wangxiongfeng2@huawei.com, tanxiaofei@huawei.com, guohanjun@huawei.com, xiexiuqi@huawei.com, wangkefeng.wang@huawei.com, huangdaode@huawei.com Subject: Re: [PATCH V2 2/2] mailbox: pcc: fix 'pcc_chan_count' when fail to initialize PCC Message-ID: <20221111141402.7cun26euzubpesjs@bogus> References: <20221110015034.7943-1-lihuisong@huawei.com> <20221111024448.25012-1-lihuisong@huawei.com> <20221111024448.25012-3-lihuisong@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221111024448.25012-3-lihuisong@huawei.com> X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Change $subject as "mailbox: pcc: Reset pcc_chan_count to zero in case of PCC probe failure" On Fri, Nov 11, 2022 at 10:44:48AM +0800, Huisong Li wrote: > Currently, 'pcc_chan_count' is a non-zero value if PCC subspaces are parsed > successfully and subsequent processes is failure during initializing PCC > process. This may cause that pcc_mbox_request_channel() can still be > executed successfully , which will misleads the caller that this channel is > available. > I would reword this something like: "Currently, 'pcc_chan_count' is remains set to a non-zero value if PCC subspaces are parsed successfully but something else fail later during the initial PCC probing phase. This will result in pcc_mbox_request_channel() trying to access the resources that are not initialised or allocated and may end up in a system crash. Reset pcc_chan_count to 0 when the PCC probe fails in order to prevent the possible issue as described above. " > Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") Other than that, Reviewed-by: Sudeep Holla -- Regards, Sudeep