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 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 00466C636D3 for ; Fri, 3 Feb 2023 02:58:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=NXxwP32u70OtzkJqj60PeAma62O/lRMt+LzqMaC+9/I=; b=PA7zLzN0VQGUwP 4ClJvJECLoRWnjyozb1BTiLe1HYYN0wH8VpFYTlS/AwC3WLrWj58bWreGIpEmjoCXHCR+9DD/gqFD PfAOsQAZ2V2O8Fs4lxMoM1pOjEaRq4B5EawxBmiT06lZuT8e6RrazjUbmHjk+30XcBNyEdNA83hW0 NsxGJEiu6PBrj3QftYs3zn5r5pxRdpr2lH0rrh2pchJvEQ5+gMQzV1ajT4qoU7ENhHHcqolvsFJCa cUqhB2xPQe4/XDA5MNmdPn+Wy5ZkO8nggJZxHsgWtvRL2s0Qtfa50DSqPSGIENP2iHNxc06cNH6lq QCqBWl04CbB806a5mreg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNmGB-0006aY-OK; Fri, 03 Feb 2023 02:57:08 +0000 Received: from mail-ej1-x635.google.com ([2a00:1450:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pNmG6-0006Xl-1W for linux-arm-kernel@lists.infradead.org; Fri, 03 Feb 2023 02:57:03 +0000 Received: by mail-ej1-x635.google.com with SMTP id m2so11713412ejb.8 for ; Thu, 02 Feb 2023 18:57:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/ok9gGPenaG0pOj9GcctZNAhyR0+is7FwD5tHMljl+c=; b=DonLghx99ZLKNMokYG8i+JU5yhLe+vdPRewmYK7mYHqkScsddLoX0iIzLtxb/TjQU9 Ge/RtIIGtygzVW3O0URyBA4FiMYP2qMH/9BYP0leBcQd/Tv8VpjO6+VyhhOvW2CeJ+rd mUmkwrYpgbuwbsV42yR6eR1Ex7cJbL5ooXZNKEqPL71p5EH5+SBVQ7shL4rmn9hUpyO/ lLVtI2bRxUGmgbt1Ng7X3FZWf5yWqOLNqDgFopo+/6ySkzgGVlTGSbYxrrwC2/Q/qgIN kp34koKN48KM+sVgboXPPavRVkUuQRzsFPdfH0vEuljvHmqMXbWYpr+jAtsv8hLmn3dI dOUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/ok9gGPenaG0pOj9GcctZNAhyR0+is7FwD5tHMljl+c=; b=toqhjrATZGSTEsy7YVisV3OCYlkYortpoG2KwthcKS+zmv5nNs77UpVIg5WB1OJUyy mfPcN0/0TJMeuw/0ewJCQCcfPd7Hr6RC/yFtRZs3hab6nEs2/b/KndqRtpQm7mCbt32s cI5Fy1gPR/ZzITfYKGMMq7NAZmMzP4c21I/N7/hwUXAH+7W0Xor5fmOsKzGdct6Gqe9R rBMXaDTjk9c7PzjURRXUiObb23XG5O6Vs96UcBAC69IkNrvONP3M91eygm5OE0sOYB6s w7/9nClmSWCf/tv4eF3joZEMkeMYfC/D7WPAajJAb005TmNd6z1dVqXMwgohbXi1HLgL AErw== X-Gm-Message-State: AO0yUKVlgqrntTKA2nHq2eBd/GfAFj5dWXhCTRup2tTQ1PtknGsYDNLk X+nzHJ3Nt5ULoFHbivbBIuhR5g== X-Google-Smtp-Source: AK7set/Byn6DoU49uWxDMQUBshfAhbUWyxEUatb8mJo23NUaNotYcfd4KJmg2Qvd0ixB+R/ypE+Eiw== X-Received: by 2002:a17:907:d08a:b0:883:258d:2951 with SMTP id vc10-20020a170907d08a00b00883258d2951mr437179ejc.4.1675393018937; Thu, 02 Feb 2023 18:56:58 -0800 (PST) Received: from [192.168.1.101] (abyl20.neoplus.adsl.tpnet.pl. [83.9.31.20]) by smtp.gmail.com with ESMTPSA id v9-20020a17090690c900b0088879b211easm677117ejw.69.2023.02.02.18.56.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Feb 2023 18:56:58 -0800 (PST) Message-ID: Date: Fri, 3 Feb 2023 03:56:56 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0 Subject: Re: [PATCH 12/23] interconnect: qcom: sm8450: fix registration race Content-Language: en-US To: Johan Hovold , Georgi Djakov Cc: Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Andy Gross , Bjorn Andersson , Sylwester Nawrocki , =?UTF-8?B?QXJ0dXIgxZp3aWdvxYQ=?= , Krzysztof Kozlowski , Alim Akhtar , Thierry Reding , Jonathan Hunter , linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-arm-msm@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Vinod Koul References: <20230201101559.15529-1-johan+linaro@kernel.org> <20230201101559.15529-13-johan+linaro@kernel.org> From: Konrad Dybcio In-Reply-To: <20230201101559.15529-13-johan+linaro@kernel.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230202_185702_128022_E0065888 X-CRM114-Status: GOOD ( 21.65 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 1.02.2023 11:15, Johan Hovold wrote: > The current interconnect provider registration interface is inherently > racy as nodes are not added until the after adding the provider. This > can specifically cause racing DT lookups to fail. > > Switch to using the new API where the provider is not registered until > after it has been fully initialised. > > Fixes: fafc114a468e ("interconnect: qcom: Add SM8450 interconnect provider driver") > Cc: stable@vger.kernel.org # 5.17 > Cc: Vinod Koul > Signed-off-by: Johan Hovold > --- Reviewed-by: Konrad Dybcio Konrad > drivers/interconnect/qcom/sm8450.c | 22 +++++++++++----------- > 1 file changed, 11 insertions(+), 11 deletions(-) > > diff --git a/drivers/interconnect/qcom/sm8450.c b/drivers/interconnect/qcom/sm8450.c > index e3a12e3d6e06..c7a8bbf102a3 100644 > --- a/drivers/interconnect/qcom/sm8450.c > +++ b/drivers/interconnect/qcom/sm8450.c > @@ -1876,9 +1876,10 @@ static int qnoc_probe(struct platform_device *pdev) > provider->pre_aggregate = qcom_icc_pre_aggregate; > provider->aggregate = qcom_icc_aggregate; > provider->xlate_extended = qcom_icc_xlate_extended; > - INIT_LIST_HEAD(&provider->nodes); > provider->data = data; > > + icc_provider_init(provider); > + > qp->dev = &pdev->dev; > qp->bcms = desc->bcms; > qp->num_bcms = desc->num_bcms; > @@ -1887,12 +1888,6 @@ static int qnoc_probe(struct platform_device *pdev) > if (IS_ERR(qp->voter)) > return PTR_ERR(qp->voter); > > - ret = icc_provider_add(provider); > - if (ret) { > - dev_err(&pdev->dev, "error adding interconnect provider\n"); > - return ret; > - } > - > for (i = 0; i < qp->num_bcms; i++) > qcom_icc_bcm_init(qp->bcms[i], &pdev->dev); > > @@ -1905,7 +1900,7 @@ static int qnoc_probe(struct platform_device *pdev) > node = icc_node_create(qnodes[i]->id); > if (IS_ERR(node)) { > ret = PTR_ERR(node); > - goto err; > + goto err_remove_nodes; > } > > node->name = qnodes[i]->name; > @@ -1919,12 +1914,17 @@ static int qnoc_probe(struct platform_device *pdev) > } > data->num_nodes = num_nodes; > > + ret = icc_provider_register(provider); > + if (ret) > + goto err_remove_nodes; > + > platform_set_drvdata(pdev, qp); > > return 0; > -err: > + > +err_remove_nodes: > icc_nodes_remove(provider); > - icc_provider_del(provider); > + > return ret; > } > > @@ -1932,8 +1932,8 @@ static int qnoc_remove(struct platform_device *pdev) > { > struct qcom_icc_provider *qp = platform_get_drvdata(pdev); > > + icc_provider_deregister(&qp->provider); > icc_nodes_remove(&qp->provider); > - icc_provider_del(&qp->provider); > > return 0; > } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel