From patchwork Thu Feb 8 23:13:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wesley Cheng X-Patchwork-Id: 198676 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp518097dyd; Thu, 8 Feb 2024 15:35:08 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCWc6gEHomBFBJCMiigvO3PDGZW4J3GwGYNMnX+MGLY4xWmntp9MdhoIZMt4KeXV6Y/4jDlytaU6P1A+AGWUQScSZ932og== X-Google-Smtp-Source: AGHT+IHeA1fV6a1Up2CJVHyc4gLc/rmLwjMS856vHnNizh7T992ClxoAqti4sfDd1pA+yn6KkqjG X-Received: by 2002:a2e:9c82:0:b0:2d0:7b53:9330 with SMTP id x2-20020a2e9c82000000b002d07b539330mr48614lji.14.1707435308043; Thu, 08 Feb 2024 15:35:08 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707435308; cv=pass; d=google.com; s=arc-20160816; b=cSrEQX9tuJagOL9zNYlv08OS2y7cTjYBMPb7Io9Ecxuy8LzmDxp432qirDdP5c6dlO rk7aXO5PJugFRm5Ffst4+ebWkeTJKTZOfk8tzsySG05NpU58gPAoVEZT6sKRSYv7nxtP ZeH6xtp336/K6k2nHUtELgH05z6eFQFNLDngmDBY7YRnW5G8K0TUgNWyVxPXhKiS1oMy d5DIHyCzSoZ4HnriIjDx+2Xue3JWgl+msHEDHOBk+/o02eR6ZqFE6zCFDzv9LtIJwlO4 35zHSqjUOCDGvxqTMNIfbmWwlLSvS61PAKNfv9XuwzgnQtHF1cy1COy7DzulAEpWdHht OmTQ== 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=w8F/tWePn/EzRhFyfZm7Qljv1VxMYxdrW55pZYxx5mI=; b=ykaM64UtABEMkQOMBEAyEI9uekzUCgCO3C+oWp3RiG8XkVKo/AX9zmBvwoIQQVHwle ij5FWBzG+CG5TJaKYO+BXyswa24ponTcHPN4TSUkbg+BRoDLBRDwuzSock4t+d7ko4Aa jIHkltM6QkVAGh7BujJsPhA/4C+VE33EKahCPnjh364lJC3kPzHquHY/uH6ZS/9S9ZGZ 4/zDP1aj1fgyXBkVIyMJoqZJgJ1BAQMDLcRCZCLLD4HAC1xvFIuX0s28NY0hZNap7M8p Z6LWX36sCs3ksvv958AJAzQvsyew3zf0b295k8YtapCmMsrrIuLPr8pMf8AiRVerBfU+ 0EZQ==; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58855-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=2; AJvYcCWsenwBiYe61JyqsEVvhjknbfRbOfH/o1d53aUoRH1EipNsp/I+gwBERpHpQGLnTq3PUwJ1QEC+wzEYV+7n/DX9DTkG5Q== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a3-20020aa7d743000000b0056117e168basi202049eds.621.2024.02.08.15.35.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Feb 2024 15:35:08 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-58855-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; 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-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-58855-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 86CD51F24766 for ; Thu, 8 Feb 2024 23:35:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 96EA365BBE; Thu, 8 Feb 2024 23:15:14 +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 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790375685504246633 X-GMAIL-MSGID: 1790375685504246633 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);