Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp608613rdb; Thu, 8 Feb 2024 16:00:50 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXDSOLYf5UbzCuGmuu2qg/WpODF/E+8xkE6HM8ahQ3IjbVSSsC05ECpXeyhdB69O3tX97VYt/B1hatruvKHd7nmXzFXAAmoG0kV1vMKkA== X-Google-Smtp-Source: AGHT+IFbxRKfJKKDG2lvSd8vouw6vdAPmCIn3KsYf4TNyC0DM/6zheYcSJQFjnfTW4hNUKSqhIEn X-Received: by 2002:a17:90a:ff0d:b0:296:5e07:7a87 with SMTP id ce13-20020a17090aff0d00b002965e077a87mr894685pjb.26.1707436850049; Thu, 08 Feb 2024 16:00:50 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707436850; cv=pass; d=google.com; s=arc-20160816; b=JUDfZg2boMH/UNMnpVvAlRMVNkQlTfoQWcVXw+2Avuqlx5sdRcju0dQwg/JVOGTC5X PzlLPOE2eEe5w1G4LRX1dmIFavoWXkINtZDhyOuSkN/lZ0vvApKJnnobRNH4c3C5GRCa h4xQ6R23uvmPP7rV40wnOidfAY8c0mhaIaHixNXXLQ2O7GuQiQAw51iLrRyIhEK2rSH6 BC+kmHBfn4ScdIx4FLQo4Qh7KBFlygGClmRCrd3mcW9PwO9GTHG9oQ8Owu8cDb9fMj3Z qeFtsxBcMcMLNZAFwIsWpKw3El9Gdmv8Sw+8TN+sFt58rlGAN8IOkKD97L6mMWb53D1W RHyw== 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=LylXK/jrWURWDhUw7tH5hZ4ow+Xl5FX/mchvOMoIBg8=; fh=cYqoAjmBk9b1e5Qni39fWLfxZLBCyLIzjn+llJsJOHU=; b=L9HJKtuMeO8kkRIjQZ3FWKTkmuT+NbmRdCVxAPQd9fW3yr/BWMPvNAYARMX5zb1UdS 7AJbQwemfJ7/dd4e/taM4ZUp/kO4Uaolea5xN4HWSo3xu4u5xwaUS02LLkY+WbaBhXgB HD54Thxlpwd0z1h4eoDPWoFY9lvg7syOKYYIh8K46ezN7jpldkvV157gRyLhEpIKvPP+ 3ZLSkFsEgMiEE9xRvYqE0YvwVcR6ztEn9rYzAXg227OFhhzLxymvn0XDfd+LqlF0kUsT VhcqAf1xU3Nqvcgizar62l3sBG1d3zyKwudvX73kF+QVOIR3rN4/oXB885PdkUR1q95D IO5A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Dgv7Fqxh; 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-58855-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58855-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCXxWh4W/5PASw/JGt18dl4AnFNpqZIbSgRW6K+euP+SZjtT0CAa1G6uQl7PNBBi3dr8tpCQy2QUr2AaFGsh2MrhcMs1s8Ixv4boT1EZLw== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id ml8-20020a17090b360800b00296a72882c4si541580pjb.74.2024.02.08.16.00.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 16:00:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58855-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=Dgv7Fqxh; 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-58855-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58855-linux.lists.archive=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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 9F79FB26E09 for ; Thu, 8 Feb 2024 23:32:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 82E91634E5; Thu, 8 Feb 2024 23:15:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="Dgv7Fqxh" 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 190F056B87; Thu, 8 Feb 2024 23:14:50 +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=1707434095; cv=none; b=mhVEkABB6jTAlESxQHW2hFc/txQYpgPOtNHfY0SRbYc7MKvlIRSBErI0dC1ArAGBE1NXGn+I6iiNsXBtEnJu81TwX7/OOq/e9CBNPcm4cVO2NlUysLg1KqTtmX478ySw0QdWzNahO7pQ11/94GcDafy4yWp7pub4xGZRFs4BWsY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707434095; c=relaxed/simple; bh=CtxumE9xy8E75NV5EAWv+2S2i06ql2rIZ/FBzOnULFc=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=llOzd351yn+fVQSK6dxnn9F3+v+ZyU8wlliCW2IP8tASMz03YRtabyLPBkUT8wR0HrixeKbdwV5i44QDs53mrTjVl2xAFuH2MWEyKsrNHXuvkqKDTKcOMQD+h+rGIYq14TIUbYvPG48EXVgan7wJWzgVK0jbaxEFpIJQToJP5DE= 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=Dgv7Fqxh; 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 (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 418NEJIK030158; Thu, 8 Feb 2024 23:14:21 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=LylXK/jrWURWDhUw7tH5 hZ4ow+Xl5FX/mchvOMoIBg8=; b=Dgv7FqxhtH9f1RNYfrnZzcKUr8++SWiRRLP8 ms0TXMHN3an6XGgO3sa99LUPTBo2+iFLjTUIvINUnUq8VcKAYNoc/+4ytiHnUZ2I 1iI6FC4xZiLqHbNoi8B2d9Z1+LWn78RR4OBFQ9I7Wj8g4gobGhsQCqWhjfxrgnTB l4o13/ZEyCwlm02EhSJg9WvB8cD0bSHn/8PHSv6HctbEB4K7GFGmcfyYTflBmSus +Stmi9Z+DEov8NTy4bSFP2xZiK4gN+/4dnd7dnCBsPxVU8fdOAZIpKtKjMrIDtm8 autlNtiCK9jkYjz4PAWHWB9OwJnS1dhk8woTibP7gPoxardPGA== Received: from nalasppmta02.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w4hhkbaj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 08 Feb 2024 23:14:21 +0000 (GMT) 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 418NEKaT013111 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 8 Feb 2024 23:14: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; Thu, 8 Feb 2024 15:14:19 -0800 From: Wesley Cheng To: , , , , , , , , , , , , , , CC: , , , , , , , Wesley Cheng Subject: [PATCH v14 15/53] xhci: export XHCI IMOD setting helper for interrupters Date: Thu, 8 Feb 2024 15:13:28 -0800 Message-ID: <20240208231406.27397-16-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240208231406.27397-1-quic_wcheng@quicinc.com> References: <20240208231406.27397-1-quic_wcheng@quicinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain X-ClientProxiedBy: nalasex01c.na.qualcomm.com (10.47.97.35) 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: oraUR1R5Z0LoZynEoAQRSb_UxzRhPzRj X-Proofpoint-GUID: oraUR1R5Z0LoZynEoAQRSb_UxzRhPzRj 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-08_11,2024-02-08_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 mlxlogscore=642 spamscore=0 adultscore=0 phishscore=0 mlxscore=0 malwarescore=0 lowpriorityscore=0 clxscore=1015 impostorscore=0 bulkscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402080131 Utilize the xhci_set_interrupter_moderation() API to set the IMOD value for interrupters, so that secondary interrupts can also configure this parameter when clients request for it. Signed-off-by: Wesley Cheng --- drivers/usb/host/xhci.c | 3 ++- drivers/usb/host/xhci.h | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 834d8d160da4..d2ce1e1421e6 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -349,7 +349,7 @@ int xhci_disable_interrupter(struct xhci_interrupter *ir) EXPORT_SYMBOL_GPL(xhci_disable_interrupter); /* interrupt moderation interval imod_interval in nanoseconds */ -static int xhci_set_interrupter_moderation(struct xhci_interrupter *ir, +int xhci_set_interrupter_moderation(struct xhci_interrupter *ir, u32 imod_interval) { u32 imod; @@ -364,6 +364,7 @@ static int xhci_set_interrupter_moderation(struct xhci_interrupter *ir, return 0; } +EXPORT_SYMBOL_GPL(xhci_set_interrupter_moderation); static void compliance_mode_recovery(struct timer_list *t) { diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index ad9d93c645ad..d88d2f67e3ed 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1874,6 +1874,8 @@ int xhci_alloc_tt_info(struct xhci_hcd *xhci, struct usb_tt *tt, gfp_t mem_flags); int xhci_enable_interrupter(struct xhci_interrupter *ir); int xhci_disable_interrupter(struct xhci_interrupter *ir); +int xhci_set_interrupter_moderation(struct xhci_interrupter *ir, + u32 imod_interval); /* xHCI ring, segment, TRB, and TD functions */ dma_addr_t xhci_trb_virt_to_dma(struct xhci_segment *seg, union xhci_trb *trb);