Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1179388lqa; Sun, 28 Apr 2024 23:49:28 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXL0s5PCdtzF+7kGofFeTebkUu/AcHxRMRaH8dsqeQBHJS00ksCxo5eOmgO5DIWa7jTlEcrjOoMVb5HHpFf9/R5BncFx7dwvwUezAX01g== X-Google-Smtp-Source: AGHT+IHGg9AQsVhOolOcO/wvx3cVg+XZGqIE8xEr+wZRcyF1jGovP9GugHZyH0rP2pDWnpaSQH6q X-Received: by 2002:a17:902:e806:b0:1e2:81c1:b35e with SMTP id u6-20020a170902e80600b001e281c1b35emr12843958plg.54.1714373368239; Sun, 28 Apr 2024 23:49:28 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714373368; cv=pass; d=google.com; s=arc-20160816; b=D3N6TfQ3uFvZd/aqMlKL/7+o6y6LmVrnQdzT++nLc16s9+fcch/0gA0P6Jm7+SxYmy nWilc2+crP4z2tGWUaRiEQJfYS+9kPHFslxDYalj0X6HnQHweIezi/OnixUw293QQeFP bi3t9BmaAB3xbY66uV89wi24G5nRV9eblT3tcWBshzPVbPxhTKNUA6xcJ8jTLsMy1Mhy LP0chlXNDJiB1WX7Ff9M1VdkKLUwi2S4ow+W/8Ct11z77oNIUauy7+g8YVSXaK+fP2O1 gnOv193YGeyonsI8qzaZBj57YliXZFBXNn6VnPwr03zk1FUFcJfpdyGJQ+EiqCl55s4D uZcA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4PhUZhVF9RyfxmoFtdmZbDxyMR/o8b2EeiB8j5+C41E=; fh=hew7Ul7CXqBNqglw9pbCBzX5ifez1wjSvWem3gQ+deo=; b=YqYi/vZ+jF9IM9la51pagF8LVWsTIfktmOnsOHEH/aN/Tkh0fsM0tR3/Z7rjk9MmpX 6SkOh4svtPmmwClDo3/Rvcm+nFbRjca7+6MhnMYVkhkDdVDqFgxqai7n8sujBhxrPum5 1eU8418hJwkGToJYX3RxG778oUF4ZjQk44ntTIHlCKrTH+pFb6VDbLdjXplcEX79NOXk SyhVfvgIT1qwGfLkiZSG2476v0dyEGWDwBlp04UaFxw/DBQhRfceWHECu2ESGJ8bF2zJ L3ogCv/wiRb/QVkq5wUslfddLj3SO2lHmCg5ka5yt+KcxBefQS5tZ1m01ZMVpQseBKmb K27Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ByVSR8WO; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-161824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id c21-20020a170902c1d500b001ea15bdc64bsi10854548plc.10.2024.04.28.23.49.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 28 Apr 2024 23:49:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-161824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=ByVSR8WO; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-161824-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-161824-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.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 C8664281407 for ; Mon, 29 Apr 2024 06:49:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8793C12E70; Mon, 29 Apr 2024 06:49:19 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="ByVSR8WO" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (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 52F9C1119B for ; Mon, 29 Apr 2024 06:49:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714373358; cv=none; b=L+JyxkHwAZbbV013z6ptRp56iWvQNkgjFRt22GNR08fwBIgIoQGWO8tQGItAvI77wmwI9aEKEEdqr0oBuK4cwfcGunueVFooGB74UETz6hARs9gAFDYyAjBkVude6SUFB1hi4acUpOoKKBc8EMqroF7y5cbGfidLLCrfbvwY3Uc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714373358; c=relaxed/simple; bh=8vEsWheUY/PvRn653Oqry5I9g+0ZKOyL2X0BXoqCHiY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=okOhSiTTyN7SwEZmLor2nHazw3By0Vq57uWovhgDOPALgAgXIG+viW+cgBxsDZUNrtXPCx3BWDgA8DvmaYabr8X/y1iyN2cWQnaxVUx1bJqq/eXZOTfoVK4GJzP62tuqyVSfE3YHGsvKdmA9n0K9IE8tq+F24OafQwJVy/WrtNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=ByVSR8WO; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1714373353; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=4PhUZhVF9RyfxmoFtdmZbDxyMR/o8b2EeiB8j5+C41E=; b=ByVSR8WODEWbAM9WIbGVTNXORL9v/hzF5xv2ePJSDCbwk6+FheeXlEC7tRoFzI6b9Qc0mm 32WZUZLjSPq4vatRtbpBi6ata3dGQcLFGpUEh7G8zlH+VBduB/EO+eZGskS0ZlYfCXyFU7 h38Q1W5F5++cJ9rqVGw06Wc6RC5TNO8= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-302-Rsl1L-PYP1akjDKJigCbqw-1; Mon, 29 Apr 2024 02:49:07 -0400 X-MC-Unique: Rsl1L-PYP1akjDKJigCbqw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id EAA8538000A8; Mon, 29 Apr 2024 06:49:06 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.134]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A43451C06700; Mon, 29 Apr 2024 06:49:06 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id 5D43A18009BA; Mon, 29 Apr 2024 08:49:00 +0200 (CEST) Date: Mon, 29 Apr 2024 08:49:00 +0200 From: Gerd Hoffmann To: Guenter Roeck Cc: David Laight , Alan Stern , Greg Kroah-Hartman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] usb: ohci: Prevent missed ohci interrupts Message-ID: References: <20240424195951.3749388-1-linux@roeck-us.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.7 Hi, > > > + /* repeat until all enabled interrupts are handled */ > > > + if (ohci->rh_state != OHCI_RH_HALTED) { > > > + ints = ohci_readl(ohci, ®s->intrstatus); > > > + if (ints & ohci_readl(ohci, ®s->intrenable)) > > > > Doesn't the driver know which interrupts are enabled? > > So it should be able to avoid doing two (likely) slow io reads? > > (PCIe reads are pretty much guaranteed to be high latency.) > > No, the driver does not cache intrenable. Does the driver ever change intrenable after initialization? PCIe reads are expensive, especially in virtual machines where this goes vmexit to qemu, so doing that for a piece of information the driver should have (or is able to calculate) should indeed better be avoided. take care, Gerd