Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp1484781lqa; Mon, 29 Apr 2024 09:40:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEa8OcWeZR8/WNUTBvQBRFmdrIIwklKB4X5Xt79ahn8jBFFMVE+QME9DID9E+rBjaBXNl3shzlGje6Z8Hv9dSdgBnnmG9sMpg4v20HPg== X-Google-Smtp-Source: AGHT+IFt+4x/9CHUFInmMrsr8ccEPFjULfdLYuWBHhzM17ubaKZV3dCmUR5YB+buZ6WUMZHty4iL X-Received: by 2002:ac8:5f46:0:b0:43a:d386:f8eb with SMTP id y6-20020ac85f46000000b0043ad386f8ebmr58196qta.22.1714408855543; Mon, 29 Apr 2024 09:40:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714408855; cv=pass; d=google.com; s=arc-20160816; b=Kk8K/iuXnczUce7OhKOa7LlnhGSANF/0eYtGh9QwW4WcyCnK8CHDe55W8FAFGcbn68 jYWTSaHar2EPlSjM4z3++Q1nB2KmIaTaLJAYcDC/q/xfqFzi+Vp/8v5cMRI6inYK7WuF sau1rbBs+HsmzBg32i4bztJ9/4OgrztzOT+E7HnPKTtpgNKV13Tv5/xf1IOGDjDPvRIB RIJegCWybVIUeXQVwMLN42QEGTGA494EvKFPLXI00OyuFr41pXb7t2QMDK0v908ULzC/ WuShN/OaJRQj6/FSEK2O62KBEZnwyn3/gpKn36+reXeSc6Eu5YgYWanVuVc+uLkoRd6n sweg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :sender:dkim-signature; bh=4hAwPIk/J0mbp1JgX2t87eFy3QhJBjBJL9p7CarC7ho=; fh=ihITPnFebkRzgYQOJ6QrOQZkQ7NbeokWvRZUH1hLVTI=; b=0+is6/61iI/SiQSEFprgZEfbuRl8idZhjEQOEJq6aYD+yg4MymIeIqaeR376ViMFCi GxEBRRkmSgpUZbnaWcYttsh0rW5qjrn2JuvcXC1G7wyDHkIBaG809DlCnuDGoJ9TmaZu ia9fK/S1tZyJxkm89ANOFN/r3v+32QtMwRGEMU9FmC75bi3ei5jupj/GwYImSq8D0FRd ufVYlIWqAtxGl4XEaX9y/NnOCrCAbN/iS2Ln6YpemsYfDZbU20WNe6Yhew9ZF3brQF29 rtdr/SyXDMIuUhqVR5+mAnpnftnOwWCBRf0cUya9q+Lu01XLaadoT3eXPT7doWPWr9hS +qTw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JbmaZFUJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162701-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id bz14-20020a05622a1e8e00b00437bd2a532dsi26262711qtb.120.2024.04.29.09.40.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Apr 2024 09:40:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-162701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=JbmaZFUJ; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-162701-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-162701-linux.lists.archive=gmail.com@vger.kernel.org" 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 381081C21903 for ; Mon, 29 Apr 2024 16:40:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DC9BD85C6F; Mon, 29 Apr 2024 16:40:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JbmaZFUJ" Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6BDF385924; Mon, 29 Apr 2024 16:40:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408843; cv=none; b=hZjdqWzcBqY0IQefFmcqidNSK+iQ8/kXLlH4HkGTG0sskTEs7dxOy4i/vc5G69hMHK1XVSB5e8l1B+izUDOPjCCuYIMoyYEUij+WF+msYjeLmKI8e577uUkuLFN0EtJGq/hjBXBHvQezISqi1DEXS7LKZy0zdej7hqRZoKsr8I4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714408843; c=relaxed/simple; bh=y/JoRti5C/zhiWY4j/apSF+4M4QIGCm1Y/dnb2ZI8zI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ghPEBJDnnGyLr6+TDQ7tTxKsF2RWRmXvWC1P1zWShQkDSeiSieh4U8U67E0tO6mnNsSDcsMcI57wcM+kyi5rx6ADJMJOy7KCUXzID6w8XOmpdSJ33X+Oqu/W2CAYkwm5XC91kpximGP6Lwz1yuJt/OA+HWhPv01VlQ4NKAh9E9U= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=JbmaZFUJ; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=roeck-us.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-6f30f69a958so4057035b3a.1; Mon, 29 Apr 2024 09:40:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714408841; x=1715013641; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=4hAwPIk/J0mbp1JgX2t87eFy3QhJBjBJL9p7CarC7ho=; b=JbmaZFUJSYNCeXieOIvaohvoV3tTNas17EdHAYz1rwbujRC72pvdGTsZfZSG0hC/HP PDzm5eSbPNoiMX8Ebp6v+0j7ISI9ybgU5vSia+kwMH4qop6R9b1i/YOpSJDrGqIPnnJ7 MoCzS/U7IpdbKn3Y6E2ciytpkcTP5Z45pjlYRUmOgwE7iLMqiY5TddOFiDFvti3+Q3li YY+2Y8iXiMqkDPyqNr8G8dlC0NojwYdOE2AEnWmQicebi5p/oqgXBRNTCGNSCeHaPJ67 VWOA1/pg9CNUZzJwqPCUY0onOd1l/TyGpE5ZBPU/VUkSkn6QnBXFNrbJjc8CSNEjbjrT ciig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714408841; x=1715013641; h=content-transfer-encoding:in-reply-to:autocrypt:from :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=4hAwPIk/J0mbp1JgX2t87eFy3QhJBjBJL9p7CarC7ho=; b=PVe/mUuglgx0ayaovCh3HfN+Z4n1gyB6X2bduCqv07uswyIxr4nN05PD14knjcNuMY T7ErXMmlDOxuLp322E4Iq/VXjJOBa+KsuaWb4aAYE7Uvf668043p4lL11WRVU11U8LkC AKP5gxkR51RQ1baQd6d8p1arbAtPrULHyp/eKTGOLU1Q2NV6x13mgKUqZjhS8LUdXIPH fBcbbA+yZ39fb9e50zLBzu87TWbEgrsXYhyv4/kbdFRAzX5CYVFmg67EwLL9pohjr8Ox v6v8yQKRZs49PfyPZ1MVTTL8CwNtV566KByl0pyySgAi5gg1lfIYzO0mhhgOPk3Lk+lg D3IA== X-Forwarded-Encrypted: i=1; AJvYcCUpnyskMWwj9cigLNFUCnqf1FkXY5+P0sTXcukwiq73Ad9HpsNaDyeIohwqLBo43gq5PLKmUa/TqGRYg9HPBX4UGHBCZNae5mEFlEbXeaGwGgjUbTtKWlZxY27cFjOlHJxR7qY4AcZO X-Gm-Message-State: AOJu0Yy4MTuSL8FS0Hz4DXOTqnHeUc/3IN1cy8r1yGWhfVuR/igolMh1 8zkFvj7ebOtEO8AjvezgXZH88h/RbyqMEPF4Ffb+0IVvxu97XdvJHTuJeQ== X-Received: by 2002:a05:6a20:551a:b0:1ad:8109:48f2 with SMTP id ko26-20020a056a20551a00b001ad810948f2mr98505pzb.36.1714408841503; Mon, 29 Apr 2024 09:40:41 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id n13-20020a17090ac68d00b002ab68ce865asm20718787pjt.9.2024.04.29.09.40.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 29 Apr 2024 09:40:39 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Mon, 29 Apr 2024 09:40:38 -0700 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3] usb: ohci: Prevent missed ohci interrupts To: Alan Stern Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, David Laight , Gerd Hoffmann References: <20240429154010.1507366-1-linux@roeck-us.net> <2c2ba8df-cdce-4666-8da3-252d4b707239@rowland.harvard.edu> Content-Language: en-US From: Guenter Roeck Autocrypt: addr=linux@roeck-us.net; keydata= xsFNBE6H1WcBEACu6jIcw5kZ5dGeJ7E7B2uweQR/4FGxH10/H1O1+ApmcQ9i87XdZQiB9cpN RYHA7RCEK2dh6dDccykQk3bC90xXMPg+O3R+C/SkwcnUak1UZaeK/SwQbq/t0tkMzYDRxfJ7 nyFiKxUehbNF3r9qlJgPqONwX5vJy4/GvDHdddSCxV41P/ejsZ8PykxyJs98UWhF54tGRWFl 7i1xvaDB9lN5WTLRKSO7wICuLiSz5WZHXMkyF4d+/O5ll7yz/o/JxK5vO/sduYDIlFTvBZDh gzaEtNf5tQjsjG4io8E0Yq0ViobLkS2RTNZT8ICq/Jmvl0SpbHRvYwa2DhNsK0YjHFQBB0FX IdhdUEzNefcNcYvqigJpdICoP2e4yJSyflHFO4dr0OrdnGLe1Zi/8Xo/2+M1dSSEt196rXaC kwu2KgIgmkRBb3cp2vIBBIIowU8W3qC1+w+RdMUrZxKGWJ3juwcgveJlzMpMZNyM1jobSXZ0 VHGMNJ3MwXlrEFPXaYJgibcg6brM6wGfX/LBvc/haWw4yO24lT5eitm4UBdIy9pKkKmHHh7s jfZJkB5fWKVdoCv/omy6UyH6ykLOPFugl+hVL2Prf8xrXuZe1CMS7ID9Lc8FaL1ROIN/W8Vk BIsJMaWOhks//7d92Uf3EArDlDShwR2+D+AMon8NULuLBHiEUQARAQABzTJHdWVudGVyIFJv ZWNrIChMaW51eCBhY2NvdW50KSA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iDI HP/aVnm6NC8of26P40Pg8EdAhajZnHHjA7FrJXsy3cyIGqvg9os4rNkUWmrCfLLsZDHD8FnU mDW4+i+XlNFUPUYMrIKi9joBhu18ssf5i5Q= In-Reply-To: <2c2ba8df-cdce-4666-8da3-252d4b707239@rowland.harvard.edu> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 4/29/24 09:05, Alan Stern wrote: > On Mon, Apr 29, 2024 at 08:40:10AM -0700, Guenter Roeck wrote: >> Testing ohci functionality with qemu's pci-ohci emulation often results >> in ohci interface stalls, resulting in hung task timeouts. >> >> The problem is caused by lost interrupts between the emulation and the >> Linux kernel code. Additional interrupts raised while the ohci interrupt >> handler in Linux is running and before the handler clears the interrupt >> status are not handled. The fix for a similar problem in ehci suggests >> that the problem is likely caused by edge-triggered MSI interrupts. See >> commit 0b60557230ad ("usb: ehci: Prevent missed ehci interrupts with >> edge-triggered MSI") for details. >> >> Ensure that the ohci interrupt code handles all pending interrupts before >> returning to solve the problem. >> >> Cc: Gerd Hoffmann >> Cc: David Laight >> Cc: stable@vger.kernel.org >> Fixes: 306c54d0edb6 ("usb: hcd: Try MSI interrupts on PCI devices") >> Signed-off-by: Guenter Roeck >> --- >> v3: Check if any interrupts are pending before reading intrenable >> Add 'Cc: stable@vger.kernel.org' >> v2: Only repeat if the interface is still active >> >> Note that I did not apply Alan's Reviewed-by: tag since I was not sure >> if that was appropriate after the code change. > > I'm not too confident that the guess about all interrupt bits normally > being off is correct, but in any case the extra test won't hurt. > OHCI_INTR_RHSC and OHCI_INTR_SF are often set but disabled while the system starts, but afterwards it is mostly 0 during normal operation, i.e., while there are no interface state changes. > Reviewed-by: Alan Stern > > Guenter, if you want to work on a patch to cache the interrupt-enable > value in the driver, feel free to do it. I have too much other stuff > going on to spend any significant time on ohci-hcd. > Unfortunately I am in the same situation. Also, I am not sure if doing that would really be worth the trouble. Guenter