aboutsummaryrefslogtreecommitdiff
path: root/drivers/char/hw_random/pseries-rng.c
AgeCommit message (Collapse)AuthorFilesLines
2021-05-21char: hw_random: pseries-rng: Demote non-conformant kernel-doc headerLee Jones1-1/+1
Fixes the following W=1 kernel build warning(s): drivers/char/hw_random/pseries-rng.c:42: warning: Function parameter or member 'vdev' not described in 'pseries_rng_get_desired_dma' Cc: Matt Mackall <[email protected]> Cc: Herbert Xu <[email protected]> Cc: Michael Ellerman <[email protected]> Cc: Benjamin Herrenschmidt <[email protected]> Cc: Paul Mackerras <[email protected]> Cc: Lijun Pan <[email protected]> Cc: "Uwe Kleine-König" <[email protected]> Cc: Tyrel Datwyler <[email protected]> Cc: Michael Neuling <[email protected]> Cc: [email protected] Cc: [email protected] Signed-off-by: Lee Jones <[email protected]> Reviewed-by: Arnd Bergmann <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2021-03-02vio: make remove callback return voidUwe Kleine-König1-2/+1
The driver core ignores the return value of struct bus_type::remove() because there is only little that can be done. To simplify the quest to make this function return void, let struct vio_driver::remove() return void, too. All users already unconditionally return 0, this commit makes it obvious that returning an error code is a bad idea. Note there are two nominally different implementations for a vio bus: one in arch/sparc/kernel/vio.c and the other in arch/powerpc/platforms/pseries/vio.c. This patch only adapts the powerpc one. Before this patch for a device that was bound to a driver without a remove callback vio_cmo_bus_remove(viodev) wasn't called. As the device core still considers the device unbound after vio_bus_remove() returns calling this unconditionally is the consistent behaviour which is implemented here. Signed-off-by: Uwe Kleine-König <[email protected]> Reviewed-by: Tyrel Datwyler <[email protected]> Acked-by: Lijun Pan <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> [mpe: Drop unneeded hvcs_remove() forward declaration, squash in change from sfr to drop ibmvnic_remove() forward declaration] Signed-off-by: Michael Ellerman <[email protected]> Link: https://lore.kernel.org/r/[email protected]
2019-06-05treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 333Thomas Gleixner1-13/+1
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 <[email protected]> Reviewed-by: Alexios Zavras <[email protected]> Reviewed-by: Allison Randal <[email protected]> Cc: [email protected] Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
2017-09-22hwrng: pseries - constify vio_device_idArvind Yadav1-1/+1
vio_device_id are not supposed to change at runtime. All functions working with vio_device_id provided by <asm/vio.h> work with const vio_device_id. So mark the non-const structs as const. Signed-off-by: Arvind Yadav <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2016-11-21hwrng: Make explicit that max >= 32 alwaysPrasannaKumar Muralidharan1-3/+2
As hw_random core calls ->read with max > 32 or more, make it explicit. Also remove checks involving 'max' being less than 8. Signed-off-by: PrasannaKumar Muralidharan <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2015-03-12hwrng: pseries - remove incorrect __init/__exit markupsDmitry Torokhov1-2/+2
Even if bus is not hot-pluggable, the devices can be unbound from the driver via sysfs, so we should not be using __exit annotations on remove() methods. The only exception is drivers registered with platform_driver_probe() which specifically disables sysfs bind/unbind attributes. Similarly probe() methods should not be marked __init unless platform_driver_probe() is used. Signed-off-by: Dmitry Torokhov <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2014-11-06hwrng: pseries - port to new read API and fix stack corruptionGreg Kurz1-4/+7
The add_early_randomness() function in drivers/char/hw_random/core.c passes a 16-byte buffer to pseries_rng_data_read(). Unfortunately, plpar_hcall() returns four 64-bit values and trashes 16 bytes on the stack. This bug has been lying around for a long time. It got unveiled by: commit d3cc7996473a7bdd33256029988ea690754e4e2a Author: Amit Shah <[email protected]> Date: Thu Jul 10 15:42:34 2014 +0530 hwrng: fetch randomness only after device init It may trig a oops while loading or unloading the pseries-rng module for both PowerVM and PowerKVM guests. This patch does two things: - pass an intermediate well sized buffer to plpar_hcall(). This is acceptalbe since we're not on a hot path. - move to the new read API so that we know the return buffer size for sure. Cc: [email protected] Signed-off-by: Greg Kurz <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2014-10-02hwrng: printk replacementSudip Mukherjee1-1/+1
as pr_* macros are more preffered over printk, so printk replaced with corresponding pr_* macros Signed-off-by: Sudip Mukherjee <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2013-10-07hwrng: pseries - Return errors to upper levels in pseries-rng.cMichael Ellerman1-3/+11
We don't expect to get errors from the hypervisor when reading the rng, but if we do we should pass the error up to the hwrng driver. Otherwise the hwrng driver will continue calling us forever. Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2013-10-07hwrng: pseries - Use KBUILD_MODNAME in pseries-rng.cMichael Ellerman1-3/+2
Signed-off-by: Michael Ellerman <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
2012-05-14powerpc/pseries/hwrng: PFO-based hwrng driverKent Yoder1-0/+96
Adds support for the Platform Facilities Option (PFO)-based hardware random number generator for POWER hardware. Signed-off-by: Michael Neuling <[email protected]> Signed-off-by: Robert Jennings <[email protected]> Signed-off-by: Kent Yoder <[email protected]> Signed-off-by: Benjamin Herrenschmidt <[email protected]>