Described herein are compounds that are useful as protein kinase inhibitors having the formulae I and V:
1
or a pharmaceutically acceptable salt thereof, wherein Ring B, Z
1
, Z
2
, U, T, m, n, p, Q, Q′, R
1
, R
2
, R
x
, R
3
, and R
6
are as defined herein. These compounds, and pharmaceutically acceptable compositions thereof, are useful for treating or lessening the severity of a variety of disorders, including stroke, inflammatory disorders, autoimmune diseases such as SLE lupus and psoriasis, proliferative disorders such as cancer, and conditions associated with organ transplantation.