History

dibs: initialise dibs->lock in dibs_dev_alloc()

dibs->lock is initialised by dibs_dev_add(), but a dibs device can already take interrupts before that call: ism_probe() runs ism_dev_init(), and hence request_irq(), before it calls dibs_dev_add(). No client can have registered a dmb at that point, so no dmb interrupt can occur, but a GID event interrupt can, and ism_handle_irq() takes dibs->lock unconditionally on entry, before it inspects anything else. Initialise the lock in dibs_dev_alloc() instead, so that it is valid as soon as a driver can publish the device to its interrupt handler.

Hidayath Khan committed 3 months ago

Commit c27e3601 parent 8ae344e2 files · +2 −2Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/dibs.h+1−1
@@ -439,7 +439,7 @@ static inline void *dibs_get_priv(struct dibs_dev *dev, · 438 unmodified lines
439439 /**
440440 * dibs_dev_alloc() - allocate and reference device structure
441441 *
442− * The following fields will be valid upon successful return: dev
442+ * The following fields will be valid upon successful return: dev, lock
443443 * NOTE: Use put_device(dibs_get_dev(@dibs)) to give up your reference instead
444444 * of freeing @dibs @dev directly once you have successfully called this
445445 * function.

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t