In my opinion, the limit of 10% or 20% is calculated individually.
But for the purpose of section 2 (22) e , shareholders means registered shareholder. (Case Law CIT v. C.P. Sarathy Mudaliar ).
As in your case, A holds 9% & A (HUF) holds 8% where registered holder will be A. So total holding will be 17% in this case.
However, A holds less than 20% beneficial ownership in the partnership firm, so the condition of 20% beneficial ownership is not fulfilled.
Accordingly, loan given by private limited company to partnership firm will not be treated as deemed dividend.