Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp2536362rdb; Fri, 22 Sep 2023 01:10:07 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH5qmeFeCMdAIy+W7f63Am6bckt7C6f0wRO5TLEr9nEXwZuNIq/4DxLe0MlojH7tZaCTsAW X-Received: by 2002:a05:6a00:14d5:b0:68e:3f0b:5e6f with SMTP id w21-20020a056a0014d500b0068e3f0b5e6fmr8420653pfu.24.1695370207301; Fri, 22 Sep 2023 01:10:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695370207; cv=none; d=google.com; s=arc-20160816; b=0Nz+hwP/+eDa/7mfImEz4HscZOdwKtIBioFYaxfwMVF3y0X5BMAvmen7tQDzMGahGm zd7BaBuRlYuihx4nm80BpwED5YET02Cyo0UloYzfe9aiwjV6hb5Heq19+KiELbki2zUf KmkP3P3ohfyY/e+WwgW83YnmUYBK/azOMdVl+TE3KhRNZXYJAY/dlAXBqCiEfR147sxC e88eLfarRz8nIcywiYWAIR1dKJJzXHuh3CrcwdmWNCgJCmW4fZ5fvt9K5G8FkWSBdVCv GDlvJAsZ5yRd4IdcrY5F+BIbCi7cQdJR4X3c6zk+dGr09RxfxHm57EUROuioppKWbEU0 hnEw== 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:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=5dKSzsyZM5JPtVbo5DfS/qJ3ZHwTE1rMzD1SnxB46FA=; fh=2To/P2vokQi9M6zKs7w2HLb+rmUaNjNXAA5gEQP6tZk=; b=EvmHNxyxSlMJZoL9fiOmP0YJTlFtbEbXQURlO5TbU4YiuHz1RFrYD8OsjWJFclDXJZ WfBtDcbzfaTraZE0hXlyhRIPWgn8neFmVasDQlK4Hm/8Ac9Y9dAZ0WGinFU8oWP0iy8j rvHBPRRHBFtZSq+0fwC+SlA0xMPvYXkrUpB+SANT2Q3AsZPgt7S9uPrD5BckATxdqh7t Qc/q3J/9H91bqbI26gkFiQnps8MfnXwl7pC8gY77A8MhGTWZ5RNaVuK+fpexWl5ahNn+ y/zW6L4CBStGN7rnudRwJMLlggMhhB0tyh3VwKvLp/Qq4YBtftQWyWkqjrnjaQirpEGL M1kw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ie1HxowF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from snail.vger.email (snail.vger.email. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j185-20020a638bc2000000b00573e329b014si3458836pge.339.2023.09.22.01.10.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Sep 2023 01:10:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=ie1HxowF; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 9C7C6832FDDF; Thu, 21 Sep 2023 14:16:19 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232713AbjIUVQV (ORCPT + 99 others); Thu, 21 Sep 2023 17:16:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232779AbjIUVOu (ORCPT ); Thu, 21 Sep 2023 17:14:50 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6077173A; Thu, 21 Sep 2023 10:09:36 -0700 (PDT) Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 38LF7SUj001730; Thu, 21 Sep 2023 17:09:31 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=5dKSzsyZM5JPtVbo5DfS/qJ3ZHwTE1rMzD1SnxB46FA=; b=ie1HxowFegRzzkWhYjJZ0E65hkj437NXMRkZbWJYHZUfm+VEKpKdstevytrL44zX35jR ukS4Gw9L0WHaBJuG52a+uAOJ+9nHGE4v0mCReVJ0RhR0H8nOgGq+a2mieUkjrJJMxx+s ij3oETuUSIHuwjGZXzmE1mpcgONyVylToul6LQ3AhG0IA9ryVWxg8d+vOCkkxuSLsvSe vbohb6q5W9FEG9jc67IstvSq3Uvh8WfZMn2zSYFBhNVxWM7bfTKydowR3Pr9eFXHSnq1 4cl71pcf38W09fZs9SxwrbMoOV34URjixneGaiN2m+idRaK2Zv00c+14/xM4Eq1ceo+K mw== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3t8892252q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Sep 2023 17:09:30 +0000 Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 38LH9TWu030076 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 21 Sep 2023 17:09:29 GMT Received: from [10.71.115.175] (10.80.80.8) by nalasex01b.na.qualcomm.com (10.47.209.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.36; Thu, 21 Sep 2023 10:09:28 -0700 Message-ID: <63c9ced1-6204-88e9-1dae-2979388bbc67@quicinc.com> Date: Thu, 21 Sep 2023 10:09:21 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH v4 2/3] dt-bindings: usb: snps,dwc3: Add runtime-suspend-on-usb-suspend property Content-Language: en-US To: Krzysztof Kozlowski , Thinh Nguyen CC: Roger Quadros , "gregkh@linuxfoundation.org" , "robh+dt@kernel.org" , "krzysztof.kozlowski+dt@linaro.org" , "conor+dt@kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , References: <31fa930a-51fb-6a7f-300d-e71f6b399eb1@linaro.org> <5dfae814-7233-eb1f-cae7-f335e54ce1b6@linaro.org> <20230826015257.mbogiefsbz5474ft@synopsys.com> <969988f6-f01f-0e31-6a98-7d02c5a3a4ad@quicinc.com> <20230830013739.srnh2uyhly66yvu2@synopsys.com> <6f70a710-c409-23c0-890b-370ccd23e088@linaro.org> <20230831030134.z46fjwyr6edl3t7x@synopsys.com> From: Elson Serrao In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01b.na.qualcomm.com (10.47.209.197) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: leAIDSd3QKQtagJEXnzmzO_uHngggWLO X-Proofpoint-ORIG-GUID: leAIDSd3QKQtagJEXnzmzO_uHngggWLO X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-09-21_14,2023-09-21_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1011 impostorscore=0 mlxlogscore=999 adultscore=0 bulkscore=0 malwarescore=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 phishscore=0 spamscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2308100000 definitions=main-2309210148 X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Thu, 21 Sep 2023 14:16:19 -0700 (PDT) On 8/30/2023 11:29 PM, Krzysztof Kozlowski wrote: > On 31/08/2023 05:01, Thinh Nguyen wrote: >> On Wed, Aug 30, 2023, Krzysztof Kozlowski wrote: >>> On 30/08/2023 06:31, Elson Serrao wrote: >>>> >>>> >>>> On 8/29/2023 6:37 PM, Thinh Nguyen wrote: >>>>> Just want to clarify, there are dwc3 properties and there are dt binding >>>>> properties. Often the case that dt binding matches 1-to-1 with dwc3 >>>>> driver property. Now, we need to enhance the checkers so that the dwc3 >>>>> driver property to match cases where it is platform specific and through >>>>> compatible string. >>>>> >>>> >>>> Thank you for the clarification Thinh. >>>> To confirm, we would need to modify the driver to parse a new compatible >>>> string (say "snps,dwc3-ext-wakeup") and add .data field so that the >>>> driver is aware that this particular platform supports external wakeup >>>> detection.Right ? >>> >>> No, it's not then platform specific. You said it depends on each >>> platform. Platform is Qualcomm SM8450 for example. >>> >> >> Hi Elson, >> >> Use the compatible string of your platform. >> >> e.g. >> if (dev->of_node) { >> struct device_node *parent = of_get_parent(dev->of_node); >> >> dwc->no_disconnect_on_usb_suspend = >> of_device_is_compatible(parent, "qcom,your-compatible-string") || >> of_device_is_compatible(parent, "some-other-platform"); >> } >> >> You need to enhance dwc3_get_properties(). This may get big as dwc3 adds >> more properties. Perhaps you can help come up with ideas to keep this >> clean. Perhaps we can separate this out of dwc3 core.c? HI Thinh Apologies for the delayed response. Series https://patchwork.kernel.org/project/linux-usb/cover/1655094654-24052-1-git-send-email-quic_kriskura@quicinc.com/ from Krishna K, introduced a dt property 'wakeup-source' which indicates a platforms capability to handle wakeup interrupts. Based on this property, glue drivers can inform dwc3 core that the device is wakeup capable through device_init_wakeup(). For example dwc3-qcom driver informs it like below as per the implementation done in the above series wakeup_source = of_property_read_bool(dev->of_node, "wakeup-source"); device_init_wakeup(&pdev->dev, wakeup_source); device_init_wakeup(&qcom->dwc3->dev, wakeup_source); The dwc3 core now can access this info through device_may_wakeup(dwc->dev) while checking for bus suspend scenario to know whether the platform is capable of detecting wakeup. Please let me know your thoughts on this approach. Thanks Elson