Upper bound on size of second cohomology group for groups of prime power order

Statement
Suppose $$G$$ and $$A$$ are both finite p-groups for some prime number $$p$$, with $$A$$ an abelian p-group. Suppose $$G$$ has order $$p^n$$ and $$A$$ has order $$p^m$$. Suppose $$\varphi:G \to \operatorname{Aut}(A)$$ is a group action. Then, we have the following upper bound on the size of the second cohomology group $$\! H^2(G;A)$$. The group $$\! H^2(G;A)$$ is itself a finite p-group and its prime-base logarithm of order is bounded as follows:

$$\! \log_p(|H^2(G;A)|) \le \frac{mn(n + 1)}{2}$$

This result holds both for the case of trivial group action and nontrivial group action, i.e., both the case where $$\varphi$$ is a trivial map and the case where it is a nontrivial map.

Equality occurs in cases where both $$G$$ and $$A$$ are elementary abelian groups and the action is a trivial action (can it ever occur in other cases too?).

Related facts

 * Upper bound on size of Schur multiplier for group of prime power order based on prime-base logarithm of order: Roughly equivalent to this.

Examples with trivial group action
We consider here some examples:

Examples with nontrivial group action
We consider here some examples: