Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp486573pxb; Thu, 21 Apr 2022 04:13:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx3ntp/ELE1+MzQzU6jTVO/n25RsnUKhWfuQgwLIOfkdB6S1zvMrFsz95zepEbGKyf7D4NC X-Received: by 2002:a17:90a:5215:b0:1ca:79cf:f3dd with SMTP id v21-20020a17090a521500b001ca79cff3ddmr9997148pjh.6.1650539626439; Thu, 21 Apr 2022 04:13:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650539626; cv=none; d=google.com; s=arc-20160816; b=aOvcCYNTEphJhF7fh1mNILz5Ft/KfPVjKcOiISuhR7b24KbmV2ME1WV9i2VLKBG27h Bh5a9gDSgSmW/P++xfx0WkOjKSucSCUK6tC2LjkoY9LbMLTGScOGgo1IR3SvU9efgfZY WlI4cTJ+lpNQzZxgp7VlCe5H+Okmc01CYSN1p+loe5uREHj4dwrvUBfyka4G/Cm0RiEH wpE4SEeg1NmMpWWVDTPzeuA1A84eCrhLB36cxd7l7OZltxe6OVuObzmwTlxptlPj1oKs Y2R5U5A/SUad7qrZXmQ6/CMyIRJbPSYqMElQuOdRJ+zSGT1+7ZhWJ0zdkOSzfkNUZ8pJ TRpA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=yR5FBr326Rcf8qxzCGH7HCudPq62S+bpOs251kLIS8E=; b=bxY7wvH9Ch34zyz4aBu7mrZSsai0vqSxzG9efHOeL17VbPeBq6Oz/qWh/eyJDYDFJ9 YPFXpp8sBn+YHPxoV8AP0H7nzaCRB2e0JWb26QbRogudvJ0bGc+Yw2J6XhF630SjmrJG vbY2ZI4Ns0ah6CWcTHHxG0M9jY653XvZEUlY+m9RjoOI6SUvKg2c5t/r8Py+jc8Obd6p gKcpGBtqyCx4ZUaHD8yJaCSmjgCIypnMNLOKaiLTFv3bndI0QWeEGGx1j/WISpaARLzA Bu5RvkxqOPxQDl0NuAR9pYcvbHdtCY5bEkd3IL942oryTKwnCQl0lp8szvn5B1MXlrLY FbFA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ls9-20020a17090b350900b001cba3fda35fsi5854097pjb.85.2022.04.21.04.13.32; Thu, 21 Apr 2022 04:13:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1353487AbiDSOit (ORCPT + 99 others); Tue, 19 Apr 2022 10:38:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1353466AbiDSOin (ORCPT ); Tue, 19 Apr 2022 10:38:43 -0400 Received: from netrider.rowland.org (netrider.rowland.org [192.131.102.5]) by lindbergh.monkeyblade.net (Postfix) with SMTP id A658020190 for ; Tue, 19 Apr 2022 07:36:00 -0700 (PDT) Received: (qmail 594028 invoked by uid 1000); 19 Apr 2022 10:35:59 -0400 Date: Tue, 19 Apr 2022 10:35:59 -0400 From: Alan Stern To: Oliver Neukum Cc: Evan Green , Greg Kroah-Hartman , Thomas Gleixner , Mathias Nyman , Rajat Jain , Bjorn Helgaas , "Rafael J. Wysocki" , Razvan Heghedus , Wei Ming Chen , Youngjin Jang , linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Subject: Re: [PATCH v2 0/2] USB: Quiesce interrupts across pm freeze Message-ID: References: <20220418210046.2060937-1-evgreen@chromium.org> <9f2752b5-8717-8ea3-1462-69bcfe42bb0e@suse.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <9f2752b5-8717-8ea3-1462-69bcfe42bb0e@suse.com> X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 19, 2022 at 09:05:53AM +0200, Oliver Neukum wrote: > > > On 18.04.22 23:00, Evan Green wrote: > > The documentation for the freeze() method says that it "should quiesce > > the device so that it doesn't generate IRQs or DMA". The unspoken > > consequence of not doing this is that MSIs aimed at non-boot CPUs may > > get fully lost if they're sent during the period where the target CPU is > > offline. > > > > The current behavior of the USB subsystem still allows interrupts to > > come in after freeze, both in terms of remote wakeups and HC events > > related to things like root plug port activity. This can get controllers > > like XHCI, which is very sensitive to lost interrupts, in a wedged > > state. This series attempts to fully quiesce interrupts coming from USB > > across in a freeze or quiescent state. > > > > These patches are grouped together because they serve a united purpose, > > but are actually independent. They could be merged or reverted > > individually. > Hi, > > sorry for being a bit late in this discussion. There was something that > I didn't remember immediately. > > We have a set of quirky devices that need HID_QUIRK_ALWAYS_POLL. > They have the nasty firmware bug that, if you suspend them without > remote wakeup, they will crash or reset themselves. > I am afraid that has an obvious relevance to your cool patches. > I am not completely sure how to deal with this. It seems to me that the > quirk will need to be shifted from HID to core USB and thaw() needs to > be translated into usb_device_reset() + reset_resume() for them, > but I am not really sure about the optimal mechanism. We may not need to do anything. This patch specifically addresses hibernation, not system suspend or runtime suspend. A device crashing or resetting during hibernation is not at all unusual; we should be able to handle such cases properly. The THAW part of suspend-to-hibernation is used only for writing the memory image to permanent storage. I doubt that a malfunctioning HID device would interfere with this process. Alan Stern