[v16,12/50] usb: host: xhci: Repurpose event handler for skipping interrupter events
Message ID | 20240216035923.23392-13-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-68015-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:c619:b0:108:e6aa:91d0 with SMTP id hn25csp287147dyb; Thu, 15 Feb 2024 20:12:41 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXpSyNjGohpMpi7IGkW8Eb3WO21HUPq5saopj7C0C5ql8NYECtEBadoSm91mWT3loUhjG9bcsNIQXJtPUODhzeIONy+vQ== X-Google-Smtp-Source: AGHT+IHzy9XvBK4DY18NmSoZMZddSbNHIGaFGGi5XKtsy4PD3XiurJRg1P3+lkHW2XDvXHm/Lah2 X-Received: by 2002:ae9:e64d:0:b0:785:cad6:c3ba with SMTP id x13-20020ae9e64d000000b00785cad6c3bamr6196538qkl.15.1708056761599; Thu, 15 Feb 2024 20:12:41 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708056761; cv=pass; d=google.com; s=arc-20160816; b=rUlbufl/mtOKRa8BNRx+azkxOr0YC1KRZi2p4N3fR0WZWRB/khGY0uo6/mXrqxVvLC QcLMTzWjroC3NAcesMuR+OWm3xCZynCMV1QrJjOsHslRksDDB178I8jmc0tD2SNk97Fx q9g68iRn72gLJ7Vr/1IGxDCBKaSdz2SZ4nff4SlM5gU2P09mGs0A7SOmRkLR0aoCoI9T CcW1av9w/FRPaZiDitR/wYsjXF69oQoseBMq/PZLcf3XHmMkp7/SW0ibdj9z7OTreqt1 +pGVlPget8u6I8CblXmdXDKQptsWpeBOBbLn0DvbMgPa2+QYyBiWaJSVdmr0rAops0F/ cO3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ft8ascdYDoVxl0EFVL6aRCJwWuDIAtRtIjiBqTLb+n0=; fh=VKrp0Y7I/+wT36BfKZ6oI/4N9BIwFCn9zerObkOrgGw=; b=NWLwfRNiCgYoy4BsitrgTGBOmSm7aP9zyf5pmnx+eOkTVz3SQATc3o3C1NbXcHtPFP Wklw3/5B+EH8lYwMrpXu6+uPrBDYmjgg2zU8755s7xmL29M6VKzv8ye7QkC3AWg2sJIW pGgBwi1mzgaJzMjdXU6U/4ufm9OpfV5aTUhl+1X2GxQ4M8Kac9gIxhUCHUYWenMWj5Pq 9aRrSAwfHI0KfTKiY8YuZyZ3OX4s/wg/hd/Mn4uKafqJb+LTIYeiz3Z3YR5k/rGeTuTs 9u5Gzg//3GM1DQIny8azS2IOsLjn4BroJXObQvEXTnmGWylZXBx1fdbsCAquA1YecY24 nHfg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=pclAooid; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-68015-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68015-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id dv20-20020a05620a1b9400b007869b731884si3607510qkb.458.2024.02.15.20.12.41 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 15 Feb 2024 20:12:41 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68015-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=pclAooid; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-kernel+bounces-68015-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68015-ouuuleilei=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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 51DD81C20D49 for <ouuuleilei@gmail.com>; Fri, 16 Feb 2024 04:12:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 261F74C3CD; Fri, 16 Feb 2024 04:00:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="pclAooid" 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 A64DA17BBB; Fri, 16 Feb 2024 04:00:00 +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=1708056003; cv=none; b=UVRw9RipTWGOHFBUHv+fmC355Pimiv6arFXHxGd9OXvBHvICgTnkNubQqlCgCqGfubRw1ztNGMI8xFIXYHmMbUbKjQywt8qLWqiELGcTNFqV//gvHJ1fqATxSxmXWnUf9t0IJmQODOoS3gLAeAfKCwdGffT06f3aUAOq68BojqQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708056003; c=relaxed/simple; bh=74+W930K1wkGD35+UeXg8QjQl2pzz0ZzdVdyKeRWWQE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tFKDgUgta7SyJpYlLfA2tusDaK+ROHTKFMkj2zzd7Q8hhirpU9qJXKSLGTTbbGJKvUCXeoIuvCjq3DngCeLLmjpSoN7Dfu8IOKYua8Dx5JK6VhxDF3Tin3aPrrmltQu0ZqK2lJ5XzD/GnY0CeM3QT5z781rZG9DVNNZU+o6DP+Q= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=pclAooid; arc=none smtp.client-ip=205.220.168.131 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 (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 41G3UYU9009006; Fri, 16 Feb 2024 03:59:37 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type; s=qcppdkim1; bh=ft8ascdYDoVxl0EFVL6a RCJwWuDIAtRtIjiBqTLb+n0=; b=pclAooidF2zZ+YPVTHv/oqSWBcD9AGT75Uh4 reRHp50UFBxoY6bSihfrnak14VJLCPwzl+iO2LoDzKGwylm6zMd005NaRHYMi+4A h2+DteIF3XMTtOR2p8UiTZp4BRqaIK9vj6NKH8q/b3OKH06Etw7GNbOUA1XLeaUG 2gdpGhiKRp6pvGHpWBq8sGHyZtNxcuUW4qzAOo1DP/iUoZaIA7FoeBhJBJsV9TRW EuSA+roC0T+qK+l8rKRoUJWfUpyCaoxfgOPTUW8YbOTIDs4U/1fiD/J5YpQTI1X+ 7ZpL43Sykiu3ynOFN/9osGRKL56VVzfI6WzVmevTm6zpk/bi5w== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w9yta816t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 03:59:37 +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 41G3xa2Z020525 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 16 Feb 2024 03:59:36 GMT Received: from hu-wcheng-lv.qualcomm.com (10.49.16.6) 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.40; Thu, 15 Feb 2024 19:59:36 -0800 From: Wesley Cheng <quic_wcheng@quicinc.com> To: <srinivas.kandagatla@linaro.org>, <mathias.nyman@intel.com>, <perex@perex.cz>, <conor+dt@kernel.org>, <corbet@lwn.net>, <lgirdwood@gmail.com>, <andersson@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <gregkh@linuxfoundation.org>, <Thinh.Nguyen@synopsys.com>, <broonie@kernel.org>, <bgoswami@quicinc.com>, <tiwai@suse.com>, <robh+dt@kernel.org>, <konrad.dybcio@linaro.org> CC: <linux-kernel@vger.kernel.org>, <devicetree@vger.kernel.org>, <linux-sound@vger.kernel.org>, <linux-usb@vger.kernel.org>, <linux-arm-msm@vger.kernel.org>, <linux-doc@vger.kernel.org>, <alsa-devel@alsa-project.org>, Wesley Cheng <quic_wcheng@quicinc.com> Subject: [PATCH v16 12/50] usb: host: xhci: Repurpose event handler for skipping interrupter events Date: Thu, 15 Feb 2024 19:58:45 -0800 Message-ID: <20240216035923.23392-13-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240216035923.23392-1-quic_wcheng@quicinc.com> References: <20240216035923.23392-1-quic_wcheng@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nalasex01a.na.qualcomm.com (10.47.209.196) 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: m6Im_4tIk4poKeocmHEcS4r9NLZlwycV X-Proofpoint-ORIG-GUID: m6Im_4tIk4poKeocmHEcS4r9NLZlwycV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-16_03,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 priorityscore=1501 adultscore=0 spamscore=0 phishscore=0 clxscore=1015 mlxscore=0 malwarescore=0 mlxlogscore=903 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402160031 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791027327021771878 X-GMAIL-MSGID: 1791027327021771878 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Feb. 16, 2024, 3:58 a.m. UTC
Depending on the interrupter use case, the OS may only be used to handle
the interrupter event ring clean up. In these scenarios, event TRBs don't
need to be handled by the OS, so introduce an xhci interrupter flag to tag
if the events from an interrupter needs to be handled or not.
Change-Id: Ibf482477dde9ca2f172d5d236ff5b7c87aebe947
Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com>
---
drivers/usb/host/xhci-ring.c | 17 +++++++++++++----
drivers/usb/host/xhci.h | 1 +
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index d4a28ac4967f..82c10a5ac6e9 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -2962,14 +2962,22 @@ static int handle_tx_event(struct xhci_hcd *xhci, } /* - * This function handles one OS-owned event on the event ring. It may drop - * xhci->lock between event processing (e.g. to pass up port status changes). + * This function handles one OS-owned event on the event ring, or ignores one event + * on interrupters which are non-OS owned. It may drop xhci->lock between event + * processing (e.g. to pass up port status changes). */ static int xhci_handle_event_trb(struct xhci_hcd *xhci, struct xhci_interrupter *ir, union xhci_trb *event) { u32 trb_type; + /* + * Some interrupters do not need to handle event TRBs, as they may be + * managed by another entity, but rely on the OS to clean up. + */ + if (ir->skip_events) + return 0; + trace_xhci_handle_event(ir->event_ring, &event->generic); /* @@ -3058,8 +3066,9 @@ static void xhci_clear_interrupt_pending(struct xhci_hcd *xhci, } /* - * Handle all OS-owned events on an interrupter event ring. It may drop - * and reaquire xhci->lock between event processing. + * Handle all OS-owned events on an interrupter event ring, or skip pending events + * for non OS owned interrupter event ring. It may drop and reaquire xhci->lock + * between event processing. */ static int xhci_handle_events(struct xhci_hcd *xhci, struct xhci_interrupter *ir) { diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 8908c3f5af6f..9039f234cf52 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1433,6 +1433,7 @@ struct xhci_interrupter { struct xhci_intr_reg __iomem *ir_set; unsigned int intr_num; bool ip_autoclear; + bool skip_events; u32 isoc_bei_interval; /* For interrupter registers save and restore over suspend/resume */ u32 s3_irq_pending;