From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.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 C90E62BEFFE for ; Mon, 20 Jul 2026 10:35:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784543738; cv=none; b=qG0QWOK2+PBLkR1kimODfycaFqT3PYz5dE0e43hmPlJG7yxd0nbSr1TyzDhWH4tikCCLlWKfNmbnYsvSBYbMr+jxYX+nNp3ZDkobVd0JdfhEBIbYuBn0YzL0ATLibkr4i6gJm9mZ6QKer6UbdS8ZaeE7AxLW5K9x6/uYLmC5RAg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784543738; c=relaxed/simple; bh=gS52Jb9Lr4yRWxZraCQvcHHB+nkdhUanDAxrT4OUIS0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=mahhraRfnw+P57s2DLKa/brf09JwAg/lSJJWRsb4lz6Aty2ifjR7mYp5XFNS/VPZcrlCaDQQgmVXnf4f87SaqNqBgpPH9aLmY6zGYEIcIPi+y22pNQCKehpNsyLkmduI4VljQTUEB7UkigYAREveo2XFCf+VITfT/bxHUbJQfLQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=UjT+1A5+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=O0BOOtXV; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="UjT+1A5+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="O0BOOtXV" Received: from pps.filterd (m0279864.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66K9vkmF1773497 for ; Mon, 20 Jul 2026 10:35:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= gS52Jb9Lr4yRWxZraCQvcHHB+nkdhUanDAxrT4OUIS0=; b=UjT+1A5+QV94i2BB 8R8IY0JjmldJqgx3Pu18ee6N+fPINGEqIqqjeKY6xVDuppQ1cRi/QGnT7Oq5a+b0 HE2ATAoz6ACJuErlb1hwHcs/XMN17KTyDzoWMYmcqmnLE+aY0zb0FJRQic5wJwcW vRtAGqUxc3Xy3WaFAKMIz7fR9AIORfds2W1Z3atmRVJuszVSgzwMC0yoz6uCOJzg gv5X79MUb4qcdK0innH/fJ9sEi0FWxGKVFogslvnlqLRpCeSCKJu1QnETUCpV09I 1/dQpo3L87YLm7MpomOw5QfBsD6QrSiP1AZc6jOtl0pkkpgkS7e1xKVwzmkyffPc cnUVGw== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4fhgs50b41-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Mon, 20 Jul 2026 10:35:35 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2cee1ec30f2so91498945ad.3 for ; Mon, 20 Jul 2026 03:35:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1784543735; x=1785148535; darn=vger.kernel.org; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:from:to:cc:subject:date:message-id:reply-to :content-type; bh=gS52Jb9Lr4yRWxZraCQvcHHB+nkdhUanDAxrT4OUIS0=; b=O0BOOtXVDZuKF5cvBUV9qABo7nM1oNQCr4pdTEs4WJ3F7o4JmXzBqWidOgRA3Rfhw5 ICH7ZmEBUJHsO+k94ONrInKgPr0w01mPONvx+waurmUWfhL4JfNCtIYuGPxsPvrRHDlw LaRkr8hfOhkHRQpxzUUHjcfzPixTb5mRQTrwZbhTC9sH1AZGpW66pec4AZSN0ZY9r64W g6vBeOSfEgLhLyYDZmt09l2d+Y1iyP6iAnN0CAMTy1a8hLK52wKhOM9cGy3K/kHuhP+k bqKZN6WdI00tm/UZoP4+ntlJc8cpCCZ7rDUSCzXc88Uu34v/9SFze9f46me0Hk3B1bXV 3AiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784543735; x=1785148535; h=content-transfer-encoding:content-type:in-reply-to:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=gS52Jb9Lr4yRWxZraCQvcHHB+nkdhUanDAxrT4OUIS0=; b=VwMHaFG+csqMXW2mISdCv3dJ6Amcf6J6ht7rBzeGi0tlzih/+nRUCdDjfARQ0tukxM vbZJaoYqNai//1R/WIJ5Z+HyvBe/2+ePh+Z10OiEvKXmGESX5DLIrOv5fuWH3Ssux7Yd teGFmGVEjLPEc2ryxZglZ7Ib0ga3DwnzNwON46UNzagocck9Sd7bM+S33HVQw0POOYGL 1ozm9jfwje4BHA2NZBNL6R0ojk58HKD0hJwOIeg5RkDUvwhEyKOZzNLPUi7EenqkWYE2 n7zEOL1kxn508ausTdlYTjvwkYnj5TCOe65DdgwMkwObHeJTUT0Abv7wM5rlJFI3ZshW 2mUQ== X-Forwarded-Encrypted: i=1; AHgh+RrpiysrcDWFy0MMLnKyN0Gtkr+zKI9DjInS7UDLTgXMSvLGaQy/mPthIRLvMr8Gu+OmLiFUqnxLKrxxmG0=@vger.kernel.org X-Gm-Message-State: AOJu0Yxgi490s40b1J76evmLqP1SO4ljSbr681M3/h2o3/PHAX9oGSG4 DjF8ayO2R8pEJQS5fL5Ux7XQLFXKr2ojqo3ha4Fl0Ub2sg4/SiVQHUAaD1kZzWsqCMLKFUlrxu4 9YLAenEXZD9+rKSgHfZDoxzoaB0LqSuRk3V1Ig7hapHCpKoRlDLJ7yJNwj++uVRqMxew= X-Gm-Gg: AfdE7cmWf2IwG04c1HzINggXiQUoomBz7Tg8Lob+B5mGEIKFpHwe0HVuOuYqOZAaLZ7 yB7GqPWjgL6BUEjssEDcZinMozP5Vgy0bfbWBvqMkjSGvARrz6kKciuDUs9ngMdPKFS4KrGSfR/ inVCTqA/kqh39PQJl68MROeeB+emhtNHQgV4M7ZRmCnGRBZnZGUf3ypJBUV80HUBrPNa1Jzk4rO DkTSgI1DYvgfJF8LkUfBaAZE6k27tzVoLShvk5p5Vp1di9h46snHqRZn4CMgaJIoRWfFP5MUb13 4cqzTbZ/lLTy0uCE7qwPwVy5Di7PLF0n3aTR9F+DLk/6W+DhrZS04oraJE/+K9RSBe1poxIKK98 jg8/SCKYD7DHDP30A7KQrWpPobyM2h70sm3uoV6ULNjRqg0zVUj3a0q5ky5Q0wT/buKHkNGNT X-Received: by 2002:a17:903:1b0c:b0:2c9:e5e6:8621 with SMTP id d9443c01a7336-2cf3496bdf7mr142578815ad.25.1784543735153; Mon, 20 Jul 2026 03:35:35 -0700 (PDT) X-Received: by 2002:a17:903:1b0c:b0:2c9:e5e6:8621 with SMTP id d9443c01a7336-2cf3496bdf7mr142578485ad.25.1784543734602; Mon, 20 Jul 2026 03:35:34 -0700 (PDT) Received: from [10.133.33.169] (tpe-colo-wan-fw-bordernet.qualcomm.com. [103.229.16.4]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2cf3448f614sm53959155ad.5.2026.07.20.03.35.31 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Jul 2026 03:35:34 -0700 (PDT) Message-ID: <9c648fca-b55a-48c2-8fa3-27083c03e826@oss.qualcomm.com> Date: Mon, 20 Jul 2026 18:35:29 +0800 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] rpmsg: glink: Split protocol start out of native_probe To: Konrad Dybcio , Bjorn Andersson , Mathieu Poirier Cc: linux-arm-msm@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-kernel@vger.kernel.org, chris.lew@oss.qualcomm.com, tony.truong@oss.qualcomm.com References: <20260618-rpmsg-glink-split-protocol-start-v1-1-c4f93986cdb4@oss.qualcomm.com> <43293037-99bd-457a-b190-31fb24625b1c@oss.qualcomm.com> <0585ee18-5bd3-424b-93b1-eb841c26b63d@oss.qualcomm.com> <2be76246-3430-4f76-b6a9-11de39a961e7@oss.qualcomm.com> Content-Language: en-US From: Chunkai Deng In-Reply-To: <2be76246-3430-4f76-b6a9-11de39a961e7@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Info: AW1haW4tMjYwNzIwMDExNyBTYWx0ZWRfX8DUS/oOMMOYk V9YTqPceJ3qcHrsu4JH2FkYsz7jwAuwD0T8R/LCVw7P5BgQYM67wu+2tlEKzj4OqanRrTtT+fFz Joj7O0fAcpHRlTA1kKsWB5nj62pJlM4= X-Proofpoint-GUID: LoLAWZG5r0e7YFqm3ZdSLfspva12H7TP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzIwMDExNyBTYWx0ZWRfX5/msnoeZThKF nbTxSJhXZxm+iezQTZKqnSaXDFgaumOX0V3PgRNmT1n8MbMmU1Z6RbCaj4j/VwN3vqyQDGgY6Pq rxSRjd4jetKcr1uIYf0IeEmUfC0qegVrQ70GRJCUcwiseUvum/tOCnBya99FQAysxRfXCKQnpbU /YFw0Fxr2me2tJfsG4i09fMcgtGlLknHbtjJpv8g7GlYapyqzQhB84OIKT74eyOssNYMjRQ/mRh 2Rco3cVfSFxEuUkSt+E8a9cWVWRBvOORYpBsORNfmBiLaGwEoV1fGjyGbs8t3BJFL20kneFtxsP a6R7geDlWx2qLzs1oYBdp2/uy76kyiAC92M/+4FbXUw7FHV4GO2AooatDgEAkqOiHEODcfSqnXq pmR+MGZrDcweKHB+F762mUrfsv5AtszCKALkZtayf4Zazx9Y1Cs7hGMIbGz4AM1aP29lxfs0Tkh Dmm5r6k/xeTiKOx0azw== X-Authority-Analysis: v=2.4 cv=CpiPtH4D c=1 sm=1 tr=0 ts=6a5df9f7 cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=nuhDOHQX5FNHPW3J6Bj6AA==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=DJpcGTmdVt4CTyJn9g5Z:22 a=EUspDBNiAAAA:8 a=X5oELPwlFjtDxv7hUZQA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-ORIG-GUID: LoLAWZG5r0e7YFqm3ZdSLfspva12H7TP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-20_02,2026-07-17_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 priorityscore=1501 phishscore=0 spamscore=0 clxscore=1015 suspectscore=0 lowpriorityscore=0 impostorscore=0 adultscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607200117 On 7/17/2026 6:54 PM, Konrad Dybcio wrote: > On 7/6/26 10:59 AM, Chunkai Deng wrote: >> On 6/29/2026 8:47 PM, Konrad Dybcio wrote: >> >>> On 6/19/26 7:01 AM, Chunkai Deng wrote: >>>> The SMEM and RPM transports request their receive interrupt with >>>> IRQF_NO_AUTOEN and enable it only after qcom_glink_native_probe() >>>> returns. Since native_probe() sends the initial version command, the >>>> remote may ACK before the local IRQ is enabled, stalling the version >>>> handshake on a fast remote. >>>> >>>> Split the protocol start (qcom_glink_send_version() and >>>> qcom_glink_create_chrdev()) into a new qcom_glink_native_start(). >>>> Transports now enable their IRQ first, then call native_start(), so the >>>> version ACK is guaranteed to be serviced. >>>> >>>> Signed-off-by: Chunkai Deng >>>> --- >>> Would it not be simpler to just move the devm_request_irq a bit down >>> and remove the NO_AUTOEN flag then? >> Thanks for the suggestion. >> I analyzed and verified it locally,but I'd personally still lean towards >> keeping the current change as-is. My reasoning: >> >> (1) The IRQ must be live before the version handshake — that's the core >> point that can't change. The version command is sent from native_start(), >> so we need to request/enable the IRQ first and only then call >> native_start(). That ordering is only possible with the version send >> kept out of native_probe(), so the split needs to stay. >> >> (2) Dropping IRQF_NO_AUTOEN does make the structure a little simpler, >> and functionally it's equivalent, but I'd lean towards keeping the >> request-disabled + explicit enable_irq() form. It makes the ordering >> constraint visible at the call site: the IRQ is requested up front, >> and enable_irq() marks the exact point where the handler becomes safe >> to run(glink assigned) and where we want RX servicing to begin. Folding >> that into an implicit auto-enable hides that intent, and I think the >> explicit form is easier to maintain. >> >> That said, if you'd prefer the simpler form, I'm happy to do the IRQ >> cleanup as a separate follow-up patch on top of this fix rather than >> mixing the refactor into the race fix. > Please don't paste AI responses into your email client, there's a human > on the other side.. > > If this patch was also created with the use of a coding agent, it must > be disclosed and follow the rules established in: > > Documentation/process/coding-assistants.rst Understood, and sorry about that. I'll pay more attention to this going forward. I did use AI tools to help with some of the analysis, but thatwas my initial view from the beginning. The potential issue here is that send_version() run before the IRQ is enabled. If the send_version ACK arrives during that window, it may not be handled. While removing IRQF_NO_AUTOEN and rearranging the devm_request_irq may simplify things a bit, it doesn't really address that race. Thanks, Chunkai Deng