Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp555075lqp; Tue, 11 Jun 2024 12:06:07 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUbAYAArg50gDvo8PkejEv3yr9t3gQyDbjxfNXVTouQR7iwyRjgMYbCWiEDi3nSpvnh3to9mUJZ5ZJBD3mO95njR/I6tfrt4F8ql6DArg== X-Google-Smtp-Source: AGHT+IFdvYJ8h1S3RDZsxrzZpc5igxlKs3MRX9CVzLEiX8AgnbXnZBnlcbkbr4VuxEysQOJQCnPc X-Received: by 2002:a17:903:41d2:b0:1f6:6ef0:dae4 with SMTP id d9443c01a7336-1f6d02feee2mr163547055ad.32.1718132767009; Tue, 11 Jun 2024 12:06:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718132766; cv=pass; d=google.com; s=arc-20160816; b=t1d3RblllyyymU6kHPTjLkODmjjbO6ZE/taZVdZVhZ5QUO6ivtB0/HqDhZ+ZTPpGGQ 88bz5WFY+KhAXYd/AOwGNGJWFFyfcBYeCvBTGyeUPKqoCN/w76lizzVuUmSrbH7YqxfT 3jLiNOzEgcZym+gUk1UGaELG7pDRsBHtFiCdroOHHgEF630rZ6oZRzO9GWtqw3lGKGcv 8kGHIABx9DOnCH8GUqKx46knIj81icKYB+Rt7VICfQJy8MrYrS0G3+h9tX0mbUn8Zx6T ZmNDVM7w+vGSvpxinUrA3ZFn8hDCgnr4q0X/kJiRM8u3ga0l8lku9sT9qb389I1AlsNl efnA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:subject:from:references:cc:to :content-language:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=tuUoHBFoiUfkwEpkhowxcz7ydYtPrXvwN6iMqxKP28U=; fh=S1xPgRSSmskGpesVuPRGyATrK/Xk91NhXMaVgRyRAto=; b=aoZm0y6gN8RGaxAL41m8vBdyQexVYSkgCU/eh963hRzBj6AjNBn6xZGfKtJo+0fa4e aqjh0p8ZKB6ysnLPusQ7e09ZHulULY+ZfPjLtHma5PFI91WTosGr9y3FucmAS6zTtLgG thVi6E2Ac5Y/7pq9msnjt6PYY0bATO8ZQXl/jy+RRoZ9tVupbr9AcyO5zKTe65LC2COp H9ABguKwA3Hs+siwIV/MavR9Q+/tqpeTeZtbeAnRTgVZuaSapb37Q1RpXfR28otk1bli raqSuLf9BoaOU1jvwl7kPGZZEClSW7FW3GsSip82WvCO4vxfVtYWo94CWVVPwVw5PV03 8gIQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=eaH6STUm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-210108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id d9443c01a7336-1f703a5be55si49996405ad.474.2024.06.11.12.06.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 12:06:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210108-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=@intel.com header.s=Intel header.b=eaH6STUm; arc=pass (i=1 dkim=pass dkdomain=intel.com dmarc=pass fromdomain=linux.intel.com); spf=pass (google.com: domain of linux-kernel+bounces-210108-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210108-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 8F693B2317B for ; Tue, 11 Jun 2024 15:00:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB3741EEE9; Tue, 11 Jun 2024 15:00:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="eaH6STUm" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (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 84F45208AF; Tue, 11 Jun 2024 15:00:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.21 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718118031; cv=none; b=IdI6mvyQDvFfRDMxbWaUKGxiE6/nKnBxjHKCFhLmNBDWvvpcWtpWRytxSa1MI3yo3VYtk6cb0Zov7xvY3C4GOtR6AjXBuBFYtAV8lfQU7vhDOdVpT1kViFFrAR9T6yIeggr617p12Cz+5pb5fk/BrPsBs1tL6v49NFSohOBJKiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718118031; c=relaxed/simple; bh=91mEIWE6KuDoenU3fDkspc4I9RYUULOQfo4L08RhrXI=; h=Message-ID:Date:MIME-Version:To:Cc:References:From:Subject: In-Reply-To:Content-Type; b=sEGEdVtbtjP5TgY4Nd/KNtLnF55Dlth2SpsBI/T5i6TMgyGZ0Nq3+a+eK/KQ1dUu6OMqwY7Efba5aohM5vvp6qN2UoXpDMpt0mSb6zDgFbRusasN869CEjX3FrDgXeuAMGTr2aB//htSkGM/cB/adRvEIlPfVqhRCGVlE0hqu24= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com; spf=none smtp.mailfrom=linux.intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=eaH6STUm; arc=none smtp.client-ip=198.175.65.21 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.intel.com Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=linux.intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1718118030; x=1749654030; h=message-id:date:mime-version:to:cc:references:from: subject:in-reply-to:content-transfer-encoding; bh=91mEIWE6KuDoenU3fDkspc4I9RYUULOQfo4L08RhrXI=; b=eaH6STUm11tczp1mrkH+gbSAOBJr1p0v147mn8TLkkcd4V/dno3vGE/j EO5W8mQccd4HhMrRdNPRhkBpq+SQwc5JrZ1Bj2tMqnLm5frdzi2PINvoo qfk+JTd0U7awviTW0Jj4gh/fAKYVwJ5XpuAgaBWoJU3vq3y4Ai1ZGbvrO bFxddHuInUEHb1KGkUD54ts9aS+BetryZzwI6PMXuXnB9SFPrPbnuYsd7 9iaKEeJIcUkK0efHjX4VkXacvR4kcWv80VgWOBQFwoyFVWoPEcoGO9Nmx i/U3aW6mmanWjvWxVUwj6riJxpHc2plFn2AuThaU/JlvstHl1A59JHJAd w==; X-CSE-ConnectionGUID: fznZbByrTUyoo57yEUm1aQ== X-CSE-MsgGUID: IRW34F2NRdqUBS6IQa30zA== X-IronPort-AV: E=McAfee;i="6600,9927,11100"; a="14787680" X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="14787680" Received: from orviesa009.jf.intel.com ([10.64.159.149]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 11 Jun 2024 07:56:10 -0700 X-CSE-ConnectionGUID: WKI8vl8xQ2Wimmzj0ir7pA== X-CSE-MsgGUID: o2sGCjdnQ364eDUqdQN9ww== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,230,1712646000"; d="scan'208";a="39552759" Received: from mattu-haswell.fi.intel.com (HELO [10.237.72.199]) ([10.237.72.199]) by orviesa009.jf.intel.com with ESMTP; 11 Jun 2024 07:56:07 -0700 Message-ID: Date: Tue, 11 Jun 2024 17:58:05 +0300 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Firefox/102.0 Thunderbird/102.13.0 Content-Language: en-US To: joswang Cc: mathias.nyman@intel.com, gregkh@linuxfoundation.org, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, joswang References: <20240601120640.73556-1-joswang1221@gmail.com> <1662c9c9-7330-4794-843a-940f05802021@linux.intel.com> <2521588d-30a6-0224-c7c9-3015e9cc65a3@linux.intel.com> From: Mathias Nyman Subject: Re: [RFC 1/1] usb: host: xhci-plat: add enable XHCI-AVOID-BEI quirk by dts In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 11.6.2024 17.45, joswang wrote: > On Tue, Jun 11, 2024 at 6:01 PM Mathias Nyman > wrote: >> >> On 6.6.2024 17.08, joswang wrote: >>> On Wed, Jun 5, 2024 at 6:31 PM Mathias Nyman >>> wrote: >> ... >>>> >>>> I was thinking of turning XHCI_AVOID_BEI behavior into the new default, so no >>>> quirk flag would be needed: >>>> >>>> Currently without the quirk flag: >>>> >>>> - ISOC TRBs trigger interrupt if TRB is the last in the TD >>>> >>>> Currently with XHCI_AVOID_BEI quirk flag: >>>> >>>> - ISOC TRBs trigger interrupt if TRB is the last in the TD >>>> - Interrupt is additionally triggered every 32 isoc TRB (initially). >>>> - if more than 128 events are processed in one interrupt then the >>>> 32 is halved, and we trigger an interrupts every 16th isoc TRB, and so >>>> on, 16 -> 8... >>>> >>>> I would remove the quirk flag, and make all controllers interrupt >>>> behave as if it was set. i.e. interrupt at least every 32 isoc TRB >>> >>> Thank you for your detailed analysis. >>> Excuse me, I have a question, do you mean to set "Currently with >>> XHCI_AVOID_BEI quirk flag" as the default behavior? >> >> Yes, unless it causes some issues or there are strong objections >> >>>> >>>> Is there an actual real world case where interrupting every 32nd ISOC TRB is >>>> too often? >>> >>> I mean that if the XHCI_AVOID_BEI quirk flag is set, an interrupt will >>> be triggered every 8 TRBs, which makes the interrupts seem to be quite >>> frequent. >>> Thanks >>> Jos >>> >> >> It should start with interrupting every 32nd isoc TD, not 8th >> >> #define AVOID_BEI_INTERVAL_MAX 32 >> >> ir->isoc_bei_interval = AVOID_BEI_INTERVAL_MAX; >> >> Thanks >> Mathias > > As you mentioned,if more than 128 events are processed in one > interrupt then the 32 is halved, and we trigger an interrupts every > 16th isoc TRB, and so on, 16 -> 8... > xhci_handle_events() > ...... > if (event_loop++ > TRBS_PER_SEGMENT / 2) { > if (ir->isoc_bei_interval > AVOID_BEI_INTERVAL_MIN) > ir->isoc_bei_interval = ir->isoc_bei_interval / 2; > } > ....... Yes, and to me this seems reasonable . If there are over 128 events per interrupt then we should interrupt more often. Would this work as the default for the Synopsys hosts you are working with? Thanks Mathias