History log of /linux-master/drivers/firmware/edd.c
Revision Date Author Comments
# f0312cbd 26-Feb-2023 Thomas Weißschuh <linux@weissschuh.net>

edd: make kobj_type structure constant

Since commit ee6d3dd4ed48 ("driver core: make kobj_type constant.")
the driver core allows the usage of const struct kobj_type.

Take advantage of this to constify the structure definition to prevent
modification at runtime.

Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
Link: https://lore.kernel.org/r/20230227-kobj_type-firmware-edd-v1-1-c626afe5bd05@weissschuh.net
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 5621a0bc 11-May-2022 Yang Yingliang <yangyingliang@huawei.com>

edd: simplify the check of 'attr->test' in edd_populate_dir()

attr->test check is not needed when !attr->test is false.

Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
Link: https://lore.kernel.org/r/20220511064622.3399164-1-yangyingliang@huawei.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# cebdc534 20-Apr-2022 Haowen Bai <baihaowen@meizu.com>

firmware: edd: Remove redundant condition

The logic (!A || (A && B)) is equivalent to (!A || B). so we have
to make code clear.

Signed-off-by: Haowen Bai <baihaowen@meizu.com>
Link: https://lore.kernel.org/r/1650505393-19398-1-git-send-email-baihaowen@meizu.com
Reviewed-by: Griffin Kroah-Hartman <griffin@kroah.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 3407d826 05-Jan-2022 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

firmware: edd: remove empty default_attrs array

The default_attrs array of attributes for the edd sysfs entries is
totally empty for some reason, and a list of attributes is added later
after the object is created (which should be fixed up later as it's
racy). Because this pointer is never used, and is empty, and we are
trying to remove all default_attrs usages, just delete it.

Link: https://lore.kernel.org/r/20220105182634.2802684-1-gregkh@linuxfoundation.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# dbdd24ea 20-Mar-2020 Takashi Iwai <tiwai@suse.de>

edd: Use scnprintf() for avoiding potential buffer overflow

Since snprintf() returns the would-be-output size instead of the
actual output size, the succeeding calls may go beyond the given
buffer limit. Fix it by replacing with scnprintf().

Link: https://lore.kernel.org/r/20200320084429.1803-1-tiwai@suse.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>


# d9523678 29-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 287

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license v2 0 as
published by the free software foundation this program is
distributed in the hope that it will be useful but without any
warranty without even the implied warranty of merchantability or
fitness for a particular purpose see the gnu general public license
for more details

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 23 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Alexios Zavras <alexios.zavras@intel.com>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190529141901.115786599@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# bade9835 09-Feb-2018 Johannes Thumshirn <jthumshirn@suse.de>

edd: don't spam log if no EDD information is present

We've had reports from users being concerned about messages like:

[ 4.487246] BIOS EDD facility v0.16 2004-Jun-25, 0 devices found
[ 4.487251] EDD information not available.

While these are more or less irrelevant, tell edd.c to not annoy anyone.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 2c2457a4 18-Dec-2017 Sinan Kaya <okaya@codeaurora.org>

edd: Deprecate pci_get_bus_and_slot()

pci_get_bus_and_slot() is restrictive such that it assumes domain=0 as
where a PCI device is present. This restricts the device drivers to be
reused for other domain numbers.

Getting ready to remove pci_get_bus_and_slot() function in favor of
pci_get_domain_bus_and_slot().

Domain number is not available in struct edd_info. Hard-coding the domain
number as 0.

Signed-off-by: Sinan Kaya <okaya@codeaurora.org>
Signed-off-by: Bjorn Helgaas <helgaas@kernel.org>


# 044aceef 28-Oct-2011 Michael Chan <mchan@broadcom.com>

[SCSI] edd: Treat "XPRS" host bus type the same as "PCI"

PCI Express devices will return "XPRS" host bus type during BIOS EDD
call. "XPRS" should be treated just like "PCI" so that the proper
pci_dev symlink will be created. Scripts such as fcoe_edd.sh will
then work correctly.

