History log of /linux-master/drivers/parisc/pdc_stable.c
Revision Date Author Comments
# f28a9877 29-Jun-2023 Helge Deller <deller@gmx.de>

parisc: pdc_stable: Fix kdoc and compiler warnings

Signed-off-by: Helge Deller <deller@gmx.de>


# f2193bb2 22-Dec-2022 Xu Panda <xu.panda@zte.com.cn>

parisc: pdc_stable: use strscpy() to instead of strncpy()

The implementation of strscpy() is more robust and safer.
That's now the recommended way to copy NUL-terminated strings.

Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
Signed-off-by: Yang Yang <yang.yang29@zte.com>
Signed-off-by: Helge Deller <deller@gmx.de>


# 50f19697 21-Oct-2022 Helge Deller <deller@gmx.de>

parisc: Use signed char for hardware path in pdc.h

Clean up the struct for hardware_path and drop the struct device_path
with a proper assignment of bc[] and mod members as signed chars.

This patch prepares for the kbuild change from Jason A. Donenfeld to
treat char as always unsigned.

Signed-off-by: Helge Deller <deller@gmx.de>
Cc: Jason A. Donenfeld <Jason@zx2c4.com>


# d24846a4 19-Jan-2022 Miaoqian Lin <linmq006@gmail.com>

parisc: pdc_stable: Fix memory leak in pdcs_register_pathentries

kobject_init_and_add() takes reference even when it fails.
According to the doc of kobject_init_and_add():

If this function returns an error, kobject_put() must be called to
properly clean up the memory associated with the object.

Fix memory leak by calling kobject_put().

Fixes: 73f368cf679b ("Kobject: change drivers/parisc/pdc_stable.c to use kobject_init_and_add")
Signed-off-by: Miaoqian Lin <linmq006@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>


# 75c09aad 06-Jan-2022 Greg Kroah-Hartman <gregkh@linuxfoundation.org>

parisc: pdc_stable: use default_groups in kobj_type

