|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5 |
|
| #
f1e8bf56 |
| 24-Dec-2024 |
Zijun Hu <[email protected]> |
driver core: Constify API device_find_child() and adapt for various usages
Constify the following API: struct device *device_find_child(struct device *dev, void *data, int (*match)(struct device *
driver core: Constify API device_find_child() and adapt for various usages
Constify the following API: struct device *device_find_child(struct device *dev, void *data, int (*match)(struct device *dev, void *data)); To : struct device *device_find_child(struct device *dev, const void *data, device_match_t match); typedef int (*device_match_t)(struct device *dev, const void *data); with the following reasons:
- Protect caller's match data @*data which is for comparison and lookup and the API does not actually need to modify @*data.
- Make the API's parameters (@match)() and @data have the same type as all of other device finding APIs (bus|class|driver)_find_device().
- All kinds of existing device match functions can be directly taken as the API's argument, they were exported by driver core.
Constify the API and adapt for various existing usages.
BTW, various subsystem changes are squashed into this commit to meet 'git bisect' requirement, and this commit has the minimal and simplest changes to complement squashing shortcoming, and that may bring extra code improvement.
Reviewed-by: Alison Schofield <[email protected]> Reviewed-by: Takashi Sakamoto <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> # for drivers/pwm Signed-off-by: Zijun Hu <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Mathieu Poirier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5 |
|
| #
e2c87f48 |
| 20-Aug-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: update fw_device outside of device_find_child()
When detecting updates of bus topology, the data of fw_device is newly allocated and caches the content of configuration ROM from the
firewire: core: update fw_device outside of device_find_child()
When detecting updates of bus topology, the data of fw_device is newly allocated and caches the content of configuration ROM from the corresponding node. Then, the tree of device is sought to find the previous data of fw_device corresponding to the node. If found, the previous data is updated and reused and the data of fw_device newly allocated is going to be released.
The above procedure is done in the call of device_find_child(), however it is a bit abusing against the intention of the helper function, since it is preferable to find only without updating.
This commit splits the update outside of the call.
Cc: Zijun Hu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc4 |
|
| #
e8b89bc1 |
| 14-Aug-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core/ohci: minor refactoring for computation of configuration ROM size
The size of space for configuration ROM is defined by IEEE 1212. The start and end offsets are available as some macr
firewire: core/ohci: minor refactoring for computation of configuration ROM size
The size of space for configuration ROM is defined by IEEE 1212. The start and end offsets are available as some macros in UAPI header.
This commit uses these macros to compute the size.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
7a0a57cf |
| 12-Aug-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: use lock in Xarray instead of local R/W semaphore
The data of XArray structure includes spinlock and requires no external lock, while the data is still under the critical section by
firewire: core: use lock in Xarray instead of local R/W semaphore
The data of XArray structure includes spinlock and requires no external lock, while the data is still under the critical section by fw_device_rwsem.
This commit deletes the critical section.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
7e5a7725 |
| 12-Aug-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: replace IDR with XArray to maintain fw_device
In core function, the instances of fw_device corresponding to firewire device node in system are maintained by IDR. As of kernel v6.0, I
firewire: core: replace IDR with XArray to maintain fw_device
In core function, the instances of fw_device corresponding to firewire device node in system are maintained by IDR. As of kernel v6.0, IDR has been superseded by XArray and deprecated.
This commit replaces the usage of IDR with XArray to maintain the device instances. The instance of XArray is allocated statically, and initialized with XA_FLAGS_ALLOC so that the index of allocated entry starts with zero and available as the minor identifier of device node.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc3 |
|
| #
27310d56 |
| 05-Aug-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: use guard macro to maintain properties of fw_card
The core functions uses spinlock in instance of fw_card structure to protect concurrent access to properties in the instance.
This
firewire: core: use guard macro to maintain properties of fw_card
The core functions uses spinlock in instance of fw_card structure to protect concurrent access to properties in the instance.
This commit uses guard macro to maintain the spinlock.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
2a6a58f0 |
| 05-Aug-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: use guard macro to access to IDR for fw_device
The core function maintains the instance of fw_device structure by IDR. The concurrent access to IDR is protected by static read/write
firewire: core: use guard macro to access to IDR for fw_device
The core function maintains the instance of fw_device structure by IDR. The concurrent access to IDR is protected by static read/write semaphore. The semaphore is also utilized to protect concurrent access to the content of configuration ROM cached to the instance so that the cache is swapped to the latest one.
This commit uses guard macro to maintain the mutex.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.11-rc2, v6.11-rc1, v6.10, v6.10-rc7 |
|
| #
d69d8048 |
| 01-Jul-2024 |
Greg Kroah-Hartman <[email protected]> |
driver core: have match() callback in struct bus_type take a const *
In the match() callback, the struct device_driver * should not be changed, so change the function callback to be a const *. This
driver core: have match() callback in struct bus_type take a const *
In the match() callback, the struct device_driver * should not be changed, so change the function callback to be a const *. This is one step of many towards making the driver core safe to have struct device_driver in read-only memory.
Because the match() callback is in all busses, all busses are modified to handle this properly. This does entail switching some container_of() calls to container_of_const() to properly handle the constant *.
For some busses, like PCI and USB and HV, the const * is cast away in the match callback as those busses do want to modify those structures at this point in time (they have a local lock in the driver structure.) That will have to be changed in the future if they wish to have their struct device * in read-only-memory.
Cc: Rafael J. Wysocki <[email protected]> Reviewed-by: Alex Elder <[email protected]> Acked-by: Sumit Garg <[email protected]> Link: https://lore.kernel.org/r/2024070136-wrongdoer-busily-01e8@gregkh Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
|
Revision tags: v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1 |
|
| #
bfb1ad3c |
| 18-Mar-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: add memo about the caller of show functions for device attributes
In the case of firewire core function, the caller of show functions for device attributes is not only sysfs user, bu
firewire: core: add memo about the caller of show functions for device attributes
In the case of firewire core function, the caller of show functions for device attributes is not only sysfs user, but also device initialization.
This commit adds memo about it against the typical assumption that the functions are just dedicated to sysfs user.
Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
946593d1 |
| 18-Mar-2024 |
Li Zhijian <[email protected]> |
Revert "firewire: Kill unnecessary buf check in device_attribute.show"
This reverts commit 4a2b06ca33763b363038d333274e212db6ff0de1.
The previous fix didn't consider callers from other than sysfs.
Revert "firewire: Kill unnecessary buf check in device_attribute.show"
This reverts commit 4a2b06ca33763b363038d333274e212db6ff0de1.
The previous fix didn't consider callers from other than sysfs. Revert it to fix the NULL dereference
kernel: ? sysfs_emit+0xb5/0xc0 kernel: show_immediate+0x13f/0x1d0 [firewire_core] kernel: init_fw_attribute_group+0x81/0x150 [firewire_core] kernel: create_units+0x119/0x160 [firewire_core] kernel: fw_device_init+0x1a9/0x330 [firewire_core] kernel: fw_device_workfn+0x12/0x20 [firewire_core] kernel: process_one_work+0x16f/0x350 kernel: worker_thread+0x306/0x440 kernel: ? __pfx_worker_thread+0x10/0x10 kernel: kthread+0xf2/0x120 kernel: ? __pfx_kthread+0x10/0x10 kernel: ret_from_fork+0x47/0x70 kernel: ? __pfx_kthread+0x10/0x10 kernel: ret_from_fork_asm+0x1b/0x30 kernel: </TASK> kernel: ---[ end trace 0000000000000000 ]--- kernel: ------------[ cut here ]------------
Fixes: 4a2b06ca3376 ("firewire: Kill unnecessary buf check in device_attribute.show") Reported-by: Takashi Sakamoto <[email protected]> Signed-off-by: Li Zhijian <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4 |
|
| #
04f082d3 |
| 05-Feb-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: fix build failure due to the caller of fw_csr_string()
A commit 47dc55181dcb ("firewire: core: search descriptor leaf just after vendor directory entry in root directory") for v6.8-r
firewire: core: fix build failure due to the caller of fw_csr_string()
A commit 47dc55181dcb ("firewire: core: search descriptor leaf just after vendor directory entry in root directory") for v6.8-rc3 and a commit 67a5a58c0443 ("firewire: Kill unnecessary buf check in device_attribute.show") for v6.9 bring build failure in for-next tree due to the change of the name of local variable.
This commit fixes it.
Reported-by: Stephen Rothwell <[email protected]> Closes: https://lore.kernel.org/lkml/[email protected]/ Reported-by: kernel test robot <[email protected]> Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/ Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.8-rc3, v6.8-rc2 |
|
| #
d4db89c3 |
| 22-Jan-2024 |
Li Zhijian <[email protected]> |
firewire: Convert snprintf/sprintf to sysfs_emit
Per filesystems/sysfs.rst, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.
coccinelle
firewire: Convert snprintf/sprintf to sysfs_emit
Per filesystems/sysfs.rst, show() should only use sysfs_emit() or sysfs_emit_at() when formatting the value to be returned to user space.
coccinelle complains that there are still a couple of functions that use snprintf(). Convert them to sysfs_emit().
> drivers/firewire/core-device.c:326:8-16: WARNING: please use sysfs_emit or sysfs_emit_at
No functional change intended
Signed-off-by: Li Zhijian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
4a2b06ca |
| 22-Jan-2024 |
Li Zhijian <[email protected]> |
firewire: Kill unnecessary buf check in device_attribute.show
Per Documentation/filesystems/sysfs.rst: > sysfs allocates a buffer of size (PAGE_SIZE) and passes it to the > method.
So we can kill t
firewire: Kill unnecessary buf check in device_attribute.show
Per Documentation/filesystems/sysfs.rst: > sysfs allocates a buffer of size (PAGE_SIZE) and passes it to the > method.
So we can kill the unnecessary buf check safely.
Signed-off-by: Li Zhijian <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
47dc5518 |
| 01-Feb-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: search descriptor leaf just after vendor directory entry in root directory
It appears that Sony DVMC-DA1 has a quirk that the descriptor leaf entry locates just after the vendor dire
firewire: core: search descriptor leaf just after vendor directory entry in root directory
It appears that Sony DVMC-DA1 has a quirk that the descriptor leaf entry locates just after the vendor directory entry in root directory. This is not conformant to the legacy layout of configuration ROM described in Configuration ROM for AV/C Devices 1.0 (1394 Trading Association, Dec 2000, TA Document 1999027).
This commit changes current implementation to parse configuration ROM for device attributes so that the descriptor leaf entry can be detected for the vendor name.
$ config-rom-pretty-printer < Sony-DVMC-DA1.img ROM header and bus information block ----------------------------------------------------------------- 1024 041ee7fb bus_info_length 4, crc_length 30, crc 59387 1028 31333934 bus_name "1394" 1032 e0644000 irmc 1, cmc 1, isc 1, bmc 0, cyc_clk_acc 100, max_rec 4 (32) 1036 08004603 company_id 080046 | 1040 0014193c device_id 12886219068 | EUI-64 576537731003586876
root directory ----------------------------------------------------------------- 1044 0006b681 directory_length 6, crc 46721 1048 03080046 vendor 1052 0c0083c0 node capabilities: per IEEE 1394 1056 8d00000a --> eui-64 leaf at 1096 1060 d1000003 --> unit directory at 1072 1064 c3000005 --> vendor directory at 1084 1068 8100000a --> descriptor leaf at 1108
unit directory at 1072 ----------------------------------------------------------------- 1072 0002cdbf directory_length 2, crc 52671 1076 1200a02d specifier id 1080 13010000 version
vendor directory at 1084 ----------------------------------------------------------------- 1084 00020cfe directory_length 2, crc 3326 1088 17fa0000 model 1092 81000008 --> descriptor leaf at 1124
eui-64 leaf at 1096 ----------------------------------------------------------------- 1096 0002c66e leaf_length 2, crc 50798 1100 08004603 company_id 080046 | 1104 0014193c device_id 12886219068 | EUI-64 576537731003586876
descriptor leaf at 1108 ----------------------------------------------------------------- 1108 00039e26 leaf_length 3, crc 40486 1112 00000000 textual descriptor 1116 00000000 minimal ASCII 1120 536f6e79 "Sony"
descriptor leaf at 1124 ----------------------------------------------------------------- 1124 0005001d leaf_length 5, crc 29 1128 00000000 textual descriptor 1132 00000000 minimal ASCII 1136 44564d43 "DVMC" 1140 2d444131 "-DA1" 1144 00000000
Suggested-by: Adam Goldman <[email protected]> Tested-by: Adam Goldman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
5f9ab173 |
| 01-Feb-2024 |
Takashi Sakamoto <[email protected]> |
firewire: core: correct documentation of fw_csr_string() kernel API
Against its current description, the kernel API can accepts all types of directory entries.
This commit corrects the documentatio
firewire: core: correct documentation of fw_csr_string() kernel API
Against its current description, the kernel API can accepts all types of directory entries.
This commit corrects the documentation.
Cc: [email protected] Fixes: 3c2c58cb33b3 ("firewire: core: fw_csr_string addendum") Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.8-rc1, v6.7, v6.7-rc8 |
|
| #
986c20bb |
| 24-Dec-2023 |
Takashi Sakamoto <[email protected]> |
firewire: core: fill model field in modalias of unit device for legacy layout of configuration ROM
As the last part of support for legacy layout of configuration ROM, this commit traverses vendor di
firewire: core: fill model field in modalias of unit device for legacy layout of configuration ROM
As the last part of support for legacy layout of configuration ROM, this commit traverses vendor directory as well as root directory when constructing modalias for unit device. The change brings loss of backward compatibility since it can fill model field ('mo') which is 0 at current implementation in the case. However, we can be optimistic against regression for unit drivers in kernel, due to some points:
1. ALSA drivers for audio and music units use the model fields to match device, however all of supported devices does not have such legacy layout. 2. the other unit drivers (e.g. sbp2) does not use the model field to match device.
The rest of concern is user space application. The most of applications just take care of node device and does not use the modalias of unit device, thus the change does not affect to them. But systemd project is known to get affects from the change since it includes hwdb to take udev to configure fw character device conveniently. I have a plan to work for systemd so that the access permission of character device could be kept across the change.
Suggested-by: Adam Goldman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
2eab8bc0 |
| 24-Dec-2023 |
Takashi Sakamoto <[email protected]> |
firewire: core: detect model name for legacy layout of configuration ROM
As the part of support for legacy layout of configuration ROM, this commit traverses vendor directory as well as root directo
firewire: core: detect model name for legacy layout of configuration ROM
As the part of support for legacy layout of configuration ROM, this commit traverses vendor directory as well as root directory when showing device attribute for node device. This change expects 'model_name' attribute appears in node device, however it is probable to see the other types of descriptor leaf if the vendor directory includes.
Suggested-by: Adam Goldman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
b6a38057 |
| 24-Dec-2023 |
Takashi Sakamoto <[email protected]> |
firewire: core: detect numeric model identifier for legacy layout of configuration ROM
As the part of support for legacy layout of configuration ROM, this commit traverses vendor directory as well a
firewire: core: detect numeric model identifier for legacy layout of configuration ROM
As the part of support for legacy layout of configuration ROM, this commit traverses vendor directory as well as root directory when showing device attribute for node device. This change expects 'model' attribute appears in node device, however it is probable to see the other types of immediate values if the vendor directory includes.
Suggested-by: Adam Goldman <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
1770d39d |
| 24-Dec-2023 |
Takashi Sakamoto <[email protected]> |
firewire: test: add KUnit test for device attributes
The traverse over CSR space results in attributes of node and unit devices. Any test of the traverse is useful.
This commit adds a skeleton of K
firewire: test: add KUnit test for device attributes
The traverse over CSR space results in attributes of node and unit devices. Any test of the traverse is useful.
This commit adds a skeleton of KUnit test for the purpose.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
afa36dad |
| 24-Dec-2023 |
Takashi Sakamoto <[email protected]> |
firewire: core: replace magic number with macro
In IEEE 1394 specification, the size of bus information block of configuration ROM is fixed to 5, thus the offset of root directory is 5. Current impl
firewire: core: replace magic number with macro
In IEEE 1394 specification, the size of bus information block of configuration ROM is fixed to 5, thus the offset of root directory is 5. Current implementation to handle device structures has the hard-coded offset.
This commit replaces the offset with macro.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
| #
f1e2f878 |
| 24-Dec-2023 |
Takashi Sakamoto <[email protected]> |
firewire: core: adds constant qualifier for local helper functions
Some local functions just handles given argument as mutable, thus it is preferable to add constant qualifier to them.
Link: https:
firewire: core: adds constant qualifier for local helper functions
Some local functions just handles given argument as mutable, thus it is preferable to add constant qualifier to them.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc7 |
|
| #
10416a35 |
| 19-Dec-2023 |
Greg Kroah-Hartman <[email protected]> |
firewire: make fw_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the fw_bus_type variable to be a constant structure as well, placing it into read-only me
firewire: make fw_bus_type const
Now that the driver core can properly handle constant struct bus_type, move the fw_bus_type variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Cc: Takashi Sakamoto <[email protected]> Cc: [email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]> Link: https://lore.kernel.org/r/2023121931-skydiver-dodgy-d1bd@gregkh Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc6, v6.7-rc5, v6.7-rc4 |
|
| #
891e0eab |
| 29-Nov-2023 |
Yang Yingliang <[email protected]> |
firewire: core: fix possible memory leak in create_units()
If device_register() fails, the refcount of device is not 0, the name allocated in dev_set_name() is leaked. To fix this by calling put_dev
firewire: core: fix possible memory leak in create_units()
If device_register() fails, the refcount of device is not 0, the name allocated in dev_set_name() is leaked. To fix this by calling put_device(), so that it will be freed in callback function kobject_cleanup().
unreferenced object 0xffff9d99035c7a90 (size 8): comm "systemd-udevd", pid 168, jiffies 4294672386 (age 152.089s) hex dump (first 8 bytes): 66 77 30 2e 30 00 ff ff fw0.0... backtrace: [<00000000e1d62bac>] __kmem_cache_alloc_node+0x1e9/0x360 [<00000000bbeaff31>] __kmalloc_node_track_caller+0x44/0x1a0 [<00000000491f2fb4>] kvasprintf+0x67/0xd0 [<000000005b960ddc>] kobject_set_name_vargs+0x1e/0x90 [<00000000427ac591>] dev_set_name+0x4e/0x70 [<000000003b4e447d>] create_units+0xc5/0x110
fw_unit_release() will be called in the error path, move fw_device_get() before calling device_register() to keep balanced with fw_device_put() in fw_unit_release().
Cc: [email protected] Fixes: 1fa5ae857bb1 ("driver core: get rid of struct device's bus_id string array") Fixes: a1f64819fe9f ("firewire: struct device - replace bus_id with dev_name(), dev_set_name()") Signed-off-by: Yang Yingliang <[email protected]> Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2 |
|
| #
3c70de9b |
| 15-Sep-2023 |
Takashi Sakamoto <[email protected]> |
Revert "firewire: core: obsolete usage of GFP_ATOMIC at building node tree"
This reverts commit 06f45435d985d60d7d2fe2424fbb9909d177a63d.
John Ogness reports the case that the allocation is in atom
Revert "firewire: core: obsolete usage of GFP_ATOMIC at building node tree"
This reverts commit 06f45435d985d60d7d2fe2424fbb9909d177a63d.
John Ogness reports the case that the allocation is in atomic context under acquired spin-lock.
[ 12.555784] BUG: sleeping function called from invalid context at include/linux/sched/mm.h:306 [ 12.555808] in_atomic(): 1, irqs_disabled(): 1, non_block: 0, pid: 70, name: kworker/1:2 [ 12.555814] preempt_count: 1, expected: 0 [ 12.555820] INFO: lockdep is turned off. [ 12.555824] irq event stamp: 208 [ 12.555828] hardirqs last enabled at (207): [<c00000000111e414>] ._raw_spin_unlock_irq+0x44/0x80 [ 12.555850] hardirqs last disabled at (208): [<c00000000110ff94>] .__schedule+0x854/0xfe0 [ 12.555859] softirqs last enabled at (188): [<c000000000f73504>] .addrconf_verify_rtnl+0x2c4/0xb70 [ 12.555872] softirqs last disabled at (182): [<c000000000f732b0>] .addrconf_verify_rtnl+0x70/0xb70 [ 12.555884] CPU: 1 PID: 70 Comm: kworker/1:2 Tainted: G S 6.6.0-rc1 #1 [ 12.555893] Hardware name: PowerMac7,2 PPC970 0x390202 PowerMac [ 12.555898] Workqueue: firewire_ohci .bus_reset_work [firewire_ohci] [ 12.555939] Call Trace: [ 12.555944] [c000000009677830] [c0000000010d83c0] .dump_stack_lvl+0x8c/0xd0 (unreliable) [ 12.555963] [c0000000096778b0] [c000000000140270] .__might_resched+0x320/0x340 [ 12.555978] [c000000009677940] [c000000000497600] .__kmem_cache_alloc_node+0x390/0x460 [ 12.555993] [c000000009677a10] [c0000000003fe620] .__kmalloc+0x70/0x310 [ 12.556007] [c000000009677ac0] [c0003d00004e2268] .fw_core_handle_bus_reset+0x2c8/0xba0 [firewire_core] [ 12.556060] [c000000009677c20] [c0003d0000491190] .bus_reset_work+0x330/0x9b0 [firewire_ohci] [ 12.556079] [c000000009677d10] [c00000000011d0d0] .process_one_work+0x280/0x6f0 [ 12.556094] [c000000009677e10] [c00000000011d8a0] .worker_thread+0x360/0x500 [ 12.556107] [c000000009677ef0] [c00000000012e3b4] .kthread+0x154/0x160 [ 12.556120] [c000000009677f90] [c00000000000bfa8] .start_kernel_thread+0x10/0x14
Cc: [email protected] Reported-by: John Ogness <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/raw Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|
|
Revision tags: v6.6-rc1, v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5 |
|
| #
06f45435 |
| 04-Jun-2023 |
Takashi Sakamoto <[email protected]> |
firewire: core: obsolete usage of GFP_ATOMIC at building node tree
The flag of GFP_ATOMIC is given to the call of kmalloc when building node tree, but the call is not atomic context. The call of fw_
firewire: core: obsolete usage of GFP_ATOMIC at building node tree
The flag of GFP_ATOMIC is given to the call of kmalloc when building node tree, but the call is not atomic context. The call of fw_core_handle_bus_reset() and fw_core_remove_card() builds the tree, while they are done in specific workqueue or pci remove callback.
This commit obsolete the usage of GFP_ATOMIC.
Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Takashi Sakamoto <[email protected]>
show more ...
|