Skip to content

Commit 9221afb

Browse files
committed
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
2 parents 04cc50c + ffcf2eb commit 9221afb

File tree

15 files changed

+81
-67
lines changed

15 files changed

+81
-67
lines changed

drivers/android/binder.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1044,13 +1044,13 @@ static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc,
10441044
}
10451045

10461046
/* Find the smallest unused descriptor the "slow way" */
1047-
static u32 slow_desc_lookup_olocked(struct binder_proc *proc)
1047+
static u32 slow_desc_lookup_olocked(struct binder_proc *proc, u32 offset)
10481048
{
10491049
struct binder_ref *ref;
10501050
struct rb_node *n;
10511051
u32 desc;
10521052

1053-
desc = 1;
1053+
desc = offset;
10541054
for (n = rb_first(&proc->refs_by_desc); n; n = rb_next(n)) {
10551055
ref = rb_entry(n, struct binder_ref, rb_node_desc);
10561056
if (ref->data.desc > desc)
@@ -1071,21 +1071,18 @@ static int get_ref_desc_olocked(struct binder_proc *proc,
10711071
u32 *desc)
10721072
{
10731073
struct dbitmap *dmap = &proc->dmap;
1074+
unsigned int nbits, offset;
10741075
unsigned long *new, bit;
1075-
unsigned int nbits;
10761076

10771077
/* 0 is reserved for the context manager */
1078-
if (node == proc->context->binder_context_mgr_node) {
1079-
*desc = 0;
1080-
return 0;
1081-
}
1078+
offset = (node == proc->context->binder_context_mgr_node) ? 0 : 1;
10821079

10831080
if (!dbitmap_enabled(dmap)) {
1084-
*desc = slow_desc_lookup_olocked(proc);
1081+
*desc = slow_desc_lookup_olocked(proc, offset);
10851082
return 0;
10861083
}
10871084

1088-
if (dbitmap_acquire_first_zero_bit(dmap, &bit) == 0) {
1085+
if (dbitmap_acquire_next_zero_bit(dmap, offset, &bit) == 0) {
10891086
*desc = bit;
10901087
return 0;
10911088
}

drivers/android/binder_alloc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -939,9 +939,9 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
939939
__free_page(alloc->pages[i].page_ptr);
940940
page_count++;
941941
}
942-
kvfree(alloc->pages);
943942
}
944943
spin_unlock(&alloc->lock);
944+
kvfree(alloc->pages);
945945
if (alloc->mm)
946946
mmdrop(alloc->mm);
947947

drivers/android/dbitmap.h

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66
*
77
* Used by the binder driver to optimize the allocation of the smallest
88
* 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.
9+
* of an ID.
1110
*
1211
* A dbitmap can grow or shrink as needed. This part has been designed
1312
* considering that users might need to briefly release their locks in
@@ -58,11 +57,7 @@ static inline unsigned int dbitmap_shrink_nbits(struct dbitmap *dmap)
5857
if (bit < (dmap->nbits >> 2))
5958
return dmap->nbits >> 1;
6059

61-
/*
62-
* Note that find_last_bit() returns dmap->nbits when no bits
63-
* are set. While this is technically not possible here since
64-
* BIT(0) is always set, this check is left for extra safety.
65-
*/
60+
/* find_last_bit() returns dmap->nbits when no bits are set. */
6661
if (bit == dmap->nbits)
6762
return NBITS_MIN;
6863

@@ -132,16 +127,17 @@ dbitmap_grow(struct dbitmap *dmap, unsigned long *new, unsigned int nbits)
132127
}
133128

134129
/*
135-
* Finds and sets the first zero bit in the bitmap. Upon success @bit
130+
* Finds and sets the next zero bit in the bitmap. Upon success @bit
136131
* is populated with the index and 0 is returned. Otherwise, -ENOSPC
137132
* is returned to indicate that a dbitmap_grow() is needed.
138133
*/
139134
static inline int
140-
dbitmap_acquire_first_zero_bit(struct dbitmap *dmap, unsigned long *bit)
135+
dbitmap_acquire_next_zero_bit(struct dbitmap *dmap, unsigned long offset,
136+
unsigned long *bit)
141137
{
142138
unsigned long n;
143139

144-
n = find_first_zero_bit(dmap->map, dmap->nbits);
140+
n = find_next_zero_bit(dmap->map, dmap->nbits, offset);
145141
if (n == dmap->nbits)
146142
return -ENOSPC;
147143

@@ -154,9 +150,7 @@ dbitmap_acquire_first_zero_bit(struct dbitmap *dmap, unsigned long *bit)
154150
static inline void
155151
dbitmap_clear_bit(struct dbitmap *dmap, unsigned long bit)
156152
{
157-
/* BIT(0) should always set for the context manager */
158-
if (bit)
159-
clear_bit(bit, dmap->map);
153+
clear_bit(bit, dmap->map);
160154
}
161155

162156
static inline int dbitmap_init(struct dbitmap *dmap)
@@ -168,8 +162,6 @@ static inline int dbitmap_init(struct dbitmap *dmap)
168162
}
169163

170164
dmap->nbits = NBITS_MIN;
171-
/* BIT(0) is reserved for the context manager */
172-
set_bit(0, dmap->map);
173165

174166
return 0;
175167
}

