Lines Matching defs:resource
1137 "Cannot acquire SBus resource to reset fabric SerDes - perhaps you should reboot\n");
1406 /* return the given resource bit(s) as a mask for the given HFI */
1407 static inline u64 resource_mask(u32 hfi1_id, u32 resource)
1409 return ((u64)resource) << (hfi1_id ? CR_DYN_SHIFT : 0);
1421 * Acquire access to a chip resource.
1423 * Return 0 on success, -EBUSY if resource busy, -EIO if mutex acquire failed.
1425 static int __acquire_chip_resource(struct hfi1_devdata *dd, u32 resource)
1430 if (resource & CR_DYN_MASK) {
1431 /* a dynamic resource is in use if either HFI has set the bit */
1433 (resource & (CR_I2C1 | CR_I2C2))) {
1438 all_bits = resource_mask(0, resource) |
1439 resource_mask(1, resource);
1441 my_bit = resource_mask(dd->hfi1_id, resource);
1444 all_bits = resource;
1445 my_bit = resource;
1448 /* lock against other callers within the driver wanting a resource */
1475 * Acquire access to a chip resource, wait up to mswait milliseconds for
1476 * the resource to become available.
1481 int acquire_chip_resource(struct hfi1_devdata *dd, u32 resource, u32 mswait)
1488 ret = __acquire_chip_resource(dd, resource);
1491 /* resource is busy, check our timeout */
1499 * Release access to a chip resource
1501 void release_chip_resource(struct hfi1_devdata *dd, u32 resource)
1506 if (!(resource & CR_DYN_MASK)) {
1507 dd_dev_err(dd, "%s: invalid resource 0x%x\n", __func__,
1508 resource);
1511 bit = resource_mask(dd->hfi1_id, resource);
1513 /* lock against other callers within the driver wanting a resource */
1528 dd_dev_warn(dd, "%s: id %d, resource 0x%x: bit not set\n",
1529 __func__, dd->hfi1_id, resource);
1539 * Return true if resource is set, false otherwise. Print a warning
1542 bool check_chip_resource(struct hfi1_devdata *dd, u32 resource,
1547 if (resource & CR_DYN_MASK)
1548 bit = resource_mask(dd->hfi1_id, resource);
1550 bit = resource;
1556 "%s: id %d, resource 0x%x, not acquired!\n",
1557 func, dd->hfi1_id, resource);
1567 /* lock against other callers within the driver wanting a resource */
2122 * Note: caller must be holding the SBus resource.