summaryrefslogtreecommitdiffstats
path: root/drivers/char/ipmi/ipmi_si_hardcode.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* ipmi_si: Join string literals backAndy Shevchenko2021-04-021-34/+16
| | | | | | | | | | | For easy grepping on debug purposes join string literals back in the messages. No functional change. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Message-Id: <20210402174334.13466-11-andriy.shevchenko@linux.intel.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi_si: Reuse si_to_str[] array in ipmi_hardcode_init_one()Andy Shevchenko2021-04-021-14/+9
| | | | | | | | | Instead of making the comparison one by one, reuse si_to_str[] array in ipmi_hardcode_init_one() in conjunction with match_string() API. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Message-Id: <20210402174334.13466-7-andriy.shevchenko@linux.intel.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi: Add the i2c-addr property for SSIF interfacesCorey Minyard2019-04-241-0/+1
| | | | | | | | | | | | | | | | | This is required for SSIF to work. There was no way to know if the interface being added was SI or SSIF from the platform data, but that was required so the i2c-addr is only added for SSIF interfaces. So add a field for that. Also rework the logic a bit so that ipmi-type is not set for SSIF interfaces, as it is not necessary for that. Fixes: 3cd83bac481d ("ipmi: Consolidate the adding of platform devices") Reported-by: Kamlakant Patel <kamlakantp@marvell.com> Signed-off-by: Corey Minyard <cminyard@mvista.com> Cc: stable@vger.kernel.org # 5.1
* ipmi: ipmi_si_hardcode.c: init si_type array to fix a crashTony Camuso2019-04-161-0/+2
| | | | | | | | | | | | | | | | | | | | | | | The intended behavior of function ipmi_hardcode_init_one() is to default to kcs interface when no type argument is presented when initializing ipmi with hard coded addresses. However, the array of char pointers allocated on the stack by function ipmi_hardcode_init() was not inited to zeroes, so it contained stack debris. Consequently, passing the cruft stored in this array to function ipmi_hardcode_init_one() caused a crash when it was unable to detect that the char * being passed was nonsense and tried to access the address specified by the bogus pointer. The fix is simply to initialize the si_type array to zeroes, so if there were no type argument given to at the command line, function ipmi_hardcode_init_one() could properly default to the kcs interface. Signed-off-by: Tony Camuso <tcamuso@redhat.com> Message-Id: <1554837603-40299-1-git-send-email-tcamuso@redhat.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi_si: Consolidate scanning the platform busCorey Minyard2019-02-221-15/+1
| | | | | | The same basic code was in two places. Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi_si: Remove hardcode IPMI devices by scanning the platform busCorey Minyard2019-02-221-7/+15
| | | | | | | Instead of keeping track of each one, just scan the platform bus for hardcode devices and remove them. Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi: Consolidate the adding of platform devicesCorey Minyard2019-02-221-99/+18
| | | | | | | | | | | It was being done in two different places now that hard-coded devices use platform devices, and it's about to be three with hotmod switching to platform devices. So put the code in one place. This required some rework on some interfaces to make the type space clean. Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi_si: Rename addr_type to addr_space to match what it doesCorey Minyard2019-02-221-2/+2
| | | | | | Make the naming consistent, and make the values an enum. Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi_si: Fix crash when using hard-coded deviceCorey Minyard2019-02-221-62/+174
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When excuting a command like: modprobe ipmi_si ports=0xffc0e3 type=bt The system would get an oops. The trouble here is that ipmi_si_hardcode_find_bmc() is called before ipmi_si_platform_init(), but initialization of the hard-coded device creates an IPMI platform device, which won't be initialized yet. The real trouble is that hard-coded devices aren't created with any device, and the fixup is done later. So do it right, create the hard-coded devices as normal platform devices. This required adding some new resource types to the IPMI platform code for passing information required by the hard-coded device and adding some code to remove the hard-coded platform devices on module removal. To enforce the "hard-coded devices passed by the user take priority over firmware devices" rule, some special code was added to check and see if a hard-coded device already exists. Reported-by: Yang Yingliang <yangyingliang@huawei.com> Cc: stable@vger.kernel.org # v4.15+ Signed-off-by: Corey Minyard <cminyard@mvista.com> Tested-by: Yang Yingliang <yangyingliang@huawei.com>
* ipmi: Use more common logging stylesJoe Perches2018-09-181-4/+5
| | | | | | | | | | | | | | Add and use #define pr_fmt/dev_fmt, and remove #define PFX This also prefixes some messages that were not previously prefixed. Miscellanea: o Convert printk(KERN_<level> to pr_<level>( o Use %s, __func__ where appropriate Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Corey Minyard <cminyard@mvista.com>
* ipmi: Add or fix SPDX-License-Identifier in all filesCorey Minyard2018-02-271-0/+1
| | | | | | | | | | | And get rid of the license text that is no longer necessary. Signed-off-by: Corey Minyard <cminyard@mvista.com> Cc: Kees Cook <keescook@chromium.org> Cc: Alistair Popple <alistair@popple.id.au> Cc: Jeremy Kerr <jk@ozlabs.org> Cc: Joel Stanley <joel@jms.id.au> Cc: Rocky Craig <rocky.craig@hp.com>
* ipmi_si: Move hardcode handling to a separate file.Corey Minyard2017-09-271-0/+146
Signed-off-by: Corey Minyard <cminyard@mvista.com>