drivers/char/ds1620.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,4 +421,5 @@ static void __exit ds1620_exit(void)
421421
module_init(ds1620_init);
422422
module_exit(ds1620_exit);
423423

424+
MODULE_DESCRIPTION("Dallas Semiconductor DS1620 thermometer driver");
424425
MODULE_LICENSE("GPL");

drivers/char/nwbutton.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,7 @@ static void __exit nwbutton_exit (void)
241241

242242

243243
MODULE_AUTHOR("Alex Holden");
244+
MODULE_DESCRIPTION("NetWinder button driver");
244245
MODULE_LICENSE("GPL");
245246

246247
module_init(nwbutton_init);

drivers/char/nwflash.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,7 @@ static void __exit nwflash_exit(void)
618618
iounmap((void *)FLASH_BASE);
619619
}
620620

621+
MODULE_DESCRIPTION("NetWinder flash memory driver");
621622
MODULE_LICENSE("GPL");
622623

623624
module_param(flashdebug, bool, 0644);

drivers/fsi/fsi-core.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1444,5 +1444,6 @@ static void fsi_exit(void)
14441444
}
14451445
module_exit(fsi_exit);
14461446
module_param(discard_errors, int, 0664);
1447+
MODULE_DESCRIPTION("FSI core driver");
14471448
MODULE_LICENSE("GPL");
14481449
MODULE_PARM_DESC(discard_errors, "Don't invoke error handling on bus accesses");

drivers/fsi/fsi-master-aspeed.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -670,4 +670,5 @@ static struct platform_driver fsi_master_aspeed_driver = {
670670
};
671671

672672
module_platform_driver(fsi_master_aspeed_driver);
673+
MODULE_DESCRIPTION("FSI master driver for AST2600");
673674
MODULE_LICENSE("GPL");

drivers/fsi/fsi-master-ast-cf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0+
22
// Copyright 2018 IBM Corp
33
/*
4-
* A FSI master controller, using a simple GPIO bit-banging interface
4+
* A FSI master based on Aspeed ColdFire coprocessor
55
*/
66

77
#include <linux/crc4.h>
@@ -1438,5 +1438,6 @@ static struct platform_driver fsi_master_acf = {
14381438
};
14391439

14401440
module_platform_driver(fsi_master_acf);
1441+
MODULE_DESCRIPTION("A FSI master based on Aspeed ColdFire coprocessor");
14411442
MODULE_LICENSE("GPL");
14421443
MODULE_FIRMWARE(FW_FILE_NAME);

drivers/fsi/fsi-master-gpio.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -892,4 +892,5 @@ static struct platform_driver fsi_master_gpio_driver = {
892892
};
893893

894894
module_platform_driver(fsi_master_gpio_driver);
895+
MODULE_DESCRIPTION("A FSI master controller, using a simple GPIO bit-banging interface");
895896
MODULE_LICENSE("GPL");

0 commit comments

Comments
 (0)