From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f170.google.com (mail-pg1-f170.google.com [209.85.215.170]) (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 27A672FB084 for ; Mon, 13 Oct 2025 22:13:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760393598; cv=none; b=tXDqWhpVIe0KetS4v4JTrjzlPkuYKdA0tSzuzoqcNxHapN2ztvM7tb2+aa0sFUm7lnOjEj5DevRXCNA1/Vjj3kB4wQ0lubjjap7yt8CPpGkbX0z6QDjApj21sJwFaLOHakWsCpGv58VX5qrXyiSpMLJnrlXAStB4KvrTDZeRi0g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1760393598; c=relaxed/simple; bh=wjoYvXDZz0DfsX9uSWQcckKoP6w9GXLrRSh8PGU2nkw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=aZPWsL/+MVa06WE+NMylS9TvEhnVpMcUt/IMZtnNRgM1Gr2Nv75GfnOLaTHfKaAlUVviUORHx0RGqXkargCJlmh0Fo1WRuccLzubYMsQI0FZ2v3zaiOSEIaCNU6yBgk4XRnIZA4J3EfVFQsICVe5rZMXVuYfsQYeHpog0WGyl8w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=hGIzS1P+; arc=none smtp.client-ip=209.85.215.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="hGIzS1P+" Received: by mail-pg1-f170.google.com with SMTP id 41be03b00d2f7-b5515eaefceso4014433a12.2 for ; Mon, 13 Oct 2025 15:13:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1760393596; x=1760998396; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PwDIVnwjatb9wZcHCyfzRACsLl5kuks0bwo7xSwJ8VY=; b=hGIzS1P+9aouRtCGIyPObV5aQOQTsIoji7nzyHJQ1Jj2Gr/mCXDEbbQG8I5ZfxeRzi o1KTI1s1MmHDMicgBi3YxeJGXzEQOXHpw30f2X+/dnhi+wOv+lG3vjBrocf+mXPMN4Wm rwM1d6RQjW2UQNK1ZP+4cXxvjDun1s4bdF3sg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1760393596; x=1760998396; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PwDIVnwjatb9wZcHCyfzRACsLl5kuks0bwo7xSwJ8VY=; b=jfKrwlIiGHQum0VEIf4PnGimx0rEtO4cxnmjuIUUEgJCLOGxYpozzuFwEROVVPEdqg MDZqudM9wuiL3/7qNlp9U49zASudBW5NKiM78CIK6H8EiE4g8DDl2wtasEU2gsz9I6S0 5z1ArzzLLjYkTUI2W9Z0AcddjvgCnRB6HgAz+bfRI4vT7aCvl+Y2U6cC26eKs7xsOO+Z V8r06Rm/xcAuO7h/GB0E6/EESUyY9PN9v3yNJbQnHwaNnIBsIYRkPmcK0FIypPoaoseu N2GY14oZ5rpBK3wrc9YEARyrVdgqFpGRMIJ4FpAnbIcIx61bG8Tn7sRCDgYBD01kUT2k eYCg== X-Forwarded-Encrypted: i=1; AJvYcCUU2sSbvvIOYcSf8yHg9KBzmVTSjxrvQDdRh4vfxF251HiBGUB2/1hWOQq3ckCbbeTxRO/kbuQ6QOKyZ/Q=@vger.kernel.org X-Gm-Message-State: AOJu0YwSO4CLsGtJVSmWI2iGB7rk974VVi9iA/qeQGE5ov5sFjyQmacP JRFwqBnGlYM80Qs33ojkW9Yoqr4oA/bKYuilYVw5P4V9XOk37mcgtkoKLsM59kJloA== X-Gm-Gg: ASbGncsTd9Z4tisq70eGIhK1Fh53/ys9JCTrSMbwUNIK9udFNaF8tu04nsrWIQLzVxw j+Sgq5uRvUDTQ6KtGVv7RJugT5uKT+C6NuEl7/7TlF50O6N/5KF5gQ7bmH32VwroDU/fikdoMSn /gIxJFPa44VRMhY2yngA7oqhDXn11tThAWvqKyLQBkao9NKWl7v5YMr1mrnWMkqXF/XJOn9KvwL 8Fe1jhhy54eL8e2JOcfNWcKaM64vyycvGl2Si+HwO6a6IRME8RPmdm834UnwUESDUVicyxaDST0 OXLGhyU8x1XC0/ZTGHb65r+8AbnP1hO7Xe29Jc4nRppnLwvQrqiH8Sk49bc8eSn64GWwr9hp38v 5XSvssW99uxmQaunfamLv0STcxvyEldyYswAuVN2iowW/ZkS957RXn2xSOLNLw13kDcb+YWu9bw OIBB56iOKu2fU87u75SU6dlf0= X-Google-Smtp-Source: AGHT+IGFg5uCIhEU3lcn0qGmOLjSNLHjIAYyVFAFUM7gEwBM59gQGW1r0WNu8Fra1LpnKfzMHn+JxQ== X-Received: by 2002:a17:902:d607:b0:269:8f2e:e38 with SMTP id d9443c01a7336-29027356528mr293017275ad.6.1760393595967; Mon, 13 Oct 2025 15:13:15 -0700 (PDT) Received: from localhost ([2a00:79e0:2e7c:8:4cf5:d692:bb78:20c]) by smtp.gmail.com with UTF8SMTPSA id d9443c01a7336-29034f36cb1sm142736965ad.100.2025.10.13.15.13.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Oct 2025 15:13:15 -0700 (PDT) Date: Mon, 13 Oct 2025 15:13:12 -0700 From: Brian Norris To: Manivannan Sadhasivam Cc: Bjorn Helgaas , Mika Westerberg , Bjorn Helgaas , "Rafael J . Wysocki" , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH] PCI/PM: Avoid redundant delays on D3hot->D3cold Message-ID: References: <20251006193333.GA537409@bhelgaas> 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: On Mon, Oct 06, 2025 at 04:13:26PM -0700, Manivannan Sadhasivam wrote: > On Mon, Oct 06, 2025 at 02:33:33PM -0500, Bjorn Helgaas wrote: > > On Mon, Oct 06, 2025 at 11:32:38AM -0700, Brian Norris wrote: > > > Some PCI drivers call pci_set_power_state(..., PCI_D3hot) on their own > > > when preparing for runtime or system suspend, so by the time they hit > > > pci_finish_runtime_suspend(), they're in D3hot. Then, pci_target_state() > > > may still pick a lower state (D3cold). > > > > We might need this change, but maybe this is also an opportunity to > > remove some of those pci_set_power_state(..., PCI_D3hot) calls from > > drivers. > > > > Agree. The PCI client drivers should have no business in opting for D3Hot in the > suspend path. I dunno. There are various reasons a device might want to go to D3Hot some time before fully suspending the system, and possibly even before runtime suspend (or they may not support runtime PM at all). For example, on the first step on my alphabetical trawl through git grep -l '\' drivers/ I found a driver that supports some power-toggling via debugfs, in drivers/accel/habanalabs/common/debugfs.c. It would take nontrivial effort to evaluate every case like that for removal. BTW, we even have documentation for this: https://docs.kernel.org/power/pci.html#suspend "However, in some rare case it is convenient to carry out these operations in a PCI driver. Then, pci_save_state(), pci_prepare_to_sleep(), and pci_set_power_state() should be used to save the device's standard configuration registers, to prepare it for system wakeup (if necessary), and to put it into a low-power state, respectively." So sure, it should be rare (like the docs say), and it's probably redundant in many cases, but I'm not that interested in shaving various drivers' yaks right now. I'm just fixing a (small) performance regression in documented behavior. > It should be the other way around, they should opt-out if they > want by calling pci_save_state(), but that is also subject to discussion. FWIW, that's also documented in the above link. Brian