summaryrefslogtreecommitdiff
path: root/drivers/char/ipmi/ipmi_ssif.c
AgeCommit message (Collapse)Author
2017-06-30ipmi:ssif: Add missing unlock in error branchCorey Minyard
When getting flags, a response to a different message would result in a deadlock because of a missing unlock. Add that unlock and a comment. Found by static analysis. Reported-by: Dan Carpenter <dan.carpenter@oracle.com> Cc: stable@vger.kernel.org # 3.19 Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-06-28ipmi:ssif: Check dev before setting drvdataCorey Minyard
dev can be NULL. Reported-by: Austin Christ <austinwc@codeaurora.org> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-06-19ipmi: Convert DMI handling over to a platform deviceCorey Minyard
Now that the IPMI DMI code creates a platform device for IPMI devices in the firmware, use that instead of handling all the DMI work in the IPMI drivers themselves. Signed-off-by: Corey Minyard <cminyard@mvista.com> Cc: Andy Lutomirski <luto@kernel.org>
2017-06-16ipmi:ssif: Use i2c_adapter_id instead of adapter->nrCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-05-17ipmi_ssif: remove redundant null check on array client->adapter->nameColin Ian King
The null check on client->adapter->name is redundant as name is an array of I2C_NAME_SIZE chars and hence can never be null. We may as well remove this redundant check. Detected by CoverityScan, CID#1375918 ("Array compared against 0") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-05-08ipmi_ssif: unlock on allocation failureDan Carpenter
We should unlock and re-enable IRQs if this allocation fails. Fixes: 259307074bfc ("ipmi: Add SMBus interface driver (SSIF) ") Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-04-07ipmi_ssif: use setup_timerGeliang Tang
Use setup_timer() instead of init_timer() to simplify the code. Signed-off-by: Geliang Tang <geliangtang@gmail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2017-04-07ipmi: Fix kernel panic at ipmi_ssif_thread()Joeseph Chang
msg_written_handler() may set ssif_info->multi_data to NULL when using ipmitool to write fru. Before setting ssif_info->multi_data to NULL, add new local pointer "data_to_send" and store correct i2c data pointer to it to fix NULL pointer kernel panic and incorrect ssif_info->multi_pos. Signed-off-by: Joeseph Chang <joechang@codeaurora.org> Signed-off-by: Corey Minyard <cminyard@mvista.com> Cc: stable@vger.kernel.org # 3.19-
2016-11-24ipmi: Pick up slave address from SMBIOS on an ACPI deviceCorey Minyard
When added by ACPI, the information does not contain the slave address of the BMC. However, that information is available from SMBIOS. So if we add a device that doesn't have a slave address, look at the other devices that are duplicate interfaces and see if they have a slave address. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2016-11-07ipmi_ssif: Remove an unused module parameterCorey Minyard
Signed-off-by: Corey Minyard <cminyard@mvista.com>
2016-06-17i2c: add a protocol parameter to the alert callbackBenjamin Tissoires
.alert() is meant to be generic, but there is currently no way for the device driver to know which protocol generated the alert. Add a parameter in .alert() to help the device driver to understand what is given in data. This patch is required to have the support of SMBus Host Notify protocol through .alert(). Tested-by: Andrew Duggan <aduggan@synaptics.com> For hwmon: Acked-by: Guenter Roeck <linux@roeck-us.net> For IPMI: Acked-by: Corey Minyard <cminyard@mvista.com> Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
2016-05-16ipmi: Fix the I2C address extraction from SPMI tablesCorey Minyard
Unlike everywhere else in the IPMI specification, the I2C address specified in the SPMI table is not shifted to the left one bit with the LSB zero. Instead it is not shifted with the MSB zero. Reported-by: Sanjeev <singhsan@codeaurora.org> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2016-03-18ipmi_ssif: Fix logic around alert handlingCorey Minyard
There was a mistake in the logic, if an alert came in very quickly it would hang the driver. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2016-01-12char: ipmi: Drop owner assignment from i2c_driverKrzysztof Kozlowski
i2c_driver does not need to set an owner because i2c_register_driver() will set it. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
2015-10-24char: ipmi: ipmi_ssif: Replace timeval with timespec64Amitoj Kaur Chawla
This patch replaces timeval with timespec64 as 32 bit 'struct timeval' will not give current time beyond 2038. The patch changes the code to use ktime_get_real_ts64() which returns a 'struct timespec64' instead of do_gettimeofday() which returns a 'struct timeval' This patch also alters the format string in pr_info() for now.tv_sec to incorporate 'long long' on 32 bit architectures. Signed-off-by: Amitoj Kaur Chawla <amitoj1606@gmail.com> Reviewed-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-09-03ipmi:ssif: Add a module parm to specify that SMBus alerts don't workCorey Minyard
They are broken on some platforms, this gives people a chance to work around it until the firmware is fixed. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-09-03ipmi: constify SSIF ACPI device idsMathias Krause
Constify the ACPI device ID array, it doesn't need to be writable at runtime. Signed-off-by: Mathias Krause <minipli@googlemail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-09-03char:ipmi - Change 1 to true for bool type variables during initialization.Shailendra Verma
Signed-off-by: Shailendra Verma <shailendra.capricorn@gmail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-05-05ipmi: Fix multi-part message handlingCorey Minyard
Lots of little fixes for multi-part messages: The values was not being re-initialized, if something went wrong handling a multi-part message and it got left in a bad state, it might be an issue. The commands were not correct when issuing multi-part reads, the code was not passing in the proper value for commands. Also clean up some minor formatting issues. Get the block number from the right location, limit the maximum send message size to 63 bytes and explain why, and fix some minor sylistic issues. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-05-05ipmi: Add alert handling to SSIFCorey Minyard
The SSIF interface can optionally have an SMBus alert come in when data is ready. Unfortunately, the IPMI spec gives wiggle room to the implementer to allow them to always have the alert enabled, even if the driver doesn't enable it. So implement alerts. If you don't in this situation, the SMBus alert handling will constantly complain. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-05-05ipmi: Remove unused including <linux/version.h>Wei Yongjun
Remove including <linux/version.h> that don't need it. Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-05-05ipmi: Remove incorrect use of seq_has_overflowedJoe Perches
commit d6c5dc18d863 ("ipmi: Remove uses of return value of seq_printf") incorrectly changed the return value of various proc_show functions to use seq_has_overflowed(). These functions should return 0 on completion rather than 1/true on overflow. 1 is the same as #define SEQ_SKIP which would cause the output to not be emitted (skipped) instead. This is a logical defect only as the length of these outputs are all smaller than the initial allocation done by the seq filesystem. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-05-05ipmi:ssif: Ignore spaces when comparing I2C adapter namesCorey Minyard
Some of the adapters have spaces in their names, but that's really hard to pass in as a module or kernel parameters. So ignore the spaces. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-05-05ipmi_ssif: Fix the logic on user-supplied addressesCorey Minyard
Returning zero is success. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-04-10ipmi_ssif: Use interruptible completion for waiting in the threadCorey Minyard
The code was using an normal completion, but that caused stuck task errors after a while. Use an interruptible one to avoid that. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-02-19ipmi: Remove uses of return value of seq_printfJoe Perches
The seq_printf like functions will soon be changed to return void. Convert these uses to check seq_has_overflowed instead. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2015-02-19char: ipmi: Remove obsolete cleanup for clientdataWolfram Sang
A few new i2c-drivers came into the kernel which clear the clientdata-pointer on exit or error. This is obsolete meanwhile, the core will do it. Signed-off-by: Wolfram Sang <wsa@the-dreams.de> Signed-off-by: Corey Minyard <cminyard@mvista.com>
2014-12-30ipmi: Fix compile warning with tv_usecCorey Minyard
It's not a long int on all arches. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2014-12-21ipmi: Fix compile issue with isspace()Corey Minyard
Some arches don't get ctypes.h included from these includes, so add it explicitly. Signed-off-by: Corey Minyard <cminyard@mvista.com>
2014-12-11ipmi: Add SMBus interface driver (SSIF)Corey Minyard
This patch adds the SMBus interface to the IPMI driver. Signed-off-by: Corey Minyard <minyard@acm.org> Documentation/IPMI.txt | 32 drivers/char/ipmi/Kconfig | 11 drivers/char/ipmi/Makefile | 1 drivers/char/ipmi/ipmi_smb.c | 1737 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1769 insertions(+), 12 deletions(-)