From nobody Fri Apr 17 07:48:54 2026 Received: from mail-pf1-f171.google.com (mail-pf1-f171.google.com [209.85.210.171]) (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 6F1E7345753 for ; Mon, 23 Feb 2026 06:19:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771827572; cv=none; b=YOssKkn9kq3tH3csrZB2qyYLHiVm2QRXHmDsj8Y//ttMWsRVht4TAymZcyw1UW/1J9SJIvooiiq9Dg1qWrKA2uWkuFSttrcTkjmY2eTR88WzigZ6GGDTmBAfDKl4VNFlQdBQFvzo4jKcyP4JogMZdkG0x39uiJV6fo1iB0VKLRg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771827572; c=relaxed/simple; bh=PMWtXQ5cmgbjtLUXyGFJOXGJAgGMVKrspd+4+NPPee4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=j1GxySjBYbv1PlCSPWKwsLuqt1/betZOW589m0Wf3WKmIXi4FJkpocAY4l1XQNGAdlIczB5UrasSQRgKJO0WIulkWC0z8BPMiK1W1rpadt+Vb5CCK8+xsa/AOJ3CqD4tglflr/lE2AY1iMA+nK0pTPvutMDTXfzCpgWHHnScPhk= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.210.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kylinos.cn Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pf1-f171.google.com with SMTP id d2e1a72fcca58-823210d1d8eso2140579b3a.1 for ; Sun, 22 Feb 2026 22:19:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771827569; x=1772432369; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=/Z+tryQVOqPweIIFA1mPTB/Be9SSgz16ZuB1krdG7iU=; b=L8mDhyZBwYvVRAO2p8utFaihVrlahiUGmR4046woB1hASJtj/644rYEqeIf6aZZGt5 GSTg1EUDXNF65PUWdUCtWkS/Xru/3k+JQcT3AyReJzcQUtqzMlPt0LNL2qyrEauUriI7 3Ij5X+JwYU4y04jQ/zgaE9JomORsKBXpy8sMUkVb6mrhXriJTNzfqpY0fu007FfDGhmL k1olZuxBDmTSShk9250S7zHyqDe1WUQArCSyOT6JxFBSgYpuTuu2HsatbAuaWXcmyKr2 ATmniArKwjK1v7FL6NlCxcYIhhe+bxHwthwOdsXH8Sr2CPXTBJ2sCFAx/evIZkUKTnLw sTrQ== X-Forwarded-Encrypted: i=1; AJvYcCUtu1n3TivcLz2Sf3DKJbTC0trZBDxQwIhwuTAuQ+Gfg1tsgcva2xGM2Y9v8kXoS5MX0OHxqDFF+nD3dDs=@vger.kernel.org X-Gm-Message-State: AOJu0YxdSZiIancORbJ5aqOwg62EcA/jiX13G91f4qxG0aWQYkQ/ghrQ ntfg3fKuqT0o/8kkDFPkMFTcfXT67MaRqhSEGFQLX/eUtQ+jdPxwrQKQLrvCaQ== X-Gm-Gg: ATEYQzwLfQ35fHvercxQCyF+Ty/0HTlchQdx9QfxqENZm4ggSLdhjt4zZpQxWHUmr3w y435159BmG9ocsWWa8kQf+yxevOraHc5z6QRgQXRBHVODQk4PIg26dDWemiWDpREdEvGe+GYq/G hKytYtWI79WO1l+gZMdG5m0KfXYiBnmZYRPGA6Gipx4fJfRVD61emnUM5qG9N1Ejb8WuZnNtX/t 4FgBl1GZheB9lcH4JC5+iFoQKXHmdCHjFpC3tsR5injN31t+MT6naETnTnI0aHP82to0UV1sWQg bCm/JUJsQ5lVCji9QBCSitJT7ozSjFFpPbAE6N+tplNYtbi53q7bNCBNSvjul4aHmrExAzAAPzJ 7+CO9ex2KTOHhE5Lf9siBVOMy0lwK3KB58Mo4pZcx3sDXxF7cB8syNvhD4DVCpKFZ7PZuDBiCsO Ls81J4O3UmVxQlvPuY3hPT/Cvrvsi6RY6iEk/2U+4= X-Received: by 2002:a05:6a00:114e:b0:80a:fc3c:f839 with SMTP id d2e1a72fcca58-826daa947famr5619343b3a.49.1771827568745; Sun, 22 Feb 2026 22:19:28 -0800 (PST) Received: from localhost.localdomain ([116.128.244.169]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-826dd641b4dsm6762957b3a.11.2026.02.22.22.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Feb 2026 22:19:28 -0800 (PST) From: Hongyu Xie To: bhelgaas@google.com Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Hongyu Xie Subject: [RESEND PATCH v1] PCI: replace msleep to save waiting time Date: Mon, 23 Feb 2026 14:19:19 +0800 Message-Id: <20260223061919.1408000-1-xiehongyu1@kylinos.cn> X-Mailer: git-send-email 2.25.1 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" In pcie_wait_for_link_status, using msleep(1) to wait for link status change. But msleep(1) can sleep for nearly 5ms. ftrace shows: 0) | pcie_wait_for_link_status() { 0) 0.500 us | pcie_capability_read_word(); 0) 0.580 us | pcie_capability_read_word(); 0) * 10292.26 us | } after changing to usleep_range. ftrace shows: 0) | pcie_wait_for_link_status() { 0) 0.320 us | pcie_capability_read_word(); 0) 0.480 us | pcie_capability_read_word(); 0) # 2483.980 us | } So fix this by using usleep_range. Signed-off-by: Hongyu Xie --- drivers/pci/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index f3244630bfd0..68532e248e51 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c @@ -4519,7 +4519,7 @@ static int pcie_wait_for_link_status(struct pci_dev *= pdev, pcie_capability_read_word(pdev, PCI_EXP_LNKSTA, &lnksta); if ((lnksta & lnksta_mask) =3D=3D lnksta_match) return 0; - msleep(1); + usleep_range(1000, 1100); } while (time_before(jiffies, end_jiffies)); =20 return -ETIMEDOUT; --=20 2.25.1