The major function of p21 in the cell cycle is to:
p21WAF1/CIP1 encoded by CDKN1A represents broad-spectrum cyclin-dependent kinase inhibitor linking DNA damage response to cell cycle arrest in G1 and G2. Upon double-strand break detection, ATM kinase phosphorylates Chk2 and p53 at serine 15, blocking MDM2-mediated ubiquitination and stabilizing p53. ATR responds to single-stranded DNA coated with RPA. Accumulated p53 binds response elements in CDKN1A promoter, markedly upregulating p21 protein that contains N-terminal CDK inhibitory domain with Cy1 and Cy2 cyclin-binding motifs. p21 inserts into catalytic cleft of cyclin E-CDK2, cyclin D-CDK4
Ref: Alberts et al., Molecular Biology of the Cell, 7th ed., Chapter 17: p53-p21 DNA Damage Axis.