Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'for-linus-5.8-1' of git://github.com/cminyard/linux-ipmi

Pull IPMI updates from Corey Minyard:
"A few small fixes for things, nothing earth shattering"

* tag 'for-linus-5.8-1' of git://github.com/cminyard/linux-ipmi:
ipmi:ssif: Remove dynamic platform device handing
Try to load acpi_ipmi when an SSIF ACPI IPMI interface is added
ipmi_si: Load acpi_ipmi when ACPI IPMI interface added
ipmi:bt-bmc: Fix error handling and status check
ipmi: Replace guid_copy() with import_guid() where it makes sense
ipmi: use vzalloc instead of kmalloc for user creation
ipmi:bt-bmc: Fix some format issue of the code
ipmi:bt-bmc: Avoid unnecessary check

+18 -38
+9 -12
drivers/char/ipmi/bt-bmc.c
··· 399 399 struct device *dev = &pdev->dev; 400 400 int rc; 401 401 402 - bt_bmc->irq = platform_get_irq(pdev, 0); 403 - if (!bt_bmc->irq) 404 - return -ENODEV; 402 + bt_bmc->irq = platform_get_irq_optional(pdev, 0); 403 + if (bt_bmc->irq < 0) 404 + return bt_bmc->irq; 405 405 406 406 rc = devm_request_irq(dev, bt_bmc->irq, bt_bmc_irq, IRQF_SHARED, 407 407 DEVICE_NAME, bt_bmc); 408 408 if (rc < 0) { 409 409 dev_warn(dev, "Unable to request IRQ %d\n", bt_bmc->irq); 410 - bt_bmc->irq = 0; 410 + bt_bmc->irq = rc; 411 411 return rc; 412 412 } 413 413 ··· 429 429 struct bt_bmc *bt_bmc; 430 430 struct device *dev; 431 431 int rc; 432 - 433 - if (!pdev || !pdev->dev.of_node) 434 - return -ENODEV; 435 432 436 433 dev = &pdev->dev; 437 434 dev_info(dev, "Found bt bmc device\n"); ··· 463 466 init_waitqueue_head(&bt_bmc->queue); 464 467 465 468 bt_bmc->miscdev.minor = MISC_DYNAMIC_MINOR, 466 - bt_bmc->miscdev.name = DEVICE_NAME, 467 - bt_bmc->miscdev.fops = &bt_bmc_fops, 468 - bt_bmc->miscdev.parent = dev; 469 + bt_bmc->miscdev.name = DEVICE_NAME, 470 + bt_bmc->miscdev.fops = &bt_bmc_fops, 471 + bt_bmc->miscdev.parent = dev; 469 472 rc = misc_register(&bt_bmc->miscdev); 470 473 if (rc) { 471 474 dev_err(dev, "Unable to register misc device\n"); ··· 474 477 475 478 bt_bmc_config_irq(bt_bmc, pdev); 476 479 477 - if (bt_bmc->irq) { 480 + if (bt_bmc->irq >= 0) { 478 481 dev_info(dev, "Using IRQ %d\n", bt_bmc->irq); 479 482 } else { 480 483 dev_info(dev, "No IRQ; using timer\n"); ··· 500 503 struct bt_bmc *bt_bmc = dev_get_drvdata(&pdev->dev); 501 504 502 505 misc_deregister(&bt_bmc->miscdev); 503 - if (!bt_bmc->irq) 506 + if (bt_bmc->irq < 0) 504 507 del_timer_sync(&bt_bmc->poll_timer); 505 508 return 0; 506 509 }
+5 -4
drivers/char/ipmi/ipmi_msghandler.c
··· 33 33 #include <linux/workqueue.h> 34 34 #include <linux/uuid.h> 35 35 #include <linux/nospec.h> 36 + #include <linux/vmalloc.h> 36 37 37 38 #define IPMI_DRIVER_VERSION "39.2" 38 39 ··· 1154 1153 remove_work); 1155 1154 1156 1155 cleanup_srcu_struct(&user->release_barrier); 1157 - kfree(user); 1156 + vfree(user); 1158 1157 } 1159 1158 1160 1159 int ipmi_create_user(unsigned int if_num, ··· 1186 1185 if (rv) 1187 1186 return rv; 1188 1187 1189 - new_user = kmalloc(sizeof(*new_user), GFP_KERNEL); 1188 + new_user = vzalloc(sizeof(*new_user)); 1190 1189 if (!new_user) 1191 1190 return -ENOMEM; 1192 1191 ··· 1233 1232 1234 1233 out_kfree: 1235 1234 srcu_read_unlock(&ipmi_interfaces_srcu, index); 1236 - kfree(new_user); 1235 + vfree(new_user); 1237 1236 return rv; 1238 1237 } 1239 1238 EXPORT_SYMBOL(ipmi_create_user); ··· 3172 3171 goto out; 3173 3172 } 3174 3173 3175 - guid_copy(&bmc->fetch_guid, (guid_t *)(msg->msg.data + 1)); 3174 + import_guid(&bmc->fetch_guid, msg->msg.data + 1); 3176 3175 /* 3177 3176 * Make sure the guid data is available before setting 3178 3177 * dyn_guid_set.
+2
drivers/char/ipmi/ipmi_si_platform.c
··· 393 393 dev_info(io.dev, "%pR regsize %d spacing %d irq %d\n", 394 394 res, io.regsize, io.regspacing, io.irq); 395 395 396 + request_module("acpi_ipmi"); 397 + 396 398 return ipmi_si_add_smi(&io); 397 399 398 400 err_free:
+2 -22
drivers/char/ipmi/ipmi_ssif.c
··· 189 189 struct device *dev; 190 190 struct i2c_client *client; 191 191 192 - struct i2c_client *added_client; 193 - 194 192 struct mutex clients_mutex; 195 193 struct list_head clients; 196 194 ··· 1470 1472 if (acpi_handle) { 1471 1473 ssif_info->addr_source = SI_ACPI; 1472 1474 ssif_info->addr_info.acpi_info.acpi_handle = acpi_handle; 1475 + request_module("acpi_ipmi"); 1473 1476 return true; 1474 1477 } 1475 1478 #endif ··· 1939 1940 goto out; 1940 1941 } 1941 1942 1942 - static int ssif_adapter_handler(struct device *adev, void *opaque) 1943 - { 1944 - struct ssif_addr_info *addr_info = opaque; 1945 - 1946 - if (adev->type != &i2c_adapter_type) 1947 - return 0; 1948 - 1949 - addr_info->added_client = i2c_new_client_device(to_i2c_adapter(adev), 1950 - &addr_info->binfo); 1951 - 1952 - if (!addr_info->adapter_name) 1953 - return 1; /* Only try the first I2C adapter by default. */ 1954 - return 0; 1955 - } 1956 - 1957 1943 static int new_ssif_client(int addr, char *adapter_name, 1958 1944 int debug, int slave_addr, 1959 1945 enum ipmi_addr_src addr_src, ··· 1982 1998 1983 1999 list_add_tail(&addr_info->link, &ssif_infos); 1984 2000 1985 - if (initialized) 1986 - i2c_for_each_dev(addr_info, ssif_adapter_handler); 1987 - /* Otherwise address list will get it */ 2001 + /* Address list will get it */ 1988 2002 1989 2003 out_unlock: 1990 2004 mutex_unlock(&ssif_infos_mutex); ··· 2102 2120 return 0; 2103 2121 2104 2122 mutex_lock(&ssif_infos_mutex); 2105 - i2c_unregister_device(addr_info->added_client); 2106 - 2107 2123 list_del(&addr_info->link); 2108 2124 kfree(addr_info); 2109 2125 mutex_unlock(&ssif_infos_mutex);