Received: by 2002:a05:7412:e794:b0:fa:551:50a7 with SMTP id o20csp726493rdd; Tue, 9 Jan 2024 19:14:09 -0800 (PST) X-Google-Smtp-Source: AGHT+IFr0mf0gEgiB2ub7EmD/Sw6tQsHOVUX/0ti0Szbhv6lLn/r7LCFMKbElmNU2BZfvn/N3J0Z X-Received: by 2002:a17:902:6b04:b0:1d4:576e:91cc with SMTP id o4-20020a1709026b0400b001d4576e91ccmr381593plk.7.1704856448753; Tue, 09 Jan 2024 19:14:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704856448; cv=none; d=google.com; s=arc-20160816; b=mzCqeBGRqcQV8X34i6YEvEMihlsnbRAOXxSpgpTj4FcseEKzmEnTp/Hl9fpnyq2e8Q 1SjWTsl3Fs5IUw9urWWKBC3HouxW/FnLCm8+7vBLzpzKGN5x3AdRITHugW3D7AR9rQTD qqAgJpEB2eYeGHNg5816UmMTPFk2//p6HeA6absnnj1Z1PLZUGrUeICWLJFFAcqcDEkY xVO4Rj4ZCtXWBxZ8nqPoZcuioVcrj/DcJRDYKLYNfq5/78IpaC0J1CV1xtxzUevImj79 tZWottMyVnTUl9VWVcQCVUo7cK5SMDPIzJ6PxxlFHaF8i/CzfM7/n2lSxDAccgx/U0fG a8mw== 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:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=d9w7wjgOS8mGxwNpTv84Utw47mif3tx4Ue+gG+2EhJA=; fh=qs3YBxdx7cpQBTlmj8CS5I0hbUAEQ/XANQJs1DCdh0U=; b=WEE3QLrUpMgaNIfuBJlWpDckYqPXfGMSmr08g+tQN/+N394pOLKu262HFU3RQx5rHJ RAQGNqQIUWBLbI6KYY9ktCT/wQN+SMjiS/iL5D8OGqDu1gYlxutT4i11mBuUd9tqZxPI Xq6+xcErpC9M5rw5l850pLrXWqaBrzhe9lXRTNf+fqGJYnr05+a75kd4KXLVe84ErjQ3 jgYMdHvQP7MM9VYcMC/l6z5iPxbY/h/0wq6penQzm72NIGz2ZJBgQHs3ralRqxBey4Rv 8Jks4rh8K6a0NTMgL5E5c/x4JZSwEBmtqVO5vRNtwQBdALCaprft8R81xX9vT9jbTR5E mymw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=CfcAwT2v; spf=pass (google.com: domain of linux-kernel+bounces-21680-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21680-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 e2-20020a170902d38200b001bc162f3318si2581117pld.640.2024.01.09.19.14.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 09 Jan 2024 19:14:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-21680-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=CfcAwT2v; spf=pass (google.com: domain of linux-kernel+bounces-21680-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-21680-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 1E5F8B25BDC for ; Wed, 10 Jan 2024 03:14:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EA7884C69; Wed, 10 Jan 2024 03:13:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="CfcAwT2v" 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 B3D3123B1; Wed, 10 Jan 2024 03:13:48 +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 40A1oeTY007299; Wed, 10 Jan 2024 03:13:39 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=d9w7wjgOS8mGxwNpTv84Utw47mif3tx4Ue+gG+2EhJA=; b=Cf cAwT2vpoVLXzZ4hynPZkYfLwzLErMFuZblyVe2dH4yplRFfWJkDyjIV8JJ/lzLLq DhoJxHBX2FMajlbb7W9sFYSlk6CMGjQ4MtSSlb7UGM6DBXIVGEH8w5siQHBTbkIS WjdAC/B95Gm/8a3VxsjZ4d5QAaUK0/FxjEYuM9HWJ2db7PdaWev9VXHgluaLDIxd y897I4Ec9xwntlIB9graKnhQ3numPMZFmMOPStMqDqij01xVWQre0O256+z7Qfcx M9knYG/9KmagyV97+NCs2T/yzZ6p+aFEOmC+a9iMyFXgPC+wwiWteUDktdRGL8G1 bRn9ithfn6abfA0o/04w== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3vh3g6a1ws-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 03:13:38 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 40A3DbkX017605 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 10 Jan 2024 03:13:37 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:13:27 -0800 Message-ID: <1c706807-a216-47cd-a1f6-0546bec27242@quicinc.com> Date: Wed, 10 Jan 2024 08:43:23 +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 11/12] usb: dwc3: qcom: Flatten the Qualcomm dwc3 binding and implementation To: Bjorn Andersson , Wesley Cheng , Johan Hovold , Thinh Nguyen CC: , , Conor Dooley , Felipe Balbi , Philipp Zabel , Greg Kroah-Hartman , Konrad Dybcio , Krzysztof Kozlowski , Rob Herring , "Bjorn Andersson" , , References: <20231016-dwc3-refactor-v1-0-ab4a84165470@quicinc.com> <20231016-dwc3-refactor-v1-11-ab4a84165470@quicinc.com> Content-Language: en-US From: Krishna Kurapati PSSNV In-Reply-To: <20231016-dwc3-refactor-v1-11-ab4a84165470@quicinc.com> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: U2RJGWVGzdGrz0jn4htADaAadCfK1gqy X-Proofpoint-ORIG-GUID: U2RJGWVGzdGrz0jn4htADaAadCfK1gqy 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=1011 impostorscore=0 suspectscore=0 lowpriorityscore=0 mlxlogscore=445 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 USB block found in most Qualcomm platforms is modelled as three > different independent device drivers, and represented in DeviceTree as > two layered nodes. But as shown by the already existing layering > violations in the Qualcomm glue driver they can not be operated > independently. > > In the current model, the probing of the core is asynchronous, and in a > number of places there's risk that the driver dereferences NULL > pointers, as it peeks into the core's drvdata. > > There is also no way, in the current design to make the core notify the > glue upon DRD mode changes. Among the past proposals have been attempts > to provide a callback registration API, but as there is no way to know > when the core is probed this doesn't work. > > Based on the recent refactoring its now possible to instantiate the glue > and core from a single representation of the DWC3 IP-block. This will > also allow for the glue to pass a callback to be called for DRD mode > changes. > > The only overlapping handling between the Qualcomm glue and the core is > the release of reset, which is left to the core to handle. > Hi Bjorn, I think the reset has to be handled by glue itself. I was testing this series and found one issue: During suspend, we suspend core first which will assert the reset and then suspend the glue which will disable the clocks. This path doesn't seem to have a problem somehow even in flattened implementation. During resume, we resume the glue first and then resume the core. During resume of glue, we enable the clocks and at this point, the reset is still kept asserted causing the clocks to never turn ON leading to a crash. This is the case in flattened implementation only as in normal case, the reset is handled by glue and we never meddle with reset other than the time of probing. I tried to check if we explicitly de-assert the reset during start of resume sequence of glue (in addition to the de-assertion present in core) and things worked out fine. But if I try to balance the reset count and add an assert at end of suspend sequence of glue (in addition to the assertion present in core), then it crashes complaining a double assertion happened. So double de-asserting is not causing a problem but double asserting is causing an issue. Regards, Krishna,