Merge tag 'char-misc-6.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char/misc fixes from Greg KH:
"Here are some small char/misc/other driver fixes for 6.11-rc3 for
reported issues. Included in here are:

- binder driver fixes

- fsi MODULE_DESCRIPTION() additions (people seem to love them...)

- eeprom driver fix

- Kconfig dependency fix to resolve build issues

- spmi driver fixes

All of these have been in linux-next for a while with no reported
problems"

* tag 'char-misc-6.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
spmi: pmic-arb: add missing newline in dev_err format strings
spmi: pmic-arb: Pass the correct of_node to irq_domain_add_tree
binder_alloc: Fix sleeping function called from invalid context
binder: fix descriptor lookup for context manager
char: add missing NetWinder MODULE_DESCRIPTION() macros
misc: mrvl-cn10k-dpi: add PCI_IOV dependency
eeprom: ee1004: Fix locking issues in ee1004_probe()
fsi: add missing MODULE_DESCRIPTION() macros

+81 -67
+6 -9
drivers/android/binder.c
··· 1044 } 1045 1046 /* Find the smallest unused descriptor the "slow way" */ 1047 - static u32 slow_desc_lookup_olocked(struct binder_proc *proc) 1048 { 1049 struct binder_ref *ref; 1050 struct rb_node *n; 1051 u32 desc; 1052 1053 - desc = 1; 1054 for (n = rb_first(&proc->refs_by_desc); n; n = rb_next(n)) { 1055 ref = rb_entry(n, struct binder_ref, rb_node_desc); 1056 if (ref->data.desc > desc) ··· 1071 u32 *desc) 1072 { 1073 struct dbitmap *dmap = &proc->dmap; 1074 unsigned long *new, bit; 1075 - unsigned int nbits; 1076 1077 /* 0 is reserved for the context manager */ 1078 - if (node == proc->context->binder_context_mgr_node) { 1079 - *desc = 0; 1080 - return 0; 1081 - } 1082 1083 if (!dbitmap_enabled(dmap)) { 1084 - *desc = slow_desc_lookup_olocked(proc); 1085 return 0; 1086 } 1087 1088 - if (dbitmap_acquire_first_zero_bit(dmap, &bit) == 0) { 1089 *desc = bit; 1090 return 0; 1091 }
··· 1044 } 1045 1046 /* Find the smallest unused descriptor the "slow way" */ 1047 + static u32 slow_desc_lookup_olocked(struct binder_proc *proc, u32 offset) 1048 { 1049 struct binder_ref *ref; 1050 struct rb_node *n; 1051 u32 desc; 1052 1053 + desc = offset; 1054 for (n = rb_first(&proc->refs_by_desc); n; n = rb_next(n)) { 1055 ref = rb_entry(n, struct binder_ref, rb_node_desc); 1056 if (ref->data.desc > desc) ··· 1071 u32 *desc) 1072 { 1073 struct dbitmap *dmap = &proc->dmap; 1074 + unsigned int nbits, offset; 1075 unsigned long *new, bit; 1076 1077 /* 0 is reserved for the context manager */ 1078 + offset = (node == proc->context->binder_context_mgr_node) ? 0 : 1; 1079 1080 if (!dbitmap_enabled(dmap)) { 1081 + *desc = slow_desc_lookup_olocked(proc, offset); 1082 return 0; 1083 } 1084 1085 + if (dbitmap_acquire_next_zero_bit(dmap, offset, &bit) == 0) { 1086 *desc = bit; 1087 return 0; 1088 }
+1 -1
drivers/android/binder_alloc.c
··· 939 __free_page(alloc->pages[i].page_ptr); 940 page_count++; 941 } 942 - kvfree(alloc->pages); 943 } 944 spin_unlock(&alloc->lock); 945 if (alloc->mm) 946 mmdrop(alloc->mm); 947
··· 939 __free_page(alloc->pages[i].page_ptr); 940 page_count++; 941 } 942 } 943 spin_unlock(&alloc->lock); 944 + kvfree(alloc->pages); 945 if (alloc->mm) 946 mmdrop(alloc->mm); 947
+7 -15
drivers/android/dbitmap.h
··· 6 * 7 * Used by the binder driver to optimize the allocation of the smallest 8 * available descriptor ID. Each bit in the bitmap represents the state 9 - * of an ID, with the exception of BIT(0) which is used exclusively to 10 - * reference binder's context manager. 11 * 12 * A dbitmap can grow or shrink as needed. This part has been designed 13 * considering that users might need to briefly release their locks in ··· 57 if (bit < (dmap->nbits >> 2)) 58 return dmap->nbits >> 1; 59 60 - /* 61 - * Note that find_last_bit() returns dmap->nbits when no bits 62 - * are set. While this is technically not possible here since 63 - * BIT(0) is always set, this check is left for extra safety. 64 - */ 65 if (bit == dmap->nbits) 66 return NBITS_MIN; 67 ··· 127 } 128 129 /* 130 - * Finds and sets the first zero bit in the bitmap. Upon success @bit 131 * is populated with the index and 0 is returned. Otherwise, -ENOSPC 132 * is returned to indicate that a dbitmap_grow() is needed. 133 */ 134 static inline int 135 - dbitmap_acquire_first_zero_bit(struct dbitmap *dmap, unsigned long *bit) 136 { 137 unsigned long n; 138 139 - n = find_first_zero_bit(dmap->map, dmap->nbits); 140 if (n == dmap->nbits) 141 return -ENOSPC; 142 ··· 150 static inline void 151 dbitmap_clear_bit(struct dbitmap *dmap, unsigned long bit) 152 { 153 - /* BIT(0) should always set for the context manager */ 154 - if (bit) 155 - clear_bit(bit, dmap->map); 156 } 157 158 static inline int dbitmap_init(struct dbitmap *dmap) ··· 162 } 163 164 dmap->nbits = NBITS_MIN; 165 - /* BIT(0) is reserved for the context manager */ 166 - set_bit(0, dmap->map); 167 168 return 0; 169 }
··· 6 * 7 * Used by the binder driver to optimize the allocation of the smallest 8 * available descriptor ID. Each bit in the bitmap represents the state 9 + * of an ID. 10 * 11 * A dbitmap can grow or shrink as needed. This part has been designed 12 * considering that users might need to briefly release their locks in ··· 58 if (bit < (dmap->nbits >> 2)) 59 return dmap->nbits >> 1; 60 61 + /* find_last_bit() returns dmap->nbits when no bits are set. */ 62 if (bit == dmap->nbits) 63 return NBITS_MIN; 64 ··· 132 } 133 134 /* 135 + * Finds and sets the next zero bit in the bitmap. Upon success @bit 136 * is populated with the index and 0 is returned. Otherwise, -ENOSPC 137 * is returned to indicate that a dbitmap_grow() is needed. 138 */ 139 static inline int 140 + dbitmap_acquire_next_zero_bit(struct dbitmap *dmap, unsigned long offset, 141 + unsigned long *bit) 142 { 143 unsigned long n; 144 145 + n = find_next_zero_bit(dmap->map, dmap->nbits, offset); 146 if (n == dmap->nbits) 147 return -ENOSPC; 148 ··· 154 static inline void 155 dbitmap_clear_bit(struct dbitmap *dmap, unsigned long bit) 156 { 157 + clear_bit(bit, dmap->map); 158 } 159 160 static inline int dbitmap_init(struct dbitmap *dmap) ··· 168 } 169 170 dmap->nbits = NBITS_MIN; 171 172 return 0; 173 }
+1
drivers/char/ds1620.c
··· 421 module_init(ds1620_init); 422 module_exit(ds1620_exit); 423 424 MODULE_LICENSE("GPL");
··· 421 module_init(ds1620_init); 422 module_exit(ds1620_exit); 423 424 + MODULE_DESCRIPTION("Dallas Semiconductor DS1620 thermometer driver"); 425 MODULE_LICENSE("GPL");
+1
drivers/char/nwbutton.c
··· 241 242 243 MODULE_AUTHOR("Alex Holden"); 244 MODULE_LICENSE("GPL"); 245 246 module_init(nwbutton_init);
··· 241 242 243 MODULE_AUTHOR("Alex Holden"); 244 + MODULE_DESCRIPTION("NetWinder button driver"); 245 MODULE_LICENSE("GPL"); 246 247 module_init(nwbutton_init);
+1
drivers/char/nwflash.c
··· 618 iounmap((void *)FLASH_BASE); 619 } 620 621 MODULE_LICENSE("GPL"); 622 623 module_param(flashdebug, bool, 0644);
··· 618 iounmap((void *)FLASH_BASE); 619 } 620 621 + MODULE_DESCRIPTION("NetWinder flash memory driver"); 622 MODULE_LICENSE("GPL"); 623 624 module_param(flashdebug, bool, 0644);
+1
drivers/fsi/fsi-core.c
··· 1444 } 1445 module_exit(fsi_exit); 1446 module_param(discard_errors, int, 0664); 1447 MODULE_LICENSE("GPL"); 1448 MODULE_PARM_DESC(discard_errors, "Don't invoke error handling on bus accesses");
··· 1444 } 1445 module_exit(fsi_exit); 1446 module_param(discard_errors, int, 0664); 1447 + MODULE_DESCRIPTION("FSI core driver"); 1448 MODULE_LICENSE("GPL"); 1449 MODULE_PARM_DESC(discard_errors, "Don't invoke error handling on bus accesses");
+1
drivers/fsi/fsi-master-aspeed.c
··· 670 }; 671 672 module_platform_driver(fsi_master_aspeed_driver); 673 MODULE_LICENSE("GPL");
··· 670 }; 671 672 module_platform_driver(fsi_master_aspeed_driver); 673 + MODULE_DESCRIPTION("FSI master driver for AST2600"); 674 MODULE_LICENSE("GPL");
+2 -1
drivers/fsi/fsi-master-ast-cf.c
··· 1 // SPDX-License-Identifier: GPL-2.0+ 2 // Copyright 2018 IBM Corp 3 /* 4 - * A FSI master controller, using a simple GPIO bit-banging interface 5 */ 6 7 #include <linux/crc4.h> ··· 1438 }; 1439 1440 module_platform_driver(fsi_master_acf); 1441 MODULE_LICENSE("GPL"); 1442 MODULE_FIRMWARE(FW_FILE_NAME);
··· 1 // SPDX-License-Identifier: GPL-2.0+ 2 // Copyright 2018 IBM Corp 3 /* 4 + * A FSI master based on Aspeed ColdFire coprocessor 5 */ 6 7 #include <linux/crc4.h> ··· 1438 }; 1439 1440 module_platform_driver(fsi_master_acf); 1441 + MODULE_DESCRIPTION("A FSI master based on Aspeed ColdFire coprocessor"); 1442 MODULE_LICENSE("GPL"); 1443 MODULE_FIRMWARE(FW_FILE_NAME);
+1
drivers/fsi/fsi-master-gpio.c
··· 892 }; 893 894 module_platform_driver(fsi_master_gpio_driver); 895 MODULE_LICENSE("GPL");
··· 892 }; 893 894 module_platform_driver(fsi_master_gpio_driver); 895 + MODULE_DESCRIPTION("A FSI master controller, using a simple GPIO bit-banging interface"); 896 MODULE_LICENSE("GPL");
+1
drivers/fsi/fsi-master-hub.c
··· 295 }; 296 297 module_fsi_driver(hub_master_driver); 298 MODULE_LICENSE("GPL");
··· 295 }; 296 297 module_fsi_driver(hub_master_driver); 298 + MODULE_DESCRIPTION("FSI hub master driver"); 299 MODULE_LICENSE("GPL");
+1
drivers/fsi/fsi-scom.c
··· 625 626 module_init(scom_init); 627 module_exit(scom_exit); 628 MODULE_LICENSE("GPL");
··· 625 626 module_init(scom_init); 627 module_exit(scom_exit); 628 + MODULE_DESCRIPTION("SCOM FSI Client device driver"); 629 MODULE_LICENSE("GPL");
+1 -1
drivers/misc/Kconfig
··· 587 588 config MARVELL_CN10K_DPI 589 tristate "Octeon CN10K DPI driver" 590 - depends on PCI 591 depends on ARCH_THUNDER || (COMPILE_TEST && 64BIT) 592 help 593 Enables Octeon CN10K DMA packet interface (DPI) driver which
··· 587 588 config MARVELL_CN10K_DPI 589 tristate "Octeon CN10K DPI driver" 590 + depends on PCI && PCI_IOV 591 depends on ARCH_THUNDER || (COMPILE_TEST && 64BIT) 592 help 593 Enables Octeon CN10K DMA packet interface (DPI) driver which
+51 -34
drivers/misc/eeprom/ee1004.c
··· 233 mutex_unlock(&ee1004_bus_lock); 234 } 235 236 static int ee1004_probe(struct i2c_client *client) 237 { 238 struct nvmem_config config = { ··· 294 .compat = true, 295 .base_dev = &client->dev, 296 }; 297 - struct ee1004_bus_data *bd; 298 struct nvmem_device *ndev; 299 - int err, cnr = 0; 300 301 /* Make sure we can operate on this adapter */ 302 if (!i2c_check_functionality(client->adapter, ··· 306 307 mutex_lock(&ee1004_bus_lock); 308 309 - bd = ee1004_get_bus_data(client->adapter); 310 - if (!bd) { 311 mutex_unlock(&ee1004_bus_lock); 312 - return dev_err_probe(&client->dev, -ENOSPC, 313 - "Only %d busses supported", EE1004_MAX_BUSSES); 314 - } 315 - 316 - err = devm_add_action_or_reset(&client->dev, ee1004_cleanup_bus_data, bd); 317 - if (err < 0) 318 return err; 319 - 320 - i2c_set_clientdata(client, bd); 321 - 322 - if (++bd->dev_count == 1) { 323 - /* Use 2 dummy devices for page select command */ 324 - for (cnr = 0; cnr < EE1004_NUM_PAGES; cnr++) { 325 - struct i2c_client *cl; 326 - 327 - cl = i2c_new_dummy_device(client->adapter, EE1004_ADDR_SET_PAGE + cnr); 328 - if (IS_ERR(cl)) { 329 - mutex_unlock(&ee1004_bus_lock); 330 - return PTR_ERR(cl); 331 - } 332 - bd->set_page[cnr] = cl; 333 - } 334 - 335 - /* Remember current page to avoid unneeded page select */ 336 - err = ee1004_get_current_page(bd); 337 - if (err < 0) { 338 - mutex_unlock(&ee1004_bus_lock); 339 - return err; 340 - } 341 - dev_dbg(&client->dev, "Currently selected page: %d\n", err); 342 - bd->current_page = err; 343 } 344 345 ee1004_probe_temp_sensor(client); 346 347 mutex_unlock(&ee1004_bus_lock); 348 349 ndev = devm_nvmem_register(&client->dev, &config); 350 if (IS_ERR(ndev))
··· 233 mutex_unlock(&ee1004_bus_lock); 234 } 235 236 + static int ee1004_init_bus_data(struct i2c_client *client) 237 + { 238 + struct ee1004_bus_data *bd; 239 + int err, cnr = 0; 240 + 241 + bd = ee1004_get_bus_data(client->adapter); 242 + if (!bd) 243 + return dev_err_probe(&client->dev, -ENOSPC, "Only %d busses supported", 244 + EE1004_MAX_BUSSES); 245 + 246 + i2c_set_clientdata(client, bd); 247 + 248 + if (++bd->dev_count == 1) { 249 + /* Use 2 dummy devices for page select command */ 250 + for (cnr = 0; cnr < EE1004_NUM_PAGES; cnr++) { 251 + struct i2c_client *cl; 252 + 253 + cl = i2c_new_dummy_device(client->adapter, EE1004_ADDR_SET_PAGE + cnr); 254 + if (IS_ERR(cl)) { 255 + err = PTR_ERR(cl); 256 + goto err_out; 257 + } 258 + 259 + bd->set_page[cnr] = cl; 260 + } 261 + 262 + /* Remember current page to avoid unneeded page select */ 263 + err = ee1004_get_current_page(bd); 264 + if (err < 0) 265 + goto err_out; 266 + 267 + dev_dbg(&client->dev, "Currently selected page: %d\n", err); 268 + bd->current_page = err; 269 + } 270 + 271 + return 0; 272 + 273 + err_out: 274 + ee1004_cleanup(cnr, bd); 275 + 276 + return err; 277 + } 278 + 279 static int ee1004_probe(struct i2c_client *client) 280 { 281 struct nvmem_config config = { ··· 251 .compat = true, 252 .base_dev = &client->dev, 253 }; 254 struct nvmem_device *ndev; 255 + int err; 256 257 /* Make sure we can operate on this adapter */ 258 if (!i2c_check_functionality(client->adapter, ··· 264 265 mutex_lock(&ee1004_bus_lock); 266 267 + err = ee1004_init_bus_data(client); 268 + if (err < 0) { 269 mutex_unlock(&ee1004_bus_lock); 270 return err; 271 } 272 273 ee1004_probe_temp_sensor(client); 274 275 mutex_unlock(&ee1004_bus_lock); 276 + 277 + err = devm_add_action_or_reset(&client->dev, ee1004_cleanup_bus_data, 278 + i2c_get_clientdata(client)); 279 + if (err < 0) 280 + return err; 281 282 ndev = devm_nvmem_register(&client->dev, &config); 283 if (IS_ERR(ndev))
+5 -6
drivers/spmi/spmi-pmic-arb.c
··· 398 399 *offset = rc; 400 if (bc >= PMIC_ARB_MAX_TRANS_BYTES) { 401 - dev_err(&bus->spmic->dev, "pmic-arb supports 1..%d bytes per trans, but:%zu requested", 402 PMIC_ARB_MAX_TRANS_BYTES, len); 403 return -EINVAL; 404 } ··· 477 478 *offset = rc; 479 if (bc >= PMIC_ARB_MAX_TRANS_BYTES) { 480 - dev_err(&bus->spmic->dev, "pmic-arb supports 1..%d bytes per trans, but:%zu requested", 481 PMIC_ARB_MAX_TRANS_BYTES, len); 482 return -EINVAL; 483 } ··· 1702 1703 index = of_property_match_string(node, "reg-names", "cnfg"); 1704 if (index < 0) { 1705 - dev_err(dev, "cnfg reg region missing"); 1706 return -EINVAL; 1707 } 1708 ··· 1712 1713 index = of_property_match_string(node, "reg-names", "intr"); 1714 if (index < 0) { 1715 - dev_err(dev, "intr reg region missing"); 1716 return -EINVAL; 1717 } 1718 ··· 1737 1738 dev_dbg(&pdev->dev, "adding irq domain for bus %d\n", bus_index); 1739 1740 - bus->domain = irq_domain_add_tree(dev->of_node, 1741 - &pmic_arb_irq_domain_ops, bus); 1742 if (!bus->domain) { 1743 dev_err(&pdev->dev, "unable to create irq_domain\n"); 1744 return -ENOMEM;
··· 398 399 *offset = rc; 400 if (bc >= PMIC_ARB_MAX_TRANS_BYTES) { 401 + dev_err(&bus->spmic->dev, "pmic-arb supports 1..%d bytes per trans, but:%zu requested\n", 402 PMIC_ARB_MAX_TRANS_BYTES, len); 403 return -EINVAL; 404 } ··· 477 478 *offset = rc; 479 if (bc >= PMIC_ARB_MAX_TRANS_BYTES) { 480 + dev_err(&bus->spmic->dev, "pmic-arb supports 1..%d bytes per trans, but:%zu requested\n", 481 PMIC_ARB_MAX_TRANS_BYTES, len); 482 return -EINVAL; 483 } ··· 1702 1703 index = of_property_match_string(node, "reg-names", "cnfg"); 1704 if (index < 0) { 1705 + dev_err(dev, "cnfg reg region missing\n"); 1706 return -EINVAL; 1707 } 1708 ··· 1712 1713 index = of_property_match_string(node, "reg-names", "intr"); 1714 if (index < 0) { 1715 + dev_err(dev, "intr reg region missing\n"); 1716 return -EINVAL; 1717 } 1718 ··· 1737 1738 dev_dbg(&pdev->dev, "adding irq domain for bus %d\n", bus_index); 1739 1740 + bus->domain = irq_domain_add_tree(node, &pmic_arb_irq_domain_ops, bus); 1741 if (!bus->domain) { 1742 dev_err(&pdev->dev, "unable to create irq_domain\n"); 1743 return -ENOMEM;