Partnership 401(K) + S-Corp SEP?

Person A is sole owner/employee of S-Corp that has been in business as law firm for several years prior to 2020 with a SEP already set up.  On 1/1/2020, Person A becomes a partner in a law partnership, Partnership B, and opts to hold partnership interests via the S-Corp.  Partnership B makes guaranteed payments to S-Corp, and issues a K-1 to S-Corp for year 2020.  S-Corp pays reasonable salary to Person A during 2020 from guaranteed payments income and other S-Corp income (more on this below).  

 

Partnership B has safe harbor 401(k) allowing for elective deferrals by partners up to 19,500 limit. 

 

Can contributions be made to both Partnership B's 401(k) up to elective limit,  plus SEP contributions by S-Corp (up to 25% of annual compensation)?

 

Is the answer any different if a portion of S-Corp's revenue is independent of Partnership B?

-- income not derived from practice of law in 2020

-- income from S-Corp activities prior to 2020.

 

Thanks in advance for any insight.