Message ID | 20240203023645.31105-10-quic_wcheng@quicinc.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-50837-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7301:9bc1:b0:106:209c:c626 with SMTP id op1csp818149dyc; Fri, 2 Feb 2024 18:45:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPqmDPxtC6hG9uweVz5pPUYAhoBqlT/DaF2jiV7qHqDItEv1y5lFHn2Vo4TeAQFvffaEl2 X-Received: by 2002:a05:6358:41a2:b0:178:8a06:68e2 with SMTP id w34-20020a05635841a200b001788a0668e2mr10547329rwc.29.1706928345614; Fri, 02 Feb 2024 18:45:45 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706928345; cv=pass; d=google.com; s=arc-20160816; b=NygJcto6L5E9IXT3oQe/GDn+IwCPIJmKWxQU93YFg+niqIfTNLPEtJc45jLHWNbhtT pHGmp9sd6Jie0CtbJguq/GzGKAZwIlQ7jWFTqnXQKELKgoqaS0xabTKKgxQ5lauh2bCs nDYQophk7Qu+c4UTuoG6kKMvGYgreq/LY63J5hfk/xq/SLD1heZ68CuFcc+PjKybOAhp nBg3MV9Ub54Byz8Gjj2T0xrMHUtLyFimMrL3apzeS87ZiAzj+FnVNnKZtTZKHM6I+sbU bzSiufjrcdM9sgQjhi4yKghXuzNBbjXFBOnDxeWu2vt7aQVuQ8uOvqivtFKloFWm5flg j8mw== 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=v2ItLrNtk2j1QY1c2ABM7WgcR1ha0sOr3zVlmeNNouY=; fh=8V8x+0JrNNMZTtDISOZyGjU57e7Qom9M3us7jrv8G5c=; b=ElivgekugGYmMxKcmOi1prOoNO4ih6nIofL35iufQYCFdyCqq15x59g4lsI2I0PAEk 2UDm2Xt/2AZHj6F8pf3icoGGzptDB9354SMwuO5VIPFHVkURUsQ0Lnyd7LZnHLdnbpJ0 I34xu2HjE55D2VZHfflLnTYZvTz21OzKzswiyWf02tdJWxuSwkccY2Nvffm5WkfvIGOg fmVpiQZEA37rBfOAvFhHx5rhNkMk+XcveNheL8zP1D2P5S3JqaUquEtU2mHPD8cvwwwA oTeKm3Od96Hle2w9MSLyp6LzxM4SAUZAdtUedNVzxYFXDhQuyZnm2RcQQexEVKf9/KLY cGmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="l9y/jUNT"; 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-50837-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50837-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCX9xBFotDfA73Sc4RLHB98XUl22t8+HaXF1ksvubbNR1wydGNBDCp0VkHX9Ra3+UNqDgS/B2ge0x0mYrPe2c3qV5lKmJw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id o16-20020a17090ad25000b0028e6d898ff4si866922pjw.30.2024.02.02.18.45.45 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 18:45:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50837-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b="l9y/jUNT"; 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-50837-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50837-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id B441F283F35 for <ouuuleilei@gmail.com>; Sat, 3 Feb 2024 02:45:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6D8E3EA62; Sat, 3 Feb 2024 02:37:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="l9y/jUNT" 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 ECE72F9FD; Sat, 3 Feb 2024 02:37:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706927871; cv=none; b=qY7ztpwCIAFFWFjmxXm4/dGGL2QmuYABVXjGIscJiah5tMFN/9Notdw5v6JdCHfG0AgM79gv6K8TH/oX/yS0ZxuUoseVbQWO8656GWM05FOpdjz886rFBWOFBZukpq5S4EdKgIRp6pfMYyWrztMa3owJLpuNsQ2pmB6MAaNPldQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706927871; c=relaxed/simple; bh=httnPJJML5QlmnUl6L9g9SMmpTEhPWJw3rWiUQwkot4=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Y1OCbHDkr0gXtB06bQA/XBI+ZRMDkDmG/53+oJ7IU12C9GQOMii/H061/roNN3qYYYYNLRNlhK3c+uiNTxSnVpVIyvZUViGvyIEA/zSM4JFWaAK66A0ZWSBPZAv9V+ipRfyBFQqBr78tD9r7cqjJGMYM5FHvn/ZdRMMNqnfmFAc= 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=l9y/jUNT; arc=none smtp.client-ip=205.220.180.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 (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 4132XMvU022016; Sat, 3 Feb 2024 02:37:30 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=v2ItLrNtk2j1QY1c2ABM 7WgcR1ha0sOr3zVlmeNNouY=; b=l9y/jUNT63DoPLRKsb1GxPcjR1HysQSqs6dZ LKXjjjuoucCwUDKbt59xQcWX2+jP9IBBHz4QXJJPBXHAHbgnagS6BjVRErrEPs8r w2DMThMll+932rLA7cBr6mR15Ph2slTFKfpspmem5pXJYoBGmCw457+6+h8gj2d1 7v1TSWl+O46VmRCbEmm4qd6gfo8rECAfxttLNnaFwXCwWoKg57clqK3wPvfuNAUa /SL4ZPLZYRGYAZhHCZ4p4ZvmMJ3GvGOL6oQNYcwnd425qOIHZO9Whbjx6ez0fwrJ mF+heka358pCTXH1GXfzIGOZtx8us0rSXoLL977O+CUBbPr/oQ== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w1aus84av-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 03 Feb 2024 02:37:29 +0000 (GMT) Received: from nalasex01b.na.qualcomm.com (nalasex01b.na.qualcomm.com [10.47.209.197]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 4132bKNg008174 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 3 Feb 2024 02:37:20 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; Fri, 2 Feb 2024 18:37:19 -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>, Mathias Nyman <mathias.nyman@linux.intel.com>, Wesley Cheng <quic_wcheng@quicinc.com> Subject: [PATCH v13 09/53] xhci: add helper that checks for unhandled events on a event ring Date: Fri, 2 Feb 2024 18:36:01 -0800 Message-ID: <20240203023645.31105-10-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240203023645.31105-1-quic_wcheng@quicinc.com> References: <20240203023645.31105-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: nalasex01b.na.qualcomm.com (10.47.209.197) 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-ORIG-GUID: nApRDClHK246EveL6yVggJJjqeaYIKmj X-Proofpoint-GUID: nApRDClHK246EveL6yVggJJjqeaYIKmj 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-02_16,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 adultscore=0 lowpriorityscore=0 mlxscore=0 suspectscore=0 phishscore=0 clxscore=1015 bulkscore=0 spamscore=0 impostorscore=0 malwarescore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402030015 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1789844096498730158 X-GMAIL-MSGID: 1789844096498730158 |
Series |
Introduce QC USB SND audio offloading support
|
|
Commit Message
Wesley Cheng
Feb. 3, 2024, 2:36 a.m. UTC
From: Mathias Nyman <mathias.nyman@linux.intel.com> Add unhandled_event_trb() that returns true in case xHC hardware has written new event trbs to the event ring that driver has not yet handled. Signed-off-by: Mathias Nyman <mathias.nyman@linux.intel.com> Signed-off-by: Wesley Cheng <quic_wcheng@quicinc.com> --- drivers/usb/host/xhci-ring.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 338b6fddedc3..48388bc16b24 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -113,6 +113,12 @@ static bool last_td_in_urb(struct xhci_td *td) return urb_priv->num_tds_done == urb_priv->num_tds; } +static bool unhandled_event_trb(struct xhci_ring *ring) +{ + return ((le32_to_cpu(ring->dequeue->event_cmd.flags) & TRB_CYCLE) == + ring->cycle_state); +} + static void inc_td_cnt(struct urb *urb) { struct urb_priv *urb_priv = urb->hcpriv; @@ -2923,9 +2929,8 @@ static int xhci_handle_event(struct xhci_hcd *xhci, struct xhci_interrupter *ir) } event = ir->event_ring->dequeue; - /* Does the HC or OS own the TRB? */ - if ((le32_to_cpu(event->event_cmd.flags) & TRB_CYCLE) != - ir->event_ring->cycle_state) + + if (!unhandled_event_trb(ir->event_ring)) return 0; trace_xhci_handle_event(ir->event_ring, &event->generic);