Signed-off-by: Michael Chan <mchan@broadcom.com>
Reviewed-by: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Yi Zou <yi.zou@intel.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>


# 0c612270 26-Apr-2011 Gleb Natapov <gleb@redhat.com>

x86, setup: Fix EDD3.0 data verification.

Check for nonzero path in edd_has_edd30() has no sense. First, it looks
at the wrong memory. Device path starts at offset 30 of the info->params
structure which is at offset 8 from the beginning of info structure,
but code looks at info + 4 instead. This was correct when code was
introduced, but around v2.6.4 three more fields were added to edd_info
structure (commit 66b61a5c in history.git). Second, even if it will check
correct memory it will always succeed since at offset 30 (params->key)
there will be non-zero values otherwise previous check would fail.

The patch replaces this bogus check with one that verifies checksum.

Signed-off-by: Gleb Natapov <gleb@redhat.com>
Link: http://lkml.kernel.org/r/20110426082132.GG2265@redhat.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>


# 631dd1a8 18-Oct-2010 Justin P. Mattock <justinmattock@gmail.com>

Update broken web addresses in the kernel.

The patch below updates broken web addresses in the kernel

Signed-off-by: Justin P. Mattock <justinmattock@gmail.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Finn Thain <fthain@telegraphics.com.au>
Cc: Randy Dunlap <rdunlap@xenotime.net>
Cc: Matt Turner <mattst88@gmail.com>
Cc: Dimitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Mike Frysinger <vapier.adi@gmail.com>
Acked-by: Ben Pfaff <blp@cs.stanford.edu>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Reviewed-by: Finn Thain <fthain@telegraphics.com.au>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>


# 1986aaf8 09-Aug-2010 Axel Lin <axel.lin@gmail.com>

edd: fix possible memory leak in edd_init() error path

The error may happen at any iteration of the for loop, this patch properly
unregisters already registed edd_devices in error path.

[akpm@linux-foundation.org: remove unneeded NULL test]
Signed-off-by: Axel Lin <axel.lin@gmail.com>
Cc: Stephen Hemminger <shemminger@vyatta.com>
Cc: Jens Axboe <jens.axboe@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 52cf25d0 18-Jan-2010 Emese Revfy <re.emese@gmail.com>

Driver core: Constify struct sysfs_ops in struct kobj_type

Constify struct sysfs_ops.

This is part of the ops structure constification
effort started by Arjan van de Ven et al.

Benefits of this constification:

* prevents modification of data that is shared
(referenced) by many other structure instances
at runtime

* detects/prevents accidental (but not intentional)
modification attempts on archs that enforce
read-only kernel data at runtime

* potentially better optimized code as the compiler
can assume that the const data cannot be changed

* the compiler/linker move const data into .rodata
and therefore exclude them from false sharing

Signed-off-by: Emese Revfy <re.emese@gmail.com>
Acked-by: David Teigland <teigland@redhat.com>
Acked-by: Matt Domsch <Matt_Domsch@dell.com>
Acked-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Acked-by: Hans J. Koch <hjk@linutronix.de>
Acked-by: Pekka Enberg <penberg@cs.helsinki.fi>
Acked-by: Jens Axboe <jens.axboe@oracle.com>
Acked-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# f6266e34 05-Jun-2008 Alexey Dobriyan <adobriyan@gmail.com>

edd: fix incorrect return of 1 from module_init

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# d48140e3 03-Feb-2008 Joe Perches <joe@perches.com>

drivers/firmware/: Spelling fixes

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Adrian Bunk <bunk@kernel.org>


# c10997f6 20-Dec-2007 Greg Kroah-Hartman <gregkh@suse.de>

