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 4254A11CA0 for ; Sat, 19 Jul 2025 13:46:08 +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=1752932768; cv=none; b=Mrp3JRpeHDttd4WtCy/Eeyn2MANRLwpb0AC/dBSXxyicHJeaVVxtvyVyYc+SFAA724XEJ/+xv3mbvCWg6Ym11dVTuv8QPBE1PVYzdkIu3P7K7yuxJMwTFfVn9js5fz0+bgut/gaHQXQXah5rs3d+LpVfiJ8mOd/hWmpW2siUte4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752932768; c=relaxed/simple; bh=zj7E57s5WlPmq2ubH4nObIRKkGkk4BY/jxuKDuJ0ZFs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=fqSZD9OgSNw+/kn2nmTCKfhAkwjNN6Sg7sAjo2QiSd9a9ckyuFmbEpEVVCUpr46hlbE6IEQJ/TFSbmncD+kspMeA3He51aNysU6NYbLzbj5mVIt/zrIoO92VsRjBQ+piuMIgUm/d3/lme3Wl48DPWdHvhqSP++8nfyZDRPHfjOM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=JbQqZBYs; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="JbQqZBYs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56882C4CEE3; Sat, 19 Jul 2025 13:46:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1752932767; bh=zj7E57s5WlPmq2ubH4nObIRKkGkk4BY/jxuKDuJ0ZFs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=JbQqZBYsI9jLZ9s7OTmYjYd+VNOBNuUr8NCo6mJSXrKhU0Kw2eZ8o8YDipXsBIu5m pKkmcXnMyBNC3tqVuUpUR4UqQVEAy49oklQkrEIAk0RBTO9ukPp3JtY8iz5SdodBaj jHtq1ZlymXJpsEfkFsz6UAEriBe0oWAYCczuTozvnkv4TACZHU15tDcslfDBPa3CAh C2qlF7ObtjlSUucve/NFVnN5D1hVO6sDdioY64cK1MsWHlNXQF9p8RVqk/sGSRIizR Fow+p1lFL/8cLlFMz/nujsg+uZ/cGdfNlLZjlks016ee+u/0ZF/bbqLQudKLWne8VZ 996SoIV+jvsyA== Message-ID: <793a0872-37a8-4fe7-bf68-b9072d7a6aec@kernel.org> Date: Sat, 19 Jul 2025 08:46:04 -0500 Precedence: bulk X-Mailing-List: linux-pci@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] PCI: Fix warning without CONFIG_VIDEO To: Manivannan Sadhasivam Cc: mario.limonciello@amd.com, bhelgaas@google.com, Stephen Rothwell , linux-pci@vger.kernel.org References: <20250718134134.1710578-1-superm1@kernel.org> <5gthsstizscrujhx46ybngtuny2lafmjwaidykn4rbvi6lr2by@jnuryin54ghx> Content-Language: en-US From: Mario Limonciello In-Reply-To: <5gthsstizscrujhx46ybngtuny2lafmjwaidykn4rbvi6lr2by@jnuryin54ghx> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 7/18/25 9:47 PM, Manivannan Sadhasivam wrote: > On Fri, Jul 18, 2025 at 12:26:49PM GMT, Mario Limonciello wrote: >> On 7/18/2025 12:23 PM, Manivannan Sadhasivam wrote: >>> On Fri, Jul 18, 2025 at 12:06:22PM GMT, Mario Limonciello wrote: >>>> On 7/18/2025 12:00 PM, Manivannan Sadhasivam wrote: >>>>> On Fri, Jul 18, 2025 at 08:41:33AM GMT, Mario Limonciello wrote: >>>>>> From: Mario Limonciello >>>>>> >>>>>> When compiled without CONFIG_VIDEO pci_create_boot_display_file() will >>>>>> never create a sysfs file for boot_display. Guard the sysfs file >>>>>> declaration against CONFIG_VIDEO. >>>>>> >>>>>> Reported-by: Stephen Rothwell >>>>>> Closes: https://lore.kernel.org/linux-next/20250718224118.5b3f22b0@canb.auug.org.au/ >>>>>> Signed-off-by: Mario Limonciello >>>>>> --- >>>>>> drivers/pci/pci-sysfs.c | 2 ++ >>>>>> 1 file changed, 2 insertions(+) >>>>>> >>>>>> diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c >>>>>> index 6b1a0ae254d3a..f6540a72204d3 100644 >>>>>> --- a/drivers/pci/pci-sysfs.c >>>>>> +++ b/drivers/pci/pci-sysfs.c >>>>>> @@ -680,12 +680,14 @@ const struct attribute_group *pcibus_groups[] = { >>>>>> NULL, >>>>>> }; >>>>>> +#ifdef CONFIG_VIDEO >>>>>> static ssize_t boot_display_show(struct device *dev, struct device_attribute *attr, >>>>>> char *buf) >>>>>> { >>>>>> return sysfs_emit(buf, "1\n"); >>>>>> } >>>>>> static DEVICE_ATTR_RO(boot_display); >>>>> >>>>> I failed to give my comment during the offending series itself, but it is never >>>>> late than never. Why are we adding non-PCI attributes under bus/pci in the first >>>>> place? Though the underlying device uses PCI as a transport, only the PCI bus >>>>> specific attrbutes should be placed under bus/pci and the driver/peripheral >>>>> specific attrbutes should belong to the respective bus/class/device hierarchy. >>>>> >>>>> Now, if other peripherals (like netdev) start adding these device specific >>>>> attributes under bus/pci, it will turn out to be a mess. >>>>> >>>>> - Mani >>>>> >>>> >>>> It was mostly to mirror the location of where boot_vga is, which arguably >>>> has the same issue you raise. >>>> >>> >>> Yes, I agree. But 'boot_vga' has set a bad precedence IMO. >>> >>>> I would be incredibly surprised if there was a proposal to add a >>>> 'boot_display' attribute from netdev.. >>> >>> Not 'boot_display' but why not 'boot_network' or something else. I was just >>> merely pointing out the fact that the other subsystems can start dumping >>> device/usecase specific attributes under bus/pci. >>> >>> - Mani >>> >> >> This is a pretty general problem that exists that attributes are first come >> first served. For example amdgpu adds mem_busy_percent and it has certain >> semantics. Now PCI core can't add that. >> >> And if nouveau.ko wants to add the same thing they need to follow the same >> semantics because userspace will look for those. > > But here, userspace is not yet looking for 'boot_display' isn't it? Why do you > need to mirror 'boot_vga' attribute? > I have a pull request opened in libpciaccess; but correct it has not been merged. /If/ we're to change this, what would you propose the path to be for this sysfs file?