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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (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 D3CF9C04FFE for ; Thu, 2 May 2024 23:39:49 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 90472DF9; Fri, 3 May 2024 01:39:37 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 90472DF9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1714693187; bh=ScmNimVD55HCJMpU1ZPTM6tr5t4G+wAg/gscjQhbxFA=; h=Date:Subject:To:CC:References:From:In-Reply-To:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=Ndqx/tPY2i0eMY0/Lx+dRVZcOgOXJNMntiLiIkUsU+LckUbIyRygFlWK2RC6cpRyQ IbbN0Yul8tG1bbALe1s0Kr9/gRUnWluVtrqtL4xiYRoSrxwx1MHccm+xn+rB9jgh9F Vf1R4z2r5BdYMYDRumMX5i68Sfet/TRlyuxUKq4M= Received: by alsa1.perex.cz (Postfix, from userid 50401) id DE0CCF805A9; Fri, 3 May 2024 01:39:15 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 94B32F8057A; Fri, 3 May 2024 01:39:15 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id D667EF80266; Fri, 3 May 2024 01:37:33 +0200 (CEST) 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 alsa1.perex.cz (Postfix) with ESMTPS id 51125F8023A for ; Fri, 3 May 2024 01:37:19 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 51125F8023A Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key, unprotected) header.d=quicinc.com header.i=@quicinc.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=O2/n/1nn Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 442NKMxO019950; Thu, 2 May 2024 23:37:17 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=yRahZediyJwd+8tFnCwYNOlw++FRljCtETICqi0KlLs=; b=O2 /n/1nnkgzSroG5Sq+vOV2/J4HinUGZrLvxhaAONmKDPAQOgn9WUHzYJPDSt0QYpA EFUBbWzML+H3epFcUwj3FPH+XY3XjvGnlqYZZUdT05ll8lkzvQkzcQdbtVJvhIcQ YJqojw/vXeRHVRMBF4PLrTuWePYkHVoANXOTSTHaHMSJBazzvDgUYC6aRbwUI5kQ Wt1zKVXPuZct2q7KHJ2bBtEgVwdE5ymRVmlm+HadKZxLHG5/x+o+bsf7vNaLJzn8 2aNjbYa+m2DaOOVxzlxaM+jxAL9qlvYSUmeePIy/D5uN5iKmvR3EcsIgRPeTWIyT qfyHgkPnafCjNKbG+rUw== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3xvawbhapu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 02 May 2024 23:37:17 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA05.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 442NbGor013135 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 2 May 2024 23:37:16 GMT Received: from [10.71.112.114] (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.1544.9; Thu, 2 May 2024 16:37:15 -0700 Message-ID: Date: Thu, 2 May 2024 16:37:15 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Subject: Re: [PATCH v20 06/41] usb: host: xhci-sideband: Expose a sideband interrupter enable API Content-Language: en-US To: Mathias Nyman , , , , , , , , , , , , , , , CC: , , , , , , References: <20240425215125.29761-1-quic_wcheng@quicinc.com> <20240425215125.29761-7-quic_wcheng@quicinc.com> From: Wesley Cheng In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) 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: RmyOpgti89lDhFfWlfBLnFZdjZ9mBcru X-Proofpoint-ORIG-GUID: RmyOpgti89lDhFfWlfBLnFZdjZ9mBcru X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1011,Hydra:6.0.650,FMLib:17.11.176.26 definitions=2024-05-02_14,2024-05-02_03,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 priorityscore=1501 impostorscore=0 lowpriorityscore=0 spamscore=0 clxscore=1015 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2404010003 definitions=main-2405020159 Message-ID-Hash: JCKQVOZW5K6IMTY43IX26LYS2TDYNWD6 X-Message-ID-Hash: JCKQVOZW5K6IMTY43IX26LYS2TDYNWD6 X-MailFrom: quic_wcheng@quicinc.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.9 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Hi Mathias, On 5/2/2024 4:07 AM, Mathias Nyman wrote: > On 26.4.2024 0.50, Wesley Cheng wrote: >> Some use cases maybe require that the secondary interrupter's events to >> be handled by the OS.  In this case, configure the IMOD and the >> skip_events property to enable the interrupter's events.  By default, >> assume that the secondary interrupter doesn't want to enable OS event >> handling. >> >> Signed-off-by: Wesley Cheng >> --- >>   drivers/usb/host/xhci-sideband.c  | 28 ++++++++++++++++++++++++++++ >>   include/linux/usb/xhci-sideband.h |  2 ++ >>   2 files changed, 30 insertions(+) >> >> diff --git a/drivers/usb/host/xhci-sideband.c >> b/drivers/usb/host/xhci-sideband.c >> index 255feae33c6e..6fdae9840c11 100644 >> --- a/drivers/usb/host/xhci-sideband.c >> +++ b/drivers/usb/host/xhci-sideband.c >> @@ -237,6 +237,30 @@ xhci_sideband_get_event_buffer(struct >> xhci_sideband *sb) >>   } >>   EXPORT_SYMBOL_GPL(xhci_sideband_get_event_buffer); >> +/** >> + * xhci_sideband_enable_interrupt - enable interrupt for secondary >> interrupter >> + * @sb: sideband instance for this usb device >> + * @imod_interval: number of event ring segments to allocate >> + * >> + * Enables OS owned event handling for a particular interrupter if >> client >> + * requests for it.  In addition, set the IMOD interval for this >> particular >> + * interrupter. >> + * >> + * Returns 0 on success, negative error otherwise >> + */ >> +int xhci_sideband_enable_interrupt(struct xhci_sideband *sb, u32 >> imod_interval) >> +{ >> +    if (!sb || !sb->ir) >> +        return -ENODEV; >> + >> +    xhci_set_interrupter_moderation(sb->ir, imod_interval); > > Is there a need to adjust the moderation after initial setup? > > If not then maybe we could pass the imod_interval as a parameter to > xhci_create_secondary_interrupter(), and avoid exporting > xhci_set_interrupter_moderation() > > Let me preface my comments by saying that I was trying to include some aspects of enabling the secondary interrupter line within the main apps proc. If this gets too confusing, I can remove these mechanisms for now. For example, as you mentioned below xhci_sideband_enable_interrupt() isn't going to be used in the offload path. However, I decided to add it so we can have some corresponding function that will utilize/set skip_events = false. (as it is "true" by default) Again, I can remove this part and revisit later when we actually have a use case to handle secondary interrupts on apps. As for the IMOD setting, depending on what you think, I can add it as part of xhci_create_secondary_interrupter() >> +    sb->ir->skip_events = false; >> +    xhci_enable_interrupter(sb->ir); >> + >> +    return 0; >> +} >> +EXPORT_SYMBOL_GPL(xhci_sideband_enable_interrupt); > > I can't find the place where xhci_sideband_enable_interrupt() is called in > this series. How is it planned to be used? > > Thanks > Mathias Thanks Wesley Cheng