In October, 1864 the 54th Virginia Infantry was with Reynolds' Brigade, Stevenson's Division,2nd Corps, Army of Tennessee , and was part of Hood's Tennessee Campaign. However, Col. Robert C. Trigg, former commander of the 54th, was in the region of Saltville, gathering up stragglers and deserters from the 54th and he was also recruiting new men. It is possible your ancestor enlisted during this time. The members of the 54th that Trigg rounded up participated as a detachment in the Battle of Saltville on Oct. 2, 1864.
There were two men named Alanson Farmer in Virginia units represented at Saltville.
6th Virginia Reserve Infantry Battalion
54th Virginia Infantry Regiment
The 6th Va. Reserves were made up of older men and young boys. It is possible that your ancestor joined this unit , as you say, late in the war. At that time the Confederacy was in dire need of manpower. It is a possibility your ancestor joined this reserve unit just prior to the fighting. The 6th Reserves fought at Saltville. Some of the men killed in the fighting were buried in the Elizabeth Cemetery in the town of Saltville. Actually some of the fiercest fighting took place in the cemetery itself. You must also remember that another battle took plaxce in December, 1864 and the 6th Bn. of Reserves participated in that fight as well.It would help to know in which battle your ancestor fell.
Confederate losses at Saltville were: 18 Killed 71 wounded, and 21 Missing.