Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp727597rdd; Tue, 9 Jan 2024 19:17:33 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2KE3fLJFYRs/RtJOAVu5ktDbiSKyJ6S8VLMlR3+xioKvPUzWaFGRoaniWJveQ39cIoJpV X-Received: by 2002:a05:6870:4208:b0:206:41c5:fa8f with SMTP id u8-20020a056870420800b0020641c5fa8fmr53598oac.83.1704856653121; Tue, 09 Jan 2024 19:17:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704856653; cv=none; d=google.com; s=arc-20160816; b=LdvysZfCv0gk45Y/iCqySraRfe68QdGmrNoTke5d+aENEHWaJGrrdy1f3btQpUuU51 Q2xDKrNNe2u3E6r06vXBIBWBjnM36Loyv/TO1I2rpuq19aR8NdswQQ6cAmmdmrtuIztD REjgQ7+xQiSmkF03HjQFhmIm0sbK4BAxHYNOj6mst2wxE5a1uxsdM3j4dfdPAhgwVTba UonEZTxBi0GVq3CmsFqq/O4oeiqJ/0pF9g+9TLdyXrMlhIvDQZtrS0cYo4cRGjP4RSqu R8e+EiizYtXrhBk3edA8E2a+j+rXNm0506az7xk+5IcTm4NbPad286j+68/+OeiyoLnv KHgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=eT2RFPcUzBjCFcgmYWvFX29+fptit5SqWct6bYbB0rY=; fh=FAJoIPMyX4HA1+2ruMZcIy7VcwU07g8HWOxCcU5nTvQ=; b=Odpw1gDqaxavxMZMatjQsJvPQyJW6akRnQoGvlBqGdfEiTqbdJ4WyEOmCU3irsmrRw x5e596nZKxu5yX2uufWgUHOd4vbR1ZqtBJP2zE2UODR3rJ/Xt/zGTq1wHVdJqnh58WO+ bOhJ3rTg50kXQqLrQieNV/RyLDSFlXaEpl3hM9Fu4I/B5Rq0UxQRaazoRwQy8vYfTd6/ 1j9gsrOS0nD2/wyitXISXACd2E/IHWEriakp3OGc8/76pmMmftA5v4sUNkqkYXXrdOsF 06RfPdi07tf7X2Ded/mqg9iwKW3kYKyk1mh86nRlqc1Gt8n9QtytJQJ3wAhsh3ffN99n ErWg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gewyc9vY; spf=pass (google.com: domain of linux-kernel+bounces-21683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21683-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id j17-20020a63e751000000b005cdfa675225si2611732pgk.833.2024.01.09.19.17.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 19:17:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=gewyc9vY; spf=pass (google.com: domain of linux-kernel+bounces-21683-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21683-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 14D21B2492A for ; Wed, 10 Jan 2024 03:17:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F426523A; Wed, 10 Jan 2024 03:17:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="gewyc9vY" Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3DCB723B1; Wed, 10 Jan 2024 03:17:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 40A1hmDC028430; Wed, 10 Jan 2024 03:16:59 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=eT2RFPcUzBjCFcgmYWvFX29+fptit5SqWct6bYbB0rY=; b=ge wyc9vYJ7JP7/kYqmB2apNJZVwkC2sUOu7LIFCWZlTgKnwzqgSy917cWJBs12+niL ctJ9AvMCEpWiHL+RFbuNmYaTahO21uOe8taj1BgVC75+gY7J2xexl8vpQn61iCjk 4n+T115+I+U56PMTT0rFpiOROpBiYmVdcbyV+AzrBaSaI4qERr5px2kxJ2y3epeQ advp2/vM2xPT51JLrLxf2cT9IcKlW6GsBuTHFz62nUqk0QppcoNZyo02VMSQewI7 MfHNFG/P95e8yoWEfe/ypmT68wdcFXM9AId6cAWGYAWwexAxw1edhs4o4xsLefRx ppD1wHV16ocCIKbHBfPw== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vh3g6a22r-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 03:16:58 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40A3GvUb013535 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 03:16:57 GMT Received: from [10.216.11.180] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Tue, 9 Jan 2024 19:16:48 -0800 Message-ID: <16efa89e-6a9d-4e9a-9020-239b9750119d@quicinc.com> Date: Wed, 10 Jan 2024 08:46:40 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 07/12] usb: dwc3: qcom: Instantiate dwc3 core directly Content-Language: en-US To: Bjorn Andersson , Wesley Cheng , Thinh Nguyen , "Johan Hovold" , Konrad Dybcio CC: , , , , Conor Dooley , Felipe Balbi , Rob Herring , Krzysztof Kozlowski , Greg Kroah-Hartman , Bjorn Andersson , "Philipp Zabel" References: <20231016-dwc3-refactor-v1-0-ab4a84165470@quicinc.com> <20231016-dwc3-refactor-v1-7-ab4a84165470@quicinc.com> From: Krishna Kurapati PSSNV In-Reply-To: <20231016-dwc3-refactor-v1-7-ab4a84165470@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: mTqddsODM1Z5spr7u8a0eebT_TPOR2qa X-Proofpoint-ORIG-GUID: mTqddsODM1Z5spr7u8a0eebT_TPOR2qa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.997,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-12-09_02,2023-12-07_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxscore=0 bulkscore=0 spamscore=0 malwarescore=0 phishscore=0 clxscore=1015 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=794 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2311290000 definitions=main-2401100025 On 10/17/2023 8:41 AM, Bjorn Andersson wrote: > The Qualcomm DWC3 glue builds up a platform_device programmatically in > order to probe the DWC3 core when running off ACPI data. But with the > newly introduced support for instantiating the core directly from the > glue, this code can be replaced with a single function call. > > @@ -942,7 +889,7 @@ static int dwc3_qcom_probe(struct platform_device *pdev) > if (np) > ret = dwc3_qcom_of_register_core(pdev); > else > - ret = dwc3_qcom_acpi_register_core(pdev); > + ret = dwc3_qcom_probe_core(pdev, qcom); > > if (ret) { > dev_err(dev, "failed to register DWC3 Core, err=%d\n", ret); > @@ -986,10 +933,10 @@ static int dwc3_qcom_probe(struct platform_device *pdev) > interconnect_exit: > dwc3_qcom_interconnect_exit(qcom); > depopulate: > - if (np) > + if (qcom->dwc_dev) > of_platform_depopulate(&pdev->dev); > else > - platform_device_put(pdev); > + dwc3_remove(qcom->dwc); Hi Bjorn I was testing this patch and I suspect there is one issue. In the event dwc3_qcom_probe_core fails because dwc3_probe failed, then the variable (qcom->dwc) is NULL. We then exercise the depopulate path and we call dwc_remove(NULL) causing a crash. Regards, Krishna,