Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1429296rdb; Fri, 16 Feb 2024 16:16:40 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX7ltM/ASHixajLOcWMjnxaL8328dudyFwNai5ULl2m/nRsgU8ePCoJ1KWR3qTPN6MHMIhBgpPCXioRYMYJs9IhFmAl49AyWqvt1Tvmlg== X-Google-Smtp-Source: AGHT+IFrfcfipkyrK2UxQuZOefTbh8kZ1hzJg7IXsdeRaopjUaKUcsZhtlxWNlotAKNEcOz5nU1Y X-Received: by 2002:a1f:ca06:0:b0:4c0:6478:4b7 with SMTP id a6-20020a1fca06000000b004c0647804b7mr5909107vkg.16.1708128999874; Fri, 16 Feb 2024 16:16:39 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708128999; cv=pass; d=google.com; s=arc-20160816; b=bigyHcho5tSc4Zm3I+cmCIIsGqRMs40D1mq9zqn/1xApGoKNo1vgSqQtPfhtv63Pt5 P5qUJGDUfGDs7eQNMglaMMetM20NPftn2n1nx/oeY2xUZvNxlJZB3rKbyIF0Udbex7YW qGmY/wlGrAHKoHbywk4+fA+4nij+1hKUmGKESWeLwE5soeyV+om1e/d1AJ6DaSN6PZ8n rEnzm77YLKcABBmzOtR6UOMljj+DKOPVTgC7yiE8DB9ponz5kwYneBMLcat72GbeLiyb 4gVkHpJTYA5qn8J3In34Mghiukc9K/A1cDw7X6wuQl0jqmcJQzzX2KWtbRQ5svjbzrwS pvRg== 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=hP3Dy860dLQ9yKYDrQhg94kIWgx1+3NOAWbDKxKPxWs=; fh=VKrp0Y7I/+wT36BfKZ6oI/4N9BIwFCn9zerObkOrgGw=; b=vKhTOFJcKSgN6jkDqanGTsmXRxjEYACX+EwsSrZfSQqdfNGPSQbeQDlRZ7Boyi20os ++9Jtbu+WiC39FfPAERNRc+0lY16p5B4ElffXHEreHPCid6DMmOXZGbUEtEJkRjub/1y k7qV0UtZsibUIec+WWH3qs12fwTg0MpSVRlErzDNdvMzdr8YW2NSn/xPyhJ9QI4ngAQm dLeKWIngz9Nj8YuITz/smZ2yVX/vMYtUdvlZyMbZnCTj98W1Rdu5SrMRz5WeZ812Ll3Y aj4qFuz6UfxBJ0wsyggGwMTAguGgPEqlJNISgMJa1AWX5c5YS5f2T6sranOVTDF5f0pU jcWA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=p3uSqiq2; 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-69534-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69534-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id gw5-20020a0562140f0500b0068d081aca19si1017010qvb.282.2024.02.16.16.16.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 16:16:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-69534-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=p3uSqiq2; 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-69534-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-69534-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 48D241C23844 for ; Sat, 17 Feb 2024 00:15:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 18F8B55C26; Sat, 17 Feb 2024 00:11:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="p3uSqiq2" 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 7C48E5C8B; Sat, 17 Feb 2024 00:10:52 +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=1708128654; cv=none; b=lpnfGjdR5KPHykvRKlGpDx0IInw9/7yHVq3jWcGiI8aOuiBcTMXlrYe3OuvgKTVrgpbeSWDxOBGjLfHvXF5fjfqFmht1z/DaexTcgMcYF7lM8ElrWGTq1mQbippGxEwEMSp2xCisU2lcSoK+w7GMa4R/Un17L6Nw2Wi8RkaeAHQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708128654; c=relaxed/simple; bh=q7zkNjeVjlvi8Zzo5h3Qzp59mUx4EA1dyovBNof5Slk=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VsJi/R5JSGFQgJ5IyxOqZtt6brHl5yjASxq5C1Sd5zqEbPN+M/ZZb6T3mZIBVuBqUPAi7GMJHc3SmhqZZteXFcjjas3Sq4w/bJO7yPCXF1P3rNiYC/yCza1gkPZgdr6sSXk1z8KqPqH5WQZ/jHIkz7ndG1opfTbtJjnp5+rC0rE= 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=p3uSqiq2; 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 41H0AW1o004012; Sat, 17 Feb 2024 00:10:34 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=hP3Dy860dLQ9yKYDrQhg 94kIWgx1+3NOAWbDKxKPxWs=; b=p3uSqiq2uju8VrhRERvwbjGJVlv9XoMkmzw2 ZhOteSLu9jJmKfDxZXZFSHtAqHeya69ZoRiqQVHuml962U5SAti7SRYBC0vLCRS3 RDntuAsvbZFN1+I47BYSbs5yaIZEogQknxxUXgNWwOSoHxsUUOkGTaxytifjLUYi aqAiUyFh3M3ftqqM6xDDPEC4sOzPq3YjXLEKHD5YrAbmYmtcIJ/lNBkC2/qXooJz Szwr3nBDUjMKVLhE0lb75kcNl5DZrILrGfa1R8TjhvayFGUyjzjub1Wbawn5yhnF wySvugdjJ2JEraX/8cf8plr0ZunfsmjU3MFWchwU58IjSTxoxQ== Received: from nalasppmta05.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w9xdxa96c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 17 Feb 2024 00:10:34 +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 41H0AXSe017213 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Sat, 17 Feb 2024 00:10:33 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, 16 Feb 2024 16:10:33 -0800 From: Wesley Cheng To: , , , , , , , , , , , , , , CC: , , , , , , , Wesley Cheng Subject: [PATCH v17 13/51] xhci: export XHCI IMOD setting helper for interrupters Date: Fri, 16 Feb 2024 16:09:39 -0800 Message-ID: <20240217001017.29969-14-quic_wcheng@quicinc.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20240217001017.29969-1-quic_wcheng@quicinc.com> References: <20240217001017.29969-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: 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-ORIG-GUID: 3iByqtOfElKj-YdXf1D-_j3fqxsdIUD1 X-Proofpoint-GUID: 3iByqtOfElKj-YdXf1D-_j3fqxsdIUD1 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_23,2024-02-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 malwarescore=0 suspectscore=0 mlxlogscore=760 adultscore=0 phishscore=0 mlxscore=0 clxscore=1015 impostorscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402160189 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 9039f234cf52..77042df42b46 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1875,6 +1875,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);