Message ID | 20221111024448.25012-3-lihuisong@huawei.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp507887wru; Thu, 10 Nov 2022 19:04:07 -0800 (PST) X-Google-Smtp-Source: AA0mqf4b2hZaZpRwDYVAS0rNXOjB/zCKV2exaBw/Vr1WzogqWuCI5F+fnzLgDA6e0r7jL/lUECaP X-Received: by 2002:a17:903:1249:b0:187:3d00:7ca4 with SMTP id u9-20020a170903124900b001873d007ca4mr239596plh.135.1668135847005; Thu, 10 Nov 2022 19:04:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668135847; cv=none; d=google.com; s=arc-20160816; b=L8LOou9HOkH44T5XIce+vtyFHzM3D6XXVcPNYg+TrbJnIKcOpFcu7Nf+bmhIl41lvL OHRg8WzMlJ0bYdxSg8mh5Saz737Nurx7mKaTKEhvVgD1KjEPmzVlwDERidYaBF9/0NTW VXn6/pcZTB2gz7XRR4iBktjKPTX/8hLM2KFvMBARu/5NVSDERxRTYlrvFXntGrsxdHF7 1Esh62SMmNCJLqAJWiWmPRycpxj9Sc1awS3l88l76lVNkQ33vzKVoTNth5stmGo06Cvu PFfgAYyoPB6xPnnCTkYb/vgs4b7xAMllN9pgCy+H6kyAFdp3w5UeygUqB6YWLEnQKf39 LjCw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=ck1wSVbjC9yWazfw7vfEVsmBBr6f6EeTNJsZxCh6vv4=; b=ylE6SNTae2dudoXJnLyQLQTa/DK2n/EKZxkGArl/Xui7muXfw03TbHIg9CHqVVwwtF iSP+A5zEBAZMPB5GyEEl/coZ1LD3K9t3+PsrF1IByUA18rx41o4RDGsou7jxx4g4t3oK APweosNKTk7JuI2wLVS43uPQH9Sh54YVRTIWvBoHNc9QRJs3fwIFQ4KmDT1f0Nby4uYB fnAq8zObO6zgHxrrso//VCISzeCNks4VNdkHomE4vZ84a1ntlDr3B4wF5ZIH9f/80P0j 6lefkS2uSmuWlZ0N98mbvKQMgh8QfMfKAs+qHXx69grAPu8bs5qNMZVXhM8gHrV+9k8d Wnzg== 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 16-20020a631550000000b0046edf6e538asi1038553pgv.417.2022.11.10.19.03.52; Thu, 10 Nov 2022 19:04:06 -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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233004AbiKKCtw (ORCPT <rfc822;winker.wchi@gmail.com> + 99 others); Thu, 10 Nov 2022 21:49:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233015AbiKKCth (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 10 Nov 2022 21:49:37 -0500 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CD630DF0A; Thu, 10 Nov 2022 18:47:06 -0800 (PST) Received: from dggemv703-chm.china.huawei.com (unknown [172.30.72.55]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4N7jgZ37xHzbmlq; Fri, 11 Nov 2022 10:43:22 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by dggemv703-chm.china.huawei.com (10.3.19.46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 11 Nov 2022 10:47:04 +0800 Received: from localhost.localdomain (10.28.79.22) by kwepemm600004.china.huawei.com (7.193.23.242) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Fri, 11 Nov 2022 10:47:04 +0800 From: Huisong Li <lihuisong@huawei.com> To: <linux-acpi@vger.kernel.org>, <linux-kernel@vger.kernel.org> CC: <rafael@kernel.org>, <sudeep.holla@arm.com>, <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>, <lihuisong@huawei.com> Subject: [PATCH V2 2/2] mailbox: pcc: fix 'pcc_chan_count' when fail to initialize PCC Date: Fri, 11 Nov 2022 10:44:48 +0800 Message-ID: <20221111024448.25012-3-lihuisong@huawei.com> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20221111024448.25012-1-lihuisong@huawei.com> References: <20221110015034.7943-1-lihuisong@huawei.com> <20221111024448.25012-1-lihuisong@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.28.79.22] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600004.china.huawei.com (7.193.23.242) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749072280682433464?= X-GMAIL-MSGID: =?utf-8?q?1749167214067251864?= |
Series |
optimize pcc code and fix one bug
|
|
Commit Message
Huisong Li
Nov. 11, 2022, 2:44 a.m. UTC
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.
Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe")
Signed-off-by: Huisong Li <lihuisong@huawei.com>
---
drivers/mailbox/pcc.c | 1 +
1 file changed, 1 insertion(+)
Comments
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 <sudeep.holla@arm.com>
diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c index 3c2bc0ca454c..105d46c9801b 100644 --- a/drivers/mailbox/pcc.c +++ b/drivers/mailbox/pcc.c @@ -743,6 +743,7 @@ static int __init pcc_init(void) if (IS_ERR(pcc_pdev)) { pr_debug("Err creating PCC platform bundle\n"); + pcc_chan_count = 0; return PTR_ERR(pcc_pdev); }