Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp532902rwb; Thu, 10 Nov 2022 04:22:36 -0800 (PST) X-Google-Smtp-Source: AMsMyM5k6L6rDD4Dq1pYEWExe3NG3ldVGX0AVbF6ga78BWU/y2jj8NyC0kxDbM9pHEuzCcpnbIhS X-Received: by 2002:a17:902:b697:b0:187:1acf:249c with SMTP id c23-20020a170902b69700b001871acf249cmr56345214pls.14.1668082956243; Thu, 10 Nov 2022 04:22:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668082956; cv=none; d=google.com; s=arc-20160816; b=dgRrdIU/7olzcW62gF5mnOAzAMnH7OVnhPjVrhSaSZVJRbCktu1iv3ePi8rP/Ciifr IE80Vt9pCcpuqgse5Zy5fg5ZLNWKxQGZ8bSa1CAvmQnZtuahnr+Y3e1ciS0VJpBXyLcN LunwscYqZtLipdaRIPgQaOS+OpIkN2uvW4vODn9hswM/oXBtb5hvzIESdAXdx8LmSAh6 bRJSvAmk+VuKtLYA+3LQgMx8HwOz1KF2l6C6f1VZqA8PINB71hmz7cURzHrgNsUFlJdG rUO21MtUKFDQY5ugCtABxJhuvFNCpmwFZhr3IOsK46dvap9z/RpmfrzDlWXva6lRe8uN NbBA== 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:from :references:cc:to:subject:user-agent:mime-version:date:message-id; bh=kwgJFgDBzA9igAeklSKmEsLmE82Ewy+vuh9U1LKQsbQ=; b=wNWg+/j1WiMzSYAALAL34BpGGb2CREHXJ8WpYa8j7sOtrH0wykULYfFQllydWvW/BQ P7FRceuOVsppG6peRVqLrd0LO/oeLF4th+Q6ZH1pgTdgmyWX/VrN4pN6KgUCn7WydjQm bYFVfZqjwSfupIvzUgoVVGmI/mJpzsJEYdO0etIV6aijtLz956yUZ6mxPV3zf1cmpReJ M1/3PbtfehotKzRthS7mdPDAPADP6O7/qe9Jon2QX6vrKfnHAXrQhbX7EKt3gjTP8u9H TFwKw5IndaolXShWn2eOQTOSZD/5h0x69bl+qogAvFnDyt6G2DJPbeZEG3zMav44IqyM sryw== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z6-20020a170902708600b001868d5fc29bsi19420839plk.259.2022.11.10.04.22.22; Thu, 10 Nov 2022 04:22:36 -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 S230494AbiKJMK1 (ORCPT + 92 others); Thu, 10 Nov 2022 07:10:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230219AbiKJMKP (ORCPT ); Thu, 10 Nov 2022 07:10:15 -0500 Received: from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B87F71F2D; Thu, 10 Nov 2022 04:10:08 -0800 (PST) Received: from dggemv711-chm.china.huawei.com (unknown [172.30.72.57]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4N7LHj1v5yz15MNp; Thu, 10 Nov 2022 20:09:53 +0800 (CST) Received: from kwepemm600004.china.huawei.com (7.193.23.242) by dggemv711-chm.china.huawei.com (10.1.198.66) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.31; Thu, 10 Nov 2022 20:10:06 +0800 Received: from [10.67.103.231] (10.67.103.231) 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; Thu, 10 Nov 2022 20:10:06 +0800 Message-ID: <4c4cb2a5-c029-1815-e06a-f6d055ed5912@huawei.com> Date: Thu, 10 Nov 2022 20:10:05 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.2.0 Subject: Re: [PATCH 3/3] mailbox: pcc: fix 'pcc_chan_count' when fail to initialize PCC To: Sudeep Holla CC: , , , , , , , , , , , References: <20221110015034.7943-1-lihuisong@huawei.com> <20221110015034.7943-4-lihuisong@huawei.com> <20221110104415.gk3asb5yc26slcs7@bogus> From: "lihuisong (C)" In-Reply-To: <20221110104415.gk3asb5yc26slcs7@bogus> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.103.231] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) 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,NICE_REPLY_A, 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: X-Mailing-List: linux-kernel@vger.kernel.org 在 2022/11/10 18:44, Sudeep Holla 写道: > On Thu, Nov 10, 2022 at 09:50:34AM +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. >> >> Fixes: ce028702ddbc ("mailbox: pcc: Move bulk of PCCT parsing into pcc_mbox_probe") >> Signed-off-by: Huisong Li >> --- >> drivers/mailbox/pcc.c | 11 ++++++++--- >> 1 file changed, 8 insertions(+), 3 deletions(-) >> >> diff --git a/drivers/mailbox/pcc.c b/drivers/mailbox/pcc.c >> index 7cee37dd3b73..47d70c5884e3 100644 >> --- a/drivers/mailbox/pcc.c >> +++ b/drivers/mailbox/pcc.c >> @@ -294,6 +294,7 @@ pcc_mbox_request_channel(struct mbox_client *cl, int subspace_id) >> pr_err("Channel not found for idx: %d\n", subspace_id); >> return ERR_PTR(-EBUSY); >> } >> + > Spurious/not needed change ? Ack > >> dev = chan->mbox->dev; >> >> spin_lock_irqsave(&chan->lock, flags); >> @@ -735,7 +736,8 @@ static int __init pcc_init(void) >> >> if (ret) { >> pr_debug("ACPI PCC probe failed.\n"); >> - return -ENODEV; >> + ret = -ENODEV; >> + goto out; > Not needed, we don't set pcc_chan_count if the probe failed. You are right. will fix it in v2, thanks. > >> } >> >> pcc_pdev = platform_create_bundle(&pcc_mbox_driver, >> @@ -743,10 +745,13 @@ static int __init pcc_init(void) >> >> if (IS_ERR(pcc_pdev)) { >> pr_debug("Err creating PCC platform bundle\n"); >> - return PTR_ERR(pcc_pdev); >> + ret = PTR_ERR(pcc_pdev); > You just need to set pcc_chan_count to 0 here, so no need for goto. Ack >