Kobject: convert drivers/* from kobject_unregister() to kobject_put()

There is no need for kobject_unregister() anymore, thanks to Kay's
kobject cleanup changes, so replace all instances of it with
kobject_put().


Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# dd002e80 17-Dec-2007 Greg Kroah-Hartman <gregkh@suse.de>

Kobject: change drivers/firmware/edd.c to use kobject_init_and_add

Stop using kobject_register, as this way we can control the sending of
the uevent properly, after everything is properly initialized.

Cc: Matt Domsch <Matt_Domsch@dell.com>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# f62ed9e3 05-Nov-2007 Greg Kroah-Hartman <gregkh@suse.de>

firmware: change firmware_kset to firmware_kobj

There is no firmware "subsystem" it's just a directory in /sys that
other portions of the kernel want to hook into. So make it a kobject
not a kset to help alivate anyone who tries to do some odd kset-like
things with this.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 9651d350 02-Nov-2007 Greg Kroah-Hartman <gregkh@suse.de>

kset: convert edd to use kset_create

Dynamically create the kset instead of declaring it statically.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 3514faca 16-Oct-2007 Greg Kroah-Hartman <gregkh@suse.de>

kobject: remove struct kobj_type from struct kset

We don't need a "default" ktype for a kset. We should set this
explicitly every time for each kset. This change is needed so that we
can make ksets dynamic, and cleans up one of the odd, undocumented
assumption that the kset/kobject/ktype model has.

This patch is based on a lot of help from Kay Sievers.

Nasty bug in the block code was found by Dave Young
<hidave.darkstar@gmail.com>

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Dave Young <hidave.darkstar@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# e89a4116 11-Oct-2007 Greg Kroah-Hartman <gregkh@suse.de>

Driver core: rename ktype_edd and ktype_efivar

This makes it a bit more sane when trying to figure out how to clean up
the ktype mess.

Based on a larger patch from Kay Sievers

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 1b28f22a 16-Jul-2007 Alan Cox <alan@lxorguk.ukuu.org.uk>

edd: switch to pci_get based API

Signed-off-by: Alan Cox <alan@redhat.com>
Cc: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 7b595756 13-Jun-2007 Tejun Heo <htejun@gmail.com>

sysfs: kill unnecessary attribute->owner

sysfs is now completely out of driver/module lifetime game. After
deletion, a sysfs node doesn't access anything outside sysfs proper,
so there's no reason to hold onto the attribute owners. Note that
often the wrong modules were accounted for as owners leading to
accessing removed modules.

This patch kills now unnecessary attribute->owner. Note that with
this change, userland holding a sysfs node does not prevent the
backing module from being unloaded.

For more info regarding lifetime rule cleanup, please read the
following message.

http://article.gmane.org/gmane.linux.kernel/510293

(tweaked by Greg to not delete the field just yet, to make it easier to
merge things properly.)

Signed-off-by: Tejun Heo <htejun@gmail.com>
Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 6e8c8188 10-Feb-2007 Randy Dunlap <randy.dunlap@oracle.com>

[PATCH] docbook: add edd firmware interfaces

Cleanup kernel-doc notation in drivers/firmware/edd.c.

Add edd.c to DocBook/kernel-api.tmpl.

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Acked-by: Matt Domsch <Matt_Domsch@dell.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# f30c2269 03-Oct-2006 Uwe Zeisberger <Uwe_Zeisberger@digi.com>

fix file specification in comments

Many files include the filename at the beginning, serveral used a wrong one.

Signed-off-by: Uwe Zeisberger <Uwe_Zeisberger@digi.com>
Signed-off-by: Adrian Bunk <bunk@stusta.de>


# 9c215384 07-Nov-2005 Deepak Saxena <dsaxena@plexity.net>

[PATCH] drivers/firmware: kmalloc + memset -> kzalloc conversion

Signed-off-by: Deepak Saxena <dsaxena@plexity.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 70f2817a 29-Apr-2005 Dmitry Torokhov <dtor_core@ameritech.net>

[PATCH] sysfs: (rest) if show/store is missing return -EIO

sysfs: fix the rest of the kernel so if an attribute doesn't
implement show or store method read/write will return
-EIO instead of 0 or -EINVAL or -EPERM.

Signed-off-by: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!