From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f42.google.com (mail-pj1-f42.google.com [209.85.216.42]) (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 628FB2BE7DC for ; Sat, 14 Mar 2026 20:54:09 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773521650; cv=none; b=DPGqyHZiq97L6k5I1i/uV7I4LGpAN6XoHlIlrBYb/5x4wd0ZlWor9m+1UacS1DjLBpxygDcLkslBiHhGER761M8fdb5EszZ1eOLFhcrpAIIG7WilSkez4QrgZxYzK8zxPr6+6tL1maLAFgKiVOTabiCb94P4VlpgInln52Ug3cg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773521650; c=relaxed/simple; bh=CRsU+6ICttD3gKex3EXog5ECo86CbY1P5lEAfUFwBzo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IQtpjnvWkJVBiVwLn7rJjM+4DLMVjniel5Ex/g7TIHnP5uMBpZzuSEta5/RTFw4Qo9ULk7I25i3WDXjuiMrnFH3Fd6cVqjZEmBjirEP1nH+Ssr3yPeiKFz0TxbhHXwxV7ZNDtea2mlhDUuwBOLjvkNJrbYkHYk+Xsnb1FA2YXCU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com; spf=pass smtp.mailfrom=gmail.com; arc=none smtp.client-ip=209.85.216.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-pj1-f42.google.com with SMTP id 98e67ed59e1d1-35a1d4a095bso1398971a91.0 for ; Sat, 14 Mar 2026 13:54:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773521649; x=1774126449; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=oAGPFAKjNzDeumSjC72VjFRaDAA9KGhJNKncxPl46fM=; b=U+h8+k5o98MBsKu2Sfp/o+NB7JgsY4+fqm2WWN9Gse6Ae8uOn6gMhU+yQxfR2TdF7K iRpqoSZ9sf2ewHU0MtqO+w+hQM4x0UT4if6oi8IdYl7IlM6KHuIg0ZHwbwxNIn3xmRzO FM0m68A9ae0xNfB4bNi1ncYXTFME6qryLn28ezRGsb94KYqAVHzCVa0rnweoqeVlBxoU zvv00n9LxWkjNvDG4ZLBDDG8SHEqwUyTb9wx2G0dvI6leyJIiJIB2PnuzEWAWK0vWX2T H3mxdTc8MugcR4FGQgKXX6ACZpNLE8Mzg8R8eqLTktkSidu3PaxWDJdDGv/uzILcFWCf EgFw== X-Forwarded-Encrypted: i=1; AJvYcCWnWjcCSTFPHIsVTw87wF13kaiXO8nt2rX9Q5bd23L/emPjAKimEqcEWGLeTDzQboi2zATQ8W8yNP04nXc=@vger.kernel.org X-Gm-Message-State: AOJu0YyPDJ1UfVwAY16GDx4AhlXTcOecwrXKuTSt1GX90063mdqaVW+x vTNu4RZcI914DEYlYw1HVJhAhCwZCt+HgW4QP6bzLJjrn7YjxhVB2Dfy X-Gm-Gg: ATEYQzwwUOGhUqtvuN0am+SVn9dT/wvuIpdfuaH51xn19eUrk1Xz6P3h4HHulheO/mE ri6sbesI6j3tjsos7pMicZeL9d/WsRQGJfnjOA06nGa1Vujz5GYIXzct6Z9NTXn2kxRymHa0/K+ CTqod/NTAI2OJEz5ELjlVJMk1URRt+yVu82kWiuQlrfCBjMXjAp+T0gDS7x20iLACAlcFUSi9Ar M7J2tBWjWe9NwBaoOT/NG6hXpGz1JIndczau9511ncvmGkbybiWy5g5U8DdS02+ZdFN78F2xyFv H0Lm+7xUvbw2nL0DgWwopuedJWsj+ZYlq2S/qylsM+vJKWJs5tUjA5RFITG8hzuyr3Ei8BSPCSU Mg3cJdUkeRhx7TUw1l40/uMunK0A2S3Ag++FjasyAMb3zNtOEpJB3Y2r8MwwM55eQBd0HJ2afbq D4EDfmyStHwL2HpLGkYax0Dr6zuUPMV7wLe7oqTZWH7BU8eprmEoZmyduj1lMzeNDCxgG7zjk3W Oldr29yoW0Gm9FA09H24ix2ACNYXzUuDS6jv9galNkUv4IPGSw= X-Received: by 2002:a17:90b:1c11:b0:356:7025:56c7 with SMTP id 98e67ed59e1d1-35a21e9ef5amr6144454a91.5.1773521648721; Sat, 14 Mar 2026 13:54:08 -0700 (PDT) Received: from localhost (fpd11144dd.ap.nuro.jp. [209.17.68.221]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-35b9230f2fasm1139953a91.9.2026.03.14.13.54.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Mar 2026 13:54:08 -0700 (PDT) Date: Sun, 15 Mar 2026 05:54:07 +0900 From: Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= To: lirongqing Cc: Bjorn Helgaas , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: sysfs: Suppress FW_BUG warning when NUMA node already matches Message-ID: <20260314205407.GB672783@rocinante> References: <20260313050826.2126-1-lirongqing@baidu.com> 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: <20260313050826.2126-1-lirongqing@baidu.com> Hello, > The numa_node sysfs interface allows users to manually override a PCI > device's NUMA node assignment. Currently, every write triggers a > FW_BUG warning and taints the kernel, even when writing the same value > that is already set. So, this works as intended, then? What makes multiple writes to this sysfs attribute, if you don't mind me asking? Do you have some tool that does this? Some automation? Especially, that you seem to be writing the same value over and over. > if (node != NUMA_NO_NODE && !node_online(node)) > return -EINVAL; > > - add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); > - pci_alert(pdev, FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates.", > - node); > + if (node != dev->numa_node) { > + add_taint(TAINT_FIRMWARE_WORKAROUND, LOCKDEP_STILL_OK); > + pci_alert(pdev, FW_BUG "Overriding NUMA node to %d. Contact your vendor for updates.", > + node); > + dev->numa_node = node; > + } You could invert the check and make it an early return where you just return count. Would save on the new indent level. Thank you! Krzysztof