There are currently 2 ways to create a set of sysfs files for a
kobj_type, through the default_attrs field, and the default_groups
field. Move the parisc pdc_stable sysfs code to use default_groups
field which has been the preferred way since aa30f47cf666 ("kobject: Add
support for default attribute groups to kobj_type") so that we can soon
get rid of the obsolete default_attrs field.

Cc: "James E.J. Bottomley" <James.Bottomley@HansenPartnership.com>
Cc: Helge Deller <deller@gmx.de>
Cc: linux-parisc@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Helge Deller <deller@gmx.de>


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

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

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 version 2 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 you should have received a copy of the gnu general
public license along with this program if not write to the free
software foundation inc 59 temple place suite 330 boston ma 02111
1307 usa

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-only

has been chosen to replace the boilerplate/reference in 136 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/20190530000436.384967451@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 93964fd4 31-Jul-2017 James Bottomley <James.Bottomley@HansenPartnership.com>

parisc: pdc_stable: Fix locking when creating sysfs links

There's no need to take the write lock when creating sysfs links.

This patch fixes the following BUG:
BUG: sleeping function called from invalid context at mm/slab.h:416
in_atomic(): 1, irqs_disabled(): 0, pid: 1, name: swapper/0
CPU: 2 PID: 1 Comm: swapper/0 Not tainted 4.13.0-rc2-00110-g0b5477d9dabd #111
Backtrace:
[<0000000040217ac8>] show_stack+0x20/0x38
[<00000000406fbbb0>] dump_stack+0xb0/0x128
[<0000000040274090>] ___might_sleep+0x180/0x1b8
[<0000000040274144>] __might_sleep+0x7c/0xe8
[<0000000040373874>] kmem_cache_alloc+0x14c/0x1e0
[<0000000040419514>] __kernfs_new_node+0x84/0x1b8
[<000000004041b09c>] kernfs_new_node+0x3c/0x78
[<000000004041e040>] kernfs_create_link+0x40/0xd8
[<000000004041f320>] sysfs_do_create_link_sd.isra.0+0xb0/0x130
[<000000004041f3d4>] sysfs_create_link+0x34/0x58
[<000000004011b4a4>] pdc_stable_init+0x2c4/0x458
[<0000000040200250>] do_one_initcall+0x70/0x1d8
[<0000000040101644>] kernel_init_freeable+0x27c/0x390
[<000000004020be44>] kernel_init+0x24/0x1c0

Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
Reported-by: Meelis Roos <mroos@linux.ee>
Signed-off-by: Helge Deller <deller@gmx.de>


# 343fdfb7 11-Jul-2017 Arvind Yadav <arvind.yadav.cs@gmail.com>

parisc: pdc_stable: constify attribute_group structures.

attribute_groups are not supposed to change at runtime. All functions
working with attribute_groups provided by <linux/sysfs.h> work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>


# 7c0f6ba6 24-Dec-2016 Linus Torvalds <torvalds@linux-foundation.org>

Replace <asm/uaccess.h> with <linux/uaccess.h> globally

This was entirely automated, using the script by Al:

PATT='^[[:blank:]]*#[[:blank:]]*include[[:blank:]]*<asm/uaccess.h>'
sed -i -e "s!$PATT!#include <linux/uaccess.h>!" \
$(git grep -l "$PATT"|grep -v ^include/linux/uaccess.h)

to do the replacement at the end of the merge window.

Requested-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# c735483d 21-Sep-2014 Helge Deller <deller@gmx.de>

parisc: pdc_stable.c: Avoid potential stack overflows

Signed-off-by: Helge Deller <deller@gmx.de>


# 94c457de 14-Sep-2014 Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>

parisc: pdc_stable.c: Cleaning up unnecessary use of memset in conjunction with strncpy

Using memset before strncpy just to ensure a trailing null character is
an unnecessary double writing of a string

Patch modified by Helge Deller to additionally reduce stack usage.

Signed-off-by: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Signed-off-by: Helge Deller <deller@gmx.de>


# 93c3e913 03-Nov-2012 Julia Lawall <Julia.Lawall@lip6.fr>

drivers/parisc/pdc_stable.c: use WARN

Use WARN rather than printk followed by WARN_ON(1), for conciseness.

Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr>
Signed-off-by: Helge Deller <deller@gmx.de>


# 25985edc 30-Mar-2011 Lucas De Marchi <lucas.demarchi@profusion.mobi>

Fix common misspellings

Fixes generated by 'codespell' and manually reviewed.

Signed-off-by: Lucas De Marchi <lucas.demarchi@profusion.mobi>


# 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>


# e7d2860b 14-Dec-2009 André Goddard Rosa <andre.goddard@gmail.com>

tree-wide: convert open calls to remove spaces to skip_spaces() lib function

Makes use of skip_spaces() defined in lib/string.c for removing leading
spaces from strings all over the tree.

It decreases lib.a code size by 47 bytes and reuses the function tree-wide:
text data bss dec hex filename
64688 584 592 65864 10148 (TOTALS-BEFORE)
64641 584 592 65817 10119 (TOTALS-AFTER)

Also, while at it, if we see (*str && isspace(*str)), we can be sure to
remove the first condition (*str) as the second one (isspace(*str)) also
evaluates to 0 whenever *str == 0, making it redundant. In other words,
"a char equals zero is never a space".

Julia Lawall tried the semantic patch (http://coccinelle.lip6.fr) below,
and found occurrences of this pattern on 3 more files:
drivers/leds/led-class.c
drivers/leds/ledtrig-timer.c
drivers/video/output.c

@@
expression str;
@@

( // ignore skip_spaces cases
while (*str && isspace(*str)) { \(str++;\|++str;\) }
|
- *str &&
isspace(*str)
)

Signed-off-by: André Goddard Rosa <andre.goddard@gmail.com>
Cc: Julia Lawall <julia@diku.dk>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Cc: Richard Purdie <rpurdie@rpsys.net>
Cc: Neil Brown <neilb@suse.de>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: David Howells <dhowells@redhat.com>
Cc: <linux-ext4@vger.kernel.org>
Cc: Samuel Ortiz <samuel@sortiz.org>
Cc: Patrick McHardy <kaber@trash.net>
Cc: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 447c233d 02-Aug-2009 Roel Kluin <roel.kluin@gmail.com>

parisc: Fix read buffer overflow in pdc_stable driver

Check whether index is within bounds before testing the element.

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>


# ff451d70 18-Feb-2008 Joel Soete <rubisher@scarlet.be>

[PARISC] pdc_stable: fix compile errors

Signed-off-by: Joel Soete <rubisher@scarlet.be>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.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>


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

Kobject: change drivers/parisc/pdc_stable.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: Kyle McMartin <kyle@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# c829a5b4 07-Nov-2007 Greg Kroah-Hartman <gregkh@suse.de>

kobject: convert parisc/pdc_stable to use kobject_create

Using a kset for this simple directory is an overkill.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Thibaut VARENE <varenet@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Kyle McMartin <kyle@parisc-linux.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>


# 4443d07f 02-Nov-2007 Greg Kroah-Hartman <gregkh@suse.de>

kset: convert parisc/pdc_stable.c to use kset_create

Dynamically create the kset instead of declaring it statically.
This makes the kobject attributes now work properly that I broke in the
previous patch.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Thibaut VARENE <varenet@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Kyle McMartin <kyle@parisc-linux.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 7f548217 02-Nov-2007 Greg Kroah-Hartman <gregkh@suse.de>

kobject: convert parisc/pdc_stable to kobj_attr interface

This makes the code a bit simpler and and gets us one step closer to
deleting the deprecated subsys_attr code.

NOTE, this needs the next patch in the series in order to work properly.
This will build, but the sysfs files will not properly operate.

Cc: Kay Sievers <kay.sievers@vrfy.org>
Cc: Thibaut VARENE <varenet@parisc-linux.org>
Cc: Matthew Wilcox <matthew@wil.cx>
Cc: Grant Grundler <grundler@parisc-linux.org>
Cc: Kyle McMartin <kyle@parisc-linux.org>
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>


# 26f03249 18-Oct-2007 Kyle McMartin <kyle@mcmartin.ca>

[PARISC] Quiet sysfs_create_link __must_check warnings in pdc_stable

Failing to create the links doesn't seem like a fatal error in these
paths. WARN_ON seems better than nothing though.

Signed-off-by: Kyle McMartin <kyle@mcmartin.ca>


# 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>


# ad46c548 25-May-2007 Kyle McMartin <kyle@parisc-linux.org>

[PARISC] kobject is embedded in subsys, not kset

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# 823bccfc 13-Apr-2007 Greg Kroah-Hartman <gregkh@suse.de>

remove "struct subsystem" as it is no longer needed

We need to work on cleaning up the relationship between kobjects, ksets and
ktypes. The removal of 'struct subsystem' is the first step of this,
especially as it is not really needed at all.

Thanks to Kay for fixing the bugs in this patch.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>


# 67a061a1 25-Jun-2006 Kyle McMartin <kyle@parisc-linux.org>

[PARISC] Add os_id_to_string helper

Add a helper to asm/pdc.h to translate OS_ID values to strings
and use it in the pdc_stable driver.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# ec1fdc24 21-Jun-2006 Kyle McMartin <kyle@parisc-linux.org>

[PARISC] OS_ID_LINUX == 0x0006

We were assigned an OS_ID of 0x0006. Consistently use OS_ID_LINUX
instead of using the magic number. Also update the OS_ID_ defines in
asm/pdc.h to reflect this.

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# b0e8bfca 04-May-2006 Thibaut Varene <varenet@parisc-linux.org>

[PARISC] Reduce data footprint in pdc_stable.c

No code change - reduce data footprint.

Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# 3f9edb53 04-May-2006 Thibaut Varene <varenet@parisc-linux.org>

[PARISC] pdc_stable version 0.30

pdc_stable v0.30:

This patch introduces 3 more files to the /sys/firmware/stable tree:
- diagnostic, which contains a cryptic hex string
- osdep1, a 16 bytes os-dependent storage area always available
- osdep2, another os-dependent storage area which existence/size depends
on hversion.

This patch also adds code to setup the "Linux" signature in stable
storage. That is to say that starting with this patch, the kernel will
now sign its OSID (0x0006, thx LaMont) in Stable Storage upon boot,
whether pdc_stable is enabled or not.

Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# 67a5a59d 27-Mar-2006 Helge Deller <deller@parisc-linux.org>

[PARISC] Misc. janitorial work

Fix a spelling mistake, add a KERN_INFO flag, and fix some whitespace
uglies.

Signed-off-by: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# a81dd18e 03-Feb-2006 Thibaut VARENE <varenet@parisc-linux.org>

[PARISC] Clarify pdc_stable license terms

pdc_stable.c is explicitly licensed under GPL version 2.

Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# c7428422 11-Jan-2006 Thibaut VARENE <varenet@parisc-linux.org>

[PARISC] pdc_stable version 0.22

pdc_stable v0.22, changes since v0.10:

o renamed root subsystem from 'pdc' to 'stable'
o split 'info' into several files, one per PDC field
o implemented 'autoboot' and 'autosearch' write calls to toggle
these flags
o grant read permission to all users on "safe" files
o more code cleanup (removed duplicate code)
o avoid bad stable storage clobbering by write locking critical sections
o print consistent data as well
o SMP cleanups

Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# c59ede7b 11-Jan-2006 Randy Dunlap <rdunlap@infradead.org>

[PATCH] move capable() to capability.h

- Move capable() from sched.h to capability.h;

- Use <linux/capability.h> where capable() is used
(in include/, block/, ipc/, kernel/, a few drivers/,
mm/, security/, & sound/;
many more drivers/ to go)

Signed-off-by: Randy Dunlap <rdunlap@xenotime.net>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 4b991da7 10-Jan-2006 Thibaut VARENE <varenet@parisc-linux.org>

[PARISC] pdc_stable: More robust sysfs error checking

pdc_stable 0.10:
As mentioned on LKML, pdc_stable wasn't checky enough on the return
values of some calls. This patch makes it more robust to errors when
registering objects in sysfs.

Signed-off-by: Thibaut VARENE <varenet@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# 8039de10 10-Jan-2006 Helge Deller <deller@parisc-linux.org>

[PARISC] Add __read_mostly section for parisc

Flag a whole bunch of things as __read_mostly on parisc. Also flag a few
branches as unlikely() and cleanup a bit of code.

Signed-off-by: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# abff7543 21-Oct-2005 Randolph Chung <tausq@parisc-linux.org>

[PARISC] Avoid use of floating point in the kernel

don't use *printf %f in the kernel, mm'kay?

Signed-off-by: Randolph Chung <tausq@parisc-linux.org>

Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>


# 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!