From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7F03C3A5A1 for ; Wed, 28 Aug 2019 08:43:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A703E2341B for ; Wed, 28 Aug 2019 08:43:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1566981822; bh=ejiHzNsZXazQCsG+BS/wdimKD736R8YukAQQUJkRIK0=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-ID:From; b=Bt+B2U79+npAIA7OPwcExM5Qxu8aMQHvnca2OLyJ2hh98rLRF2WzW4AGuLK2Z2YVg qToounyyxfTV8KSVwD6ZjYDCiFVXkLK8LHl1tsFy/wbLTNswcRwUBgkgSGn8waiNue u13lcppbgeY2oPHdA+N/TCGqi4m9l+MuGijW5LQU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726463AbfH1Inm (ORCPT ); Wed, 28 Aug 2019 04:43:42 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:45165 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726292AbfH1Inl (ORCPT ); Wed, 28 Aug 2019 04:43:41 -0400 Received: by mail-oi1-f194.google.com with SMTP id v12so1445289oic.12; Wed, 28 Aug 2019 01:43:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=f7pUEqpS8XYSbhqXawr72tizr49QR8+07pZyNaAucJk=; b=Ea9oKdXRwvhnPpNGeICKXlctfcq3JpqpnUO8M4IbeR/Mo7I8XfTZoPwLa1lxwBevkh hXTDlmi09BTENNAAzLc2rT1ypqenKPWDZUFoC42E9xgs8eO2k5zq1onocfXrsfcZL4qU LO+K7sLb8nhwerMKRrax9iYTVihYQnt42WaCRXGx5wjgQGSNfKKhSDMxWYYm+YihcYgy GkDkcCidRKEnIjIjjzRQgrdKQ22FiYvADsEbhBftnE9sQPKLJTwWVl2w9sevTC7YgdSB PWN29mVzzDF60p93H20VIDmAj7J+CdQFslCPf91nnNbl3asI9Alhe0g+iSnSfc0TpGY2 litg== X-Gm-Message-State: APjAAAVV1Dr4be9dIctKaEbO/XOHMChYXW4hcuazzTeglOPAIXwJDnRn GwDOzkJjbsFNHbl8eEFffGvW1vBSz9MQJuvW8SY= X-Google-Smtp-Source: APXvYqwoBZ9xngGjaLkB18eyYNqI3eSbzfST/fobzbGLBjwCx/DNWUL8p7tLnksoUmbv3wPK5B36UUGRk4SexyBNExI= X-Received: by 2002:aca:cfcb:: with SMTP id f194mr1988936oig.103.1566981820793; Wed, 28 Aug 2019 01:43:40 -0700 (PDT) MIME-Version: 1.0 References: <01cf6be6-9175-87ca-f3ad-78c06b666893@linux.intel.com> In-Reply-To: From: "Rafael J. Wysocki" Date: Wed, 28 Aug 2019 10:43:29 +0200 Message-ID: Subject: Re: Ryzen7 3700U xhci fails on resume from sleep To: Daniel Drake Cc: "Rafael J. Wysocki" , Mathias Nyman , Linux USB Mailing List , Linux PCI , Linux PM , Endless Linux Upstreaming Team Content-Type: text/plain; charset="UTF-8" Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Wed, Aug 28, 2019 at 10:34 AM Daniel Drake wrote: > > On Tue, Aug 27, 2019 at 3:48 PM Rafael J. Wysocki wrote: > > That depends on what exactly happens when you try to do the D0-D3-D0 > > with setpci. If the device becomes unreachable (or worse) after that, > > it indicates a platform issue. It should not do any harm at the > > least. > > > > However, in principle D0-D3-D0 at the PCI level alone may not be > > sufficient, because ACPI may need to be involved. > > After using setpci to do D0-D3-D0 transitions, the xhci module fails to probe. > > xhci_hcd 0000:03:00.3: WARN: xHC restore state timeout > xhci_hcd 0000:03:00.3: PCI post-resume error -110! > > But maybe it's not a great test; as you say I'm not involving ACPI, > and also if Linux has a reason for not runtime suspending PCI devices > without drivers present then maybe I should also not be doing this. > > > I think that PM-runtime should suspend XHCI controllers without > > anything on the bus under them, so I wonder what happens if > > ".../power/control" is set to "on" and then to "auto" for that device, > > with the driver loaded. > > Good hint. > > # echo on > /sys/bus/pci/devices/0000\:03\:00.3/power/control > # echo auto > /sys/bus/pci/devices/0000\:03\:00.3/power/control > # echo 1 > /sys/bus/usb/devices/1-4/remove > # cat /sys/bus/pci/devices/0000\:03\:00.3/power/runtime_status > suspended > # echo on > /sys/bus/pci/devices/0000\:03\:00.3/power/control > > The final command there triggers these messages (including a printk I > added in pci_raw_set_power_state): > xhci_hcd 0000:03:00.3: pci_raw_set_power_state from 3 to 0 > xhci_hcd 0000:03:00.3: Refused to change power state, currently in D3 > xhci_hcd 0000:03:00.3: pci_raw_set_power_state from 3 to 0 > xhci_hcd 0000:03:00.3: enabling device (0000 -> 0002) > xhci_hcd 0000:03:00.3: WARN: xHC restore state timeout > xhci_hcd 0000:03:00.3: PCI post-resume error -110! > xhci_hcd 0000:03:00.3: HC died; cleaning up > > So we just reproduced the same issue using runtime PM, without having > to go through the whole suspend path. > > I guess that points towards a platform issue, although the weird thing > is that Windows presumably does the D3-D0-D3 transition during > suspend/resume and that appears to work fine. It looks like the platform expects the OS to do something that our generic XHCI driver and the PCI/ACPI layer don't do. A quirk or similar may be needed to address that. > I'll report it to the vendor, Yes, please. At least try to get the information on what the exact platform expectations with respect to the OS are. Quite evidently, they aren't just "do the usual thing". > but if you have any other debug ideas they would be much appreciated. With the git branch mentioned previously merged in, you can enable dynamic debug in device_pm.c, repeat the PM-runtime test and collect the log. There should be some additional messages from the ACPI layer in it. > > Daniel