Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp195444rwi; Wed, 26 Oct 2022 23:14:39 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5hpsd7uQUTd4soH+pZ3Pr6PSUyX70tTA+6qxFE5kjwM3v1c0qGWLl48hEjm8Qw/WRzZbGd X-Received: by 2002:a17:903:2284:b0:180:289f:7f09 with SMTP id b4-20020a170903228400b00180289f7f09mr48682243plh.120.1666851279398; Wed, 26 Oct 2022 23:14:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666851279; cv=none; d=google.com; s=arc-20160816; b=XJ1k8+lelmSFmz/BexVWfAijOcFiW/VihMJRINlQrEcEj+niaiqNauslihm2jbxuSD PyWEUJDNsRJ3Qd08FXm4eoZyHYXSzfPLWkpWtcroiOHjDVazZzTAtbONt5CN1Fa+CP07 zL7nImtBHgqEFs+RRfbiXrQ+Lt2JqjBwKfKJZpYuFRGJglk2Md/f2UgoWbTe7SFzpuey 5+hOFzofnoIZIEvlUi5R/qvYQXgaIJnlB/4yd2RXaVWjmYXBFX8Eh2leUJ466GrZR9fy aDiVLJLCXgPMHmoNh0IBo+mNOxGJ/pzCDMq1XjyfK2b/pBfda4z9MRDGBnkzKgxRJ5DR tO8Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=OX5khOfyaQOWa1c3WI+x9fZLCDvYWwnbJ0G/8c8cFkQ=; b=uyq6FnhMgJFXxW6nCie0fxTW4WY7Q7s3TFDErZSxfapiNlfWV6bmk7zGNLXYLnC6Ic Kq42jOoUaD97/EBJKq8AXDg9lLVABC3pGF3U1S8PzRPvrXf5/fm7dOtl2CvER31eCv4V 2lhb4/zm4nbJHL/JC/jiqlXbTblL+X85+rFEekS/ojeKnb80VtsXzMH3Stff9Lo+XKx+ +EFv65yqC4Q29d2vROHaX8OTBEqs43wb8H0BOiQhiE0Qa3JRdPcGVDOA9TnrUHu3JRA3 kqLW0B5Wjhq2a9f6YGu98NqOc7gFAjgMjlMlg+aFVFEDYR/MOFzTBVsavfFZcpNqkz7T JgTA== 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 j18-20020aa78012000000b0056c8c13257bsi752414pfi.37.2022.10.26.23.14.27; Wed, 26 Oct 2022 23:14:39 -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 S234312AbiJ0GEE (ORCPT + 99 others); Thu, 27 Oct 2022 02:04:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234482AbiJ0GDq (ORCPT ); Thu, 27 Oct 2022 02:03:46 -0400 Received: from bmailout1.hostsharing.net (bmailout1.hostsharing.net [IPv6:2a01:37:1000::53df:5f64:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6B4747CA80; Wed, 26 Oct 2022 23:03:44 -0700 (PDT) Received: from h08.hostsharing.net (h08.hostsharing.net [IPv6:2a01:37:1000::53df:5f1c:0]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "*.hostsharing.net", Issuer "RapidSSL TLS DV RSA Mixed SHA256 2020 CA-1" (verified OK)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id B51CE300018BB; Thu, 27 Oct 2022 08:03:42 +0200 (CEST) Received: by h08.hostsharing.net (Postfix, from userid 100393) id AA99F30110; Thu, 27 Oct 2022 08:03:42 +0200 (CEST) Date: Thu, 27 Oct 2022 08:03:42 +0200 From: Lukas Wunner To: Bjorn Helgaas Cc: Stefan Richter , Vaibhav Gupta , "Rafael J . Wysocki" , linux1394-devel@lists.sourceforge.net, linux-pci@vger.kernel.org, linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH v2] firewire: ohci: convert to generic power management Message-ID: <20221027060342.GA444@wunner.de> References: <20221025212521.686779-1-helgaas@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221025212521.686779-1-helgaas@kernel.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-2.3 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE autolearn=ham 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, Oct 25, 2022 at 04:25:21PM -0500, Bjorn Helgaas wrote: > N.B. This changes the order of pmac_ohci_off() and pmac_ohci_on(). > Previously, pmac_ohci_off() was called *after* pci_save_state() and > pci_set_power_state(), and this change calls it *before*. > > Similarly, pmac_ohci_on() was previously called *before* > pci_set_power_state() and pci_restore_state() and this change calls it > *after*. Seems likely the ordering change may break things. pmac_ohci_on/off() toggles PMAC_FTR_1394_ENABLE, which is defined as: * enable/disable the firewire cell of an uninorth ASIC. It sounds like it will cut power to the firewire controller and I'd expect that pci_save_state() will then not be able to access config space. The only way to make this work is to define a struct dev_pm_domain whose ->suspend_noirq callback first invokes the pci_bus_type ->suspend_noirq callback and then cuts power to the firewire cell by calling pmac_ohci_off(). I've done something like this for Thunderbolt power management on x86 Macs a few years back but didn't get around to upstream it so far: https://github.com/l1k/linux/commit/4db7f0b1f5c9 Thanks, Lukas