Commit 9221afb2 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
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
parents 04cc50c2 ffcf2eb4
Loading
Loading
Loading
Loading
+6 −9
Original line number Diff line number Diff line
@@ -1044,13 +1044,13 @@ static struct binder_ref *binder_get_ref_olocked(struct binder_proc *proc,
}

/* Find the smallest unused descriptor the "slow way" */
static u32 slow_desc_lookup_olocked(struct binder_proc *proc)
static u32 slow_desc_lookup_olocked(struct binder_proc *proc, u32 offset)
{
	struct binder_ref *ref;
	struct rb_node *n;
	u32 desc;

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

	/* 0 is reserved for the context manager */
	if (node == proc->context->binder_context_mgr_node) {
		*desc = 0;
		return 0;
	}
	offset = (node == proc->context->binder_context_mgr_node) ? 0 : 1;

	if (!dbitmap_enabled(dmap)) {
		*desc = slow_desc_lookup_olocked(proc);
		*desc = slow_desc_lookup_olocked(proc, offset);
		return 0;
	}

	if (dbitmap_acquire_first_zero_bit(dmap, &bit) == 0) {
	if (dbitmap_acquire_next_zero_bit(dmap, offset, &bit) == 0) {
		*desc = bit;
		return 0;
	}
+1 −1
Original line number Diff line number Diff line
@@ -939,9 +939,9 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
			__free_page(alloc->pages[i].page_ptr);
			page_count++;
		}
		kvfree(alloc->pages);
	}
	spin_unlock(&alloc->lock);
	kvfree(alloc->pages);
	if (alloc->mm)
		mmdrop(alloc->mm);

+7 −15
Original line number Diff line number Diff line
@@ -6,8 +6,7 @@
 *
 * Used by the binder driver to optimize the allocation of the smallest
 * available descriptor ID. Each bit in the bitmap represents the state
 * of an ID, with the exception of BIT(0) which is used exclusively to
 * reference binder's context manager.
 * of an ID.
 *
 * A dbitmap can grow or shrink as needed. This part has been designed
 * 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)
	if (bit < (dmap->nbits >> 2))
		return dmap->nbits >> 1;

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

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

/*
 * Finds and sets the first zero bit in the bitmap. Upon success @bit
 * Finds and sets the next zero bit in the bitmap. Upon success @bit
 * is populated with the index and 0 is returned. Otherwise, -ENOSPC
 * is returned to indicate that a dbitmap_grow() is needed.
 */
static inline int
dbitmap_acquire_first_zero_bit(struct dbitmap *dmap, unsigned long *bit)
dbitmap_acquire_next_zero_bit(struct dbitmap *dmap, unsigned long offset,
			      unsigned long *bit)
{
	unsigned long n;

	n = find_first_zero_bit(dmap->map, dmap->nbits);
	n = find_next_zero_bit(dmap->map, dmap->nbits, offset);
	if (n == dmap->nbits)
		return -ENOSPC;

@@ -154,8 +150,6 @@ dbitmap_acquire_first_zero_bit(struct dbitmap *dmap, unsigned long *bit)
static inline void
dbitmap_clear_bit(struct dbitmap *dmap, unsigned long bit)
{
	/* BIT(0) should always set for the context manager */
	if (bit)
	clear_bit(bit, dmap->map);
}

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

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

	return 0;
}
+1 −0
Original line number Diff line number Diff line
@@ -421,4 +421,5 @@ static void __exit ds1620_exit(void)
module_init(ds1620_init);
module_exit(ds1620_exit);

MODULE_DESCRIPTION("Dallas Semiconductor DS1620 thermometer driver");
MODULE_LICENSE("GPL");
+1 −0
Original line number Diff line number Diff line
@@ -241,6 +241,7 @@ static void __exit nwbutton_exit (void)


MODULE_AUTHOR("Alex Holden");
MODULE_DESCRIPTION("NetWinder button driver");
MODULE_LICENSE("GPL");

module_init(nwbutton_init);
Loading