From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from sender4-pp-f112.zoho.com (sender4-pp-f112.zoho.com [136.143.188.112]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 37868421A07 for ; Wed, 21 Jan 2026 05:44:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.112 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768974290; cv=pass; b=XJC6arepbGkBH1kt7yY6bskPg1979x4ygc6kL+/n+gJfrB5B+xGhxHqxnZhloWqQjaovO1yBrpi0XxX385Ncdi4iWJgOje98JOFw577/dpNiKcqt/6niNFVcMbTQPcjIM3SCzzLrDj6g5NZj+DEL1+IMF0MQoALZzZ7rWlG+YbQ= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768974290; c=relaxed/simple; bh=4PWTClbVYiqM9bsGH66jagyZ4n7Vqd0EtwdIeYU8Rmw=; h=Date:From:To:Cc:Message-ID:In-Reply-To:References:Subject: MIME-Version:Content-Type; b=C4HTGDRyt9YReUOuGtVY0mdnxktxNSBR/nrl5iH6xkruI0BPo9s4Tl7IYtMs2ebyKUBUSv7XPPIelGlTSK2oHBq73fOoT0XmVGPMAA+se8Dd1Qbr+C+tsF03GgiYo9vbzrcTUNG+8Amf5Fj6mxEV7/otz27XX9T/FqLpq/5OnmI= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty; spf=pass smtp.mailfrom=linux.beauty; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b=JnCBp5t3; arc=pass smtp.client-ip=136.143.188.112 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=linux.beauty Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.beauty Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.beauty header.i=me@linux.beauty header.b="JnCBp5t3" ARC-Seal: i=1; a=rsa-sha256; t=1768974266; cv=none; d=zohomail.com; s=zohoarc; b=cZhpIDNUErIOAsEPvqPjjZg9iLKjz/FVysEPCCQtO21OclWkEPHDDez7RGUqru/DM82VnGZx5hSDQW8N250m+Y/N7jjYQGVii2wnwkRpiRGHCAsrGwR28nnxiOLrKVt4/pgffpnxH9qY7QJoX5AdxJMxckwT4EjiEyfI2UsPtu8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1768974266; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:Subject:To:To:Message-Id:Reply-To; bh=M1IjJsuCkyCNJR7d9d5lc/Xs7l1v8A10Q9+aE6hDk5o=; b=hYTSU4u1ikruzES3hVVB5K0UDxwHSBv2D4D6qEClXOR14XiJIRHffx57Avp3Rni9qXKnvUp8ItDBssK0a7TTDVdgIn7I2yIiqN/l2ZcbKmnFzTtX6xxdpVGI+88Hc6ZSiW0ziqMFUQzsvKvqIQu5dXC3K/LctttYYWFMTMyEYiA= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=linux.beauty; spf=pass smtp.mailfrom=me@linux.beauty; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1768974266; s=zmail; d=linux.beauty; i=me@linux.beauty; h=Date:Date:From:From:To:To:Cc:Cc:Message-ID:In-Reply-To:References:Subject:Subject:MIME-Version:Content-Type:Content-Transfer-Encoding:Message-Id:Reply-To; bh=M1IjJsuCkyCNJR7d9d5lc/Xs7l1v8A10Q9+aE6hDk5o=; b=JnCBp5t3yTDjmowYYitEkKBOfBPh8Eg+jPPv2657RexlCYNGWHIsBk61dU9nJRDi xNm+EF/7Qkukq7i3zr6H+nEsAMReXOlWQFYtLszEojHIVu7EHaDZXuY/HJH2G2MoQMG w/UoysBoSj661XqFkLbU6DL/CBFwD3PvEULP8jzU= Received: from mail.zoho.com by mx.zohomail.com with SMTP id 1768974265002130.89096268231458; Tue, 20 Jan 2026 21:44:25 -0800 (PST) Date: Wed, 21 Jan 2026 13:44:24 +0800 From: Li Chen To: "David Airlie" Cc: "Lyude Paul" , "Maarten Lankhorst" , "Maxime Ripard" , "Thomas Zimmermann" , "Simona Vetter" , "dri-devel" , "nouveau" , "linux-kernel" , "Daniel Palmer" Message-ID: <19bdf152a97.5ffa0a07806790.470935296772844852@linux.beauty> In-Reply-To: <19bde331fbd.dd44bec734977.5910036498943757747@linux.beauty> References: <20260120121455.142960-1-me@linux.beauty> <19bde085588.1b451560725069.154128025837198067@linux.beauty> <19bde331fbd.dd44bec734977.5910036498943757747@linux.beauty> Subject: Re: [PATCH] nouveau: pci: quiesce GPU on shutdown 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="UTF-8" Content-Transfer-Encoding: quoted-printable Importance: Medium User-Agent: Zoho Mail X-Mailer: Zoho Mail Hi Dave, > Hi Danilo >=20 > > On Wed Jan 21, 2026 at 1:50 AM CET, Li Chen wrote: > > > > > + usleep_range(200, 400);\ > > > >=20 > > > > Why is this needed? it at least needs a comment. > > > > > > This patch is needed for kexec/KHO/LUO reboot: firmware reset is sk= ipped, so the GPU may remain in an active/DMA=20 > > > state and the next kernel can fail to re-init nouveau. We can=E2=80= =99t call the full DRM/TTM teardown from ->shutdown() because > > > userspace may still hold DRM fds during shutdown, which triggers WA= RNs. > > > > > > So the shutdown hook reuses the suspend/quiesce path (safe with ope= n fds) and then powers down the PCI function (D3hot) > > > to leave the device in a consistent state for the next kernel. > >=20 > > I think the question was about the usleep_range() specifically. :) > > >=20 > Thanks for the hint.=20 >=20 > That usleep_range(200, 400) is just to give the PCI power transition tim= e to settle before an immediate kexec jump. >=20 > It=E2=80=99s mirroring the existing nouveau_pmops_suspend() behavior, w= hich already does udelay(200) right after pci_set_power_state(..., PCI_D3ho= t). In ->shutdown() we=E2=80=99re allowed to > sleep, so I used usleep_range() instead of a busy-wait udelay(). Dave, if this is ok, I would add it as comment in the next version. Regards, Li=E2=80=8B