summaryrefslogtreecommitdiffstats
path: root/drivers (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'ipmi-for-4.15' of git://github.com/cminyard/linux-ipmiLinus Torvalds2017-11-1619-2201/+2987
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pull IPMI updates from Corey Minyard: "This is a fairly large rework of the IPMI code, along with a bunch of smaller fixes. The major changes have been in the next tree for a couple of months, so they should be good to do in. - Some users had IPMI systems where the GUID of the IPMI controller could change. So rescanning of the GUID was added. The naming of some sysfs things was dependent on the GUID, however, so this resulted in the sysfs interface code in IPMI changing to remove that dependency and name the IPMI BMCs like other sysfs devices. - The ipmi_si_intf.c code was fairly bloated with all the different discovery methods (PCI, ACPI, SMBIOS, OF, platform, module parameters, hot add). The structure of how the interfaces were added was redone to make them more modular, then the individual methods were pulled out into their own files" * tag 'ipmi-for-4.15' of git://github.com/cminyard/linux-ipmi: (48 commits) ipmi_si: Delete an error message for a failed memory allocation in try_smi_init() ipmi_si: fix memory leak on new_smi ipmi: remove redundant initialization of bmc ipmi: pr_err() strings should end with newlines ipmi: Clean up some print operations ipmi: Make the DMI probe into a generic platform probe ipmi: Make the IPMI proc interface configurable ipmi_ssif: Add device attrs for the things in proc ipmi_si: Add device attrs for the things in proc ipmi_si: remove ipmi_smi_alloc() function ipmi_si: Move port and mem I/O handling to their own files ipmi_si: Get rid of unused spacing and port fields ipmi_si: Move PARISC handling to another file ipmi_si: Move PCI setup to another file ipmi_si: Move platform device handling to another file ipmi_si: Move hardcode handling to a separate file. ipmi_si: Move the hotmod handling to another file. ipmi_si: Change ipmi_si_add_smi() to take just I/O info ipmi_si: Move io setup into io structure ipmi_si: Move irq setup handling into the io struct ...
| * Merge branch 'modules-next' of ↵Corey Minyard2017-11-02347-1578/+2978
| |\ | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux into for-next The IPMI SI driver was split into different pieces, merge the module tree to accountfor that. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Delete an error message for a failed memory allocation in ↵Markus Elfring2017-10-171-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | try_smi_init() Omit an extra message for a memory allocation failure in this function. This issue was detected by using the Coccinelle software. Signed-off-by: Markus Elfring <elfring@users.sourceforge.net> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: fix memory leak on new_smiColin Ian King2017-10-171-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The error exit path omits kfree'ing the allocated new_smi, causing a memory leak. Fix this by kfree'ing new_smi. Detected by CoverityScan, CID#14582571 ("Resource Leak") Fixes: 7e030d6dff71 ("ipmi: Prefer ACPI system interfaces over SMBIOS ones") Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: remove redundant initialization of bmcColin Ian King2017-09-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pointer bmc is being initialized and this initialized value is never being read, so this is assignment redundant and can be removed. Cleans up clang warning: warning: Value stored to 'bmc' during its initialization is never read Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: pr_err() strings should end with newlinesArvind Yadav2017-09-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | pr_err() messages should terminated with a new-line to avoid other messages being concatenated onto the end. Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Clean up some print operationsCorey Minyard2017-09-281-56/+45
| | | | | | | | | | | | | | | | | | | | | Get rid of all printfs, using dev_xxx() if a device is available, pr_xxx() otherwise, and format long strings properly. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Make the DMI probe into a generic platform probeCorey Minyard2017-09-287-94/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rework the DMI probe function to be a generic platform probe, and then rework the DMI code (and a few other things) to use the more generic information. This is so other things can declare platform IPMI devices. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Make the IPMI proc interface configurableCorey Minyard2017-09-284-21/+40
| | | | | | | | | | | | | | | | | | So we can remove it later. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_ssif: Add device attrs for the things in procCorey Minyard2017-09-281-2/+74
| | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi_si: Add device attrs for the things in procCorey Minyard2017-09-281-1/+103
| | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi_si: remove ipmi_smi_alloc() functionCorey Minyard2017-09-281-10/+2
| | | | | | | | | | | | | | | | | | It's only used in one place now, so it's overkill. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move port and mem I/O handling to their own filesCorey Minyard2017-09-285-255/+263
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Get rid of unused spacing and port fieldsCorey Minyard2017-09-281-10/+0
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move PARISC handling to another fileCorey Minyard2017-09-284-57/+71
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move PCI setup to another fileCorey Minyard2017-09-284-161/+179
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com> Stephen Rothwell <sfr@canb.auug.org.au> fixed an issue with the include files
| * | ipmi_si: Move platform device handling to another fileCorey Minyard2017-09-284-589/+613
| | | | | | | | | | | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com> Stephen Rothwell <sfr@canb.auug.org.au> fixed an issue with the include files
| * | ipmi_si: Move hardcode handling to a separate file.Corey Minyard2017-09-274-147/+154
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move the hotmod handling to another file.Corey Minyard2017-09-274-244/+264
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Change ipmi_si_add_smi() to take just I/O infoCorey Minyard2017-09-273-309/+229
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi_si: Move io setup into io structureCorey Minyard2017-09-272-92/+85
| | | | | | | | | | | | | | | | | | | | | Where it belongs, and getting ready for pulling the platform handling into its own file. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi_si: Move irq setup handling into the io structCorey Minyard2017-09-273-81/+82
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi_si: Move some platform data into the io structureCorey Minyard2017-09-272-216/+213
| | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi_si: Rename function to add smi, make it globalCorey Minyard2017-09-272-16/+28
| | | | | | | | | | | | | | | | | | | | | Getting ready for moving the platform-specific stuff into their own files. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Convert IPMI GUID over to Linux guid_tCorey Minyard2017-09-271-27/+23
| | | | | | | | | | | | Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Rescan channel list on BMC changesCorey Minyard2017-09-271-58/+111
| | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Move lun and address out of channel structCorey Minyard2017-09-271-22/+25
| | | | | | | | | | | | | | | | | | | | | Put it in it's own struct, getting ready for channel information being dynamically changed. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Retry BMC registration on a failureCorey Minyard2017-09-271-1/+23
| | | | | | | | | | | | | | | | | | If the BMC fails to register, just set up to retry periodically. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Rework device id and guid handling to catch changing BMCsCorey Minyard2017-09-271-73/+167
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Use a temporary BMC for an interfaceCorey Minyard2017-09-271-9/+13
| | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Dynamically fetch GUID periodicallyCorey Minyard2017-09-271-19/+42
| | | | | | | | | | | | | | | | | | This will catch if the GUID changes. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Always fetch the guid through ipmi_get_device_id()Corey Minyard2017-09-271-28/+65
| | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Remove the device id from ipmi_register_smi()Corey Minyard2017-09-274-24/+1
| | | | | | | | | | | | | | | | | | It's no longer used, dynamic device id handling is in place now. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: allow dynamic BMC version informationJeremy Kerr2017-09-271-15/+190
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Don't use BMC product/dev ids in the BMC nameCorey Minyard2017-09-271-35/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Make ipmi_demangle_device_id more genericJeremy Kerr2017-09-272-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Add a reference from BMC devices to their interfacesJeremy Kerr2017-09-271-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Get the device id through a functionCorey Minyard2017-09-272-39/+127
| | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Fix printing the BMC guidCorey Minyard2017-09-271-3/+6
| | | | | | | | | | | | | | | | | | It was just wrong. Make it print according to the guid spec. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Rework BMC registrationCorey Minyard2017-09-271-23/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Prefer ACPI system interfaces over SMBIOS onesCorey Minyard2017-09-271-10/+23
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Fix issues with BMC refcountsCorey Minyard2017-09-271-16/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Check that the device type is BMC when scanning deviceCorey Minyard2017-09-271-3/+9
| | | | | | | | | | | | | | | | | | Just an added safety check. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Move bmc find routing to below bmc device typeCorey Minyard2017-09-271-50/+51
| | | | | | | | | | | | | | | | | | | | | No functional change, this is for a later change that uses the bmc device type. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | ipmi: Fix getting the GUID dataCorey Minyard2017-09-271-1/+1
| | | | | | | | | | | | | | | | | | It was off by one. Signed-off-by: Corey Minyard <cminyard@mvista.com>
| * | IPMI: make ipmi_poweroff_handler constBhumika Goyal2017-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: Make IPMI panic strings always availableCorey Minyard2017-09-272-23/+95
| | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | char: ipmi: make function ipmi_get_info_from_resources staticColin Ian King2017-09-271-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
| * | ipmi: fix unsigned long underflowCorey Minyard2017-09-271-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | char: ipmi: eliminate misleading print info when being probed via ACPIHanjun Guo2017-09-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>