Received: by 2002:ab2:6c55:0:b0:1fd:c486:4f03 with SMTP id v21csp216232lqp; Tue, 11 Jun 2024 21:52:20 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVBbiq1CFyJDH5NSgjucZrT5WD6iXJi/uqu+AVmDtQCeBIrvHvuDvBDM8RVusfEgrJaeYLaV9deFDzCTW2Mpg1gcFyH82oA/2aDPUWEtQ== X-Google-Smtp-Source: AGHT+IEm34ifRS+V4z9FjNUasCP/Oi16Sb5gfvOcFs/wT7GC2zoAHo8u0quJ9E8RioLvHaPkYA03 X-Received: by 2002:a25:b186:0:b0:dfe:43bd:6c6d with SMTP id 3f1490d57ef6-dfe66a639f7mr693821276.26.1718167940219; Tue, 11 Jun 2024 21:52:20 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718167940; cv=pass; d=google.com; s=arc-20160816; b=ZEzwvrwuRimQLxQRmj6zY9h3jSZ8AqEznpAGWA6rz/A+N0GEkqJRm5ODbi6WXkewFt c+PEevfrwQJK7+YGUpUc3U9RVZSEomhncZ23kQBoLz2DtxWnSh5xHPgSk0LdBLUPmfZc hMtK2Mzosx+sEuCl23JTxW47PHfJYfnwafKvGnaxX+xXWfZyThQ3PLrURo7blJD5L6WL zVwhm7t+q0S8h+GEUYCuyvtgZkPRpXhUP85zX7Q5lYPmWk9oa2t9Uv1dl+AKZ6pNnl+4 HvWrv/sOf9WenccCgt3x+5ncdQyYWpxTdSnbR6RD5UdT1YVGEzZpCejDY68779TMy9qB 4+3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=6jbDz/q6wcRoZ1s4H5xQqueBvHSS4EVcHxUuRix0Yk8=; fh=O7piYaIcF6TNu4eB7IFc1P7O3JUnwPiCqcludHuaDLQ=; b=eQGqjSapG/xO4+keNnePK8F5HM8QqAKl01gmoPgz9N4E1k5l/EjzjyFxKPaynAB4h1 OULMB+oj4bq2ZvcthYL+fEm3lUmxx+YckBSie75kQbMMVo5LOiPjS1sGeXIAcQiookNs 70G9i4BD6LYz3qUFjj4dGOiopMVWNKxukTlygSOV4/PUTRw4Q2OYMGzbuOZSbh3p4KIZ 6TntGKdiZ1y17kzVaMwQJpwi7MHMUw1JMeFDrKBay3k6E1yuwfKxIPpfepcFw0o4xBVS RikqnYM+H208D35CZxu6oEONYcykauWxZ/PuIvkFjLMz4tLb4Hdc5IjVjRotcIPGG6Gz kagQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7IRrFqw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 6a1803df08f44-6b07f5361efsi64851356d6.141.2024.06.11.21.52.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 21:52:20 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-210924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=V7IRrFqw; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-210924-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-210924-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id EA7741C23B3C for ; Wed, 12 Jun 2024 04:52:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5955D2C69B; Wed, 12 Jun 2024 04:52:10 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="V7IRrFqw" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 6B61225605; Wed, 12 Jun 2024 04:52:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718167929; cv=none; b=BpQ3eU1ukxvK/D46qOGkVLfjKFpMIQYtqHk8Qa7hA/f6XnUK4HlhZMsEftFB5D5D2l5poIZRQX+Pgp+tvOOp0pY9NOL4n65eFzBsEbHumfRzJsZCRjZNGysphVwaElNKgHxjGetmsoYGS8V1tAHKoixLY1OuNMO0Mqigv4Ymjas= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718167929; c=relaxed/simple; bh=nruark1B8eb2OhgQvZff82JhFN78K2Md0UA5EQhbk50=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=bjBoLY0NUyfMrDVKwX7c2DXtw14htIl6vVw/2ob0/RhFfgS9S/zfWxcJgmoJnJtNKAZQpaM+nY/vzJ4kBpvHfSPHZnS+2+uoqxnLh9Dbxum6nDzyv/Ik6X0wtSEv8XpoCYrKqH0AgQkqHukJCmAxdCz9bYoRXizKnKl0mrX8sfc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=V7IRrFqw; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0DE53C4AF49; Wed, 12 Jun 2024 04:52:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718167929; bh=nruark1B8eb2OhgQvZff82JhFN78K2Md0UA5EQhbk50=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=V7IRrFqw0vhujpKJDtVvKy/JReetTM2vUKY8lFwSBdLERP26LrljRT7sIUxnryLMS PtF5NJONsUCKOD1fAsIa07+ST83Cw1LR99MSbvtuFbPK4lBbG3JY4YqfUXxfX98CON imTXIpJEjCIu8HJXvIk7XWPm7J3oM3t9UA4aGwk132kot/ZP9XqCjmnK1nfWO7UTAI zBMozZl8qxcKbh6Sa118tdpYL4owEzcMy0wHunJIlycHt4It1q7l7VuGBSOgaNfjTa Q3jDUa4tAwbTZMI1R0cmwU0lLBqotdjxi+J8j+Qf2baFEJvhnNQi5gpLvgZhRD6Zsa 2fJj7kXXsTfbQ== Received: by mail-ej1-f54.google.com with SMTP id a640c23a62f3a-a68b41ef3f6so722332666b.1; Tue, 11 Jun 2024 21:52:08 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCXaziy4HKAD78jNBt5FPSj8E2U9WYmY/PhupRdInU1r3Yno38JAR5m4R1uJUkQEbB24LZEnNvdNEcuLkmM/hXy51WIcIHyeNueJwhHym7FAMgwdMvqyG4AwQGYEZ4P2AWxMD50E9tzPnyE2/oH0fVgtj1QgsX6OyP+SA2DQUjQF X-Gm-Message-State: AOJu0YyxBV1Jl0QJHUBbnIr0hcknfzJmApkMp/E1AeAS1QkxBqstdIpR l6i+8dsnbljTdUrzBcERTUvCLX73nhjHQNMDNwNdeQVVXyDBZYbNPz5iACcPdVB7rrvZ5X+OXDo FREg3bvuGnFHgbdg33mDVXvMgCFw= X-Received: by 2002:a17:906:489:b0:a6e:7e1f:2eae with SMTP id a640c23a62f3a-a6f4800b167mr32026166b.74.1718167927547; Tue, 11 Jun 2024 21:52:07 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240605075419.3973256-1-zhanghongchen@loongson.cn> In-Reply-To: <20240605075419.3973256-1-zhanghongchen@loongson.cn> From: Huacai Chen Date: Wed, 12 Jun 2024 12:51:56 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2] PCI: use local_pci_probe when best selected cpu is offline To: Hongchen Zhang Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, loongarch@lists.linux.dev, stable@vger.kernel.org, Huacai Chen Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Hongchen, It seems you forgot to update the title which I have pointed out. :) And Bjorn, Could you please take some time to review this patch? Thank you. Huacai On Wed, Jun 5, 2024 at 3:54=E2=80=AFPM Hongchen Zhang wrote: > > When the best selected CPU is offline, work_on_cpu() will stuck forever. > This can be happen if a node is online while all its CPUs are offline > (we can use "maxcpus=3D1" without "nr_cpus=3D1" to reproduce it), Therefo= re, > in this case, we should call local_pci_probe() instead of work_on_cpu(). > > Cc: > Signed-off-by: Huacai Chen > Signed-off-by: Hongchen Zhang > --- > v1 -> v2 Added the method to reproduce this issue > --- > drivers/pci/pci-driver.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/pci-driver.c b/drivers/pci/pci-driver.c > index af2996d0d17f..32a99828e6a3 100644 > --- a/drivers/pci/pci-driver.c > +++ b/drivers/pci/pci-driver.c > @@ -386,7 +386,7 @@ static int pci_call_probe(struct pci_driver *drv, str= uct pci_dev *dev, > free_cpumask_var(wq_domain_mask); > } > > - if (cpu < nr_cpu_ids) > + if ((cpu < nr_cpu_ids) && cpu_online(cpu)) > error =3D work_on_cpu(cpu, local_pci_probe, &ddi); > else > error =3D local_pci_probe(&ddi); > -- > 2.33.0 > >