summaryrefslogtreecommitdiff
path: root/drivers/char
AgeCommit message (Collapse)Author
2017-09-28ipmi: Make the IPMI proc interface configurableCorey Minyard
So we can remove it later. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-28ipmi_ssif: Add device attrs for the things in procCorey Minyard
Create a device attribute for everything we show in proc, getting ready for removing the proc stuff. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-28ipmi_si: Add device attrs for the things in procCorey Minyard
Create a device attribute for everything we show in proc, getting ready for removing the proc stuff. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-28ipmi_si: remove ipmi_smi_alloc() functionCorey Minyard
It's only used in one place now, so it's overkill. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-28ipmi_si: Move port and mem I/O handling to their own filesCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-28ipmi_si: Get rid of unused spacing and port fieldsCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-28ipmi_si: Move PARISC handling to another fileCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-28ipmi_si: Move PCI setup to another fileCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com> Stephen Rothwell <sfr@canb.auug.org.au> fixed an issue with the include files
2017-09-28ipmi_si: Move platform device handling to another fileCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com> Stephen Rothwell <sfr@canb.auug.org.au> fixed an issue with the include files
2017-09-27ipmi_si: Move hardcode handling to a separate file.Corey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi_si: Move the hotmod handling to another file.Corey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi_si: Change ipmi_si_add_smi() to take just I/O infoCorey Minyard
Instead of allocating the smi_info structure, filling in the I/O info, and passing it to ipmi_si_add_smi(), just pass the I/O info in the io structure and let ipmi_si_add_smi() allocate the smi_info structure. This required redoing the way the remove functions for some device interfaces worked, a new function named ipmi_si_remove_by_dev() allows the device to be passed in and detected instead of using driver data, which couldn't be filled out easily othersize. After this the platform handling should be decoupled from the smi_info structure and that handling can be pulled out to its own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi_si: Move io setup into io structureCorey Minyard
Where it belongs, and getting ready for pulling the platform handling into its own file. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi_si: Move irq setup handling into the io structCorey Minyard
So the platform code can do it without having to access the smi info, getting ready for pulling the platform handling section to their own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi_si: Move some platform data into the io structureCorey Minyard
That's where it belongs, and we are getting ready for moving the platform handling out of the main ipmi_si_intf.c file. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi_si: Rename function to add smi, make it globalCorey Minyard
Getting ready for moving the platform-specific stuff into their own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Convert IPMI GUID over to Linux guid_tCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Rescan channel list on BMC changesCorey Minyard
If the BMC changes versions or a change is otherwise detected, rescan the channels on the BMC. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Move lun and address out of channel structCorey Minyard
Put it in it's own struct, getting ready for channel information being dynamically changed. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Retry BMC registration on a failureCorey Minyard
If the BMC fails to register, just set up to retry periodically. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Rework device id and guid handling to catch changing BMCsCorey Minyard
A BMC's guid or device id info may change dynamically, this could result in a different configuration that needs to be done. Adjust the BMCs dynamically. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Use a temporary BMC for an interfaceCorey Minyard
This is getting ready for the ability to redo the BMC if it's information changes, we need a fallback mechanism. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Dynamically fetch GUID periodicallyCorey Minyard
This will catch if the GUID changes. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Always fetch the guid through ipmi_get_device_id()Corey Minyard
This is in preparation for making ipmi_get_device_id() dynamically return the guid and device id. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Remove the device id from ipmi_register_smi()Corey Minyard
It's no longer used, dynamic device id handling is in place now. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: allow dynamic BMC version informationJeremy Kerr
Currently, it's up to the IPMI SMIs to provide the product & version details of BMCs behind registered IPMI SMI interfaces. This device ID is provided on SMI regsitration, and kept around for all future queries. However, this version information isn't always static. For example, a BMC may be upgraded at runtime, making the old version information stale. This change allows querying the BMC device ID & version information dynamically. If no static device_id argument is provided to ipmi_register_smi, then the IPMI core code will perform a Get Device ID IPMI command to query the version information when needed. We keep a short-term cache of this information so we don't need to re-query for every attribute access. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> I basically rewrote this, I fixed some locking issues and simplified things. Same functional change, though. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Don't use BMC product/dev ids in the BMC nameCorey Minyard
There are a lot of bad things that a set of BMCs could do that would really confuse the IPMI driver; it's possible for BMCs with different GUIDs to have the same product/devid (though that's not technically legal), which would result in platform device namespace collisions. Fixing it would involve either using the GUID in the BMC name, which resulted in huge names, or just using an ida for numbering the BMCs. The latter approach was chosen to avoid the huge names. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Make ipmi_demangle_device_id more genericJeremy Kerr
Currently, ipmi_demagle_device_id requires a full response buffer in its data argument. This means we can't use it to parse a response in a struct ipmi_recv_msg, which has the netfn and cmd as separate bytes. This change alters the definition and users of ipmi_demangle_device_id to use a split netfn, cmd and data buffer, so it can be used with non-sequential responses. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Fixed the ipmi_ssif.c and ipmi_si_intf.c changes to use data from the response, not the data from the message, when passing info to the ipmi_demangle_device_id() function. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Add a reference from BMC devices to their interfacesJeremy Kerr
In an upcoming change, we'll want to grab a reference to the ipmi_smi_t from a struct bmc_device. This change adds a pointer to allow this. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Reworked to support multiple interfaces on a BMC. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Get the device id through a functionCorey Minyard
This makes getting the device id consistent, and make it possible to add a function to fetch it dynamically later. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Fix printing the BMC guidCorey Minyard
It was just wrong. Make it print according to the guid spec. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Rework BMC registrationCorey Minyard
There was a certain error case where the BMC wouldn't be deregistered like it should be. Rework the BMC registration to make calling ipmi_bmc_unregister() ok even if it's not registered and to clean up the error handling for ipmi_bmc_register(). Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Prefer ACPI system interfaces over SMBIOS onesCorey Minyard
The recent changes to add SMBIOS (DMI) IPMI interfaces as platform devices caused DMI to be selected before ACPI, causing ACPI type of operations to not work. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Fix issues with BMC refcountsCorey Minyard
BMC device refcounts were not being decremented after fetching from driver_find_device(). Also, document the use of ipmidriver_mutex and tighten it's span some by incrementing the BMC's usecount in the BMC find routines and not later. This will be important for future changes where a long mutex hold area will complicate things. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Check that the device type is BMC when scanning deviceCorey Minyard
Just an added safety check. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Move bmc find routing to below bmc device typeCorey Minyard
No functional change, this is for a later change that uses the bmc device type. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Fix getting the GUID dataCorey Minyard
It was off by one. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27IPMI: make ipmi_poweroff_handler constBhumika Goyal
Make this const as it is only passed to a const argument of the function ipmi_create_user. Signed-off-by: Bhumika Goyal <bhumirks@gmail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: Make IPMI panic strings always availableCorey Minyard
They were set by config items, but people complained that they were never turned on. So have them always available and enabled by a module parameter. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27char: ipmi: make function ipmi_get_info_from_resources staticColin Ian King
The function ipmi_get_info_from_resources is local to the source and does not need to be in global scope, so make it static. Add in newline to function declaration to make it checkpatch warning clean. Cleans up sparse warnings: symbol 'ipmi_get_info_from_resources' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-27ipmi: fix unsigned long underflowCorey Minyard
When I set the timeout to a specific value such as 500ms, the timeout event will not happen in time due to the overflow in function check_msg_timeout: ... ent->timeout -= timeout_period; if (ent->timeout > 0) return; ... The type of timeout_period is long, but ent->timeout is unsigned long. This patch makes the type consistent. Reported-by: Weilong Chen <chenweilong@huawei.com> Signed-off-by: Corey Minyard <cminyard@mvista.com> Tested-by: Weilong Chen <chenweilong@huawei.com> Cc: <stable@vger.kernel.org> # 3.16.x
2017-09-27char: ipmi: eliminate misleading print info when being probed via ACPIHanjun Guo
When ipmi is probed via ACPI, the boot log shows [ 17.945139] ipmi_si IPI0001:00: probing via device tree [ 17.950369] ipmi_si IPI0001:00: ipmi_si: probing via ACPI [ 17.955795] ipmi_si IPI0001:00: [io 0x00e4-0x3fff] regsize 1 spacing 1 irq 0 [ 17.962932] ipmi_si: Adding ACPI-specified bt state machine which "ipmi_si IPI0001:00: probing via device tree" is misleading with a ACPI HID "IPI0001" but probing via DT. Eliminate this misleading print info by checking of_node is valid or not before calling of_ipmi_probe(). Signed-off-by: Hanjun Guo <hanjun.guo@linaro.org> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-09-24Merge branch 'next-tpm' of ↵Linus Torvalds
git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security Pull TPM updates from James Morris: "Here are the TPM updates from Jarkko for v4.14, which I've placed in their own branch (next-tpm). I ended up cherry-picking them as other changes had been made in Jarkko's branch after he sent me his original pull request. I plan on maintaining a separate branch for TPM (and other security subsystems) from now on. From Jarkko: 'Not much this time except a few fixes'" * 'next-tpm' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security: tpm: ibmvtpm: simplify crq initialization and document crq format tpm: replace msleep() with usleep_range() in TPM 1.2/2.0 generic drivers Documentation: tpm: add powered-while-suspended binding documentation tpm: tpm_crb: constify acpi_device_id. tpm: vtpm: constify vio_device_id
2017-09-23tpm: ibmvtpm: simplify crq initialization and document crq formatMichal Suchanek
The crq is passed in registers and is the same on BE and LE hosts. However, current implementation allocates a structure on-stack to represent the crq, initializes the members swapping them to BE, and loads the structure swapping it from BE. This is pointless and causes GCC warnings about ununitialized members. Get rid of the structure and the warnings. Signed-off-by: Michal Suchanek <msuchanek@suse.de> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2017-09-23tpm: replace msleep() with usleep_range() in TPM 1.2/2.0 generic driversHamza Attak
The patch simply replaces all msleep function calls with usleep_range calls in the generic drivers. Tested with an Infineon TPM 1.2, using the generic tpm-tis module, for a thousand PCR extends, we see results going from 1m57s unpatched to 40s with the new patch. We obtain similar results when using the original and patched tpm_infineon driver, which is also part of the patch. Similarly with a STM TPM 2.0, using the CRB driver, it takes about 20ms per extend unpatched and around 7ms with the new patch. Note that the PCR consistency is untouched with this patch, each TPM has been tested with 10 million extends and the aggregated PCR value is continuously verified to be correct. As an extension of this work, this could potentially and easily be applied to other vendor's drivers. Still, these changes are not included in the proposed patch as they are untested. Signed-off-by: Hamza Attak <hamza@hpe.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2017-09-23tpm: tpm_crb: constify acpi_device_id.Arvind Yadav
acpi_device_id are not supposed to change at runtime. All functions working with acpi_device_id provided by <acpi/acpi_bus.h> work with const acpi_device_id. So mark the non-const structs as const. File size before: text data bss dec hex filename 4198 608 0 4806 12c6 drivers/char/tpm/tpm_crb.o File size After adding 'const': text data bss dec hex filename 4262 520 0 4782 12ae drivers/char/tpm/tpm_crb.o Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Tested-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2017-09-23tpm: vtpm: constify vio_device_idArvind Yadav
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 <arvind.yadav.cs@gmail.com> Reviewed-by: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> Signed-off-by: James Morris <james.l.morris@oracle.com>
2017-09-22hwrng: timeriomem - Remove 'max < 4' condition checkPrasannaKumar Muralidharan
In read routiene max is always >= 4. The check whether 'max < 4' is not necessary. Remove it. Signed-off-by: PrasannaKumar Muralidharan <prasannatsmkumar@gmail.com> Acked-By: Rick Altherr <raltherr@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-09-22hwrng: pseries - constify vio_device_idArvind Yadav
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 <arvind.yadav.cs@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
2017-09-14dmi: Mark all struct dmi_system_id instances constChristoph Hellwig
... and __initconst if applicable. Based on similar work for an older kernel in the Grsecurity patch. [JD: fix toshiba-wmi build] [JD: add htcpen] [JD: move __initconst where checkscript wants it] Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jean Delvare <jdelvare@suse.de>