MARTINSVILLE, Va. — A slot in NASCAR’s record books is absolutely within reach for Jimmie Johnson.

Johnson earned one of four spots in next month’s title-deciding season finale Sunday with his ninth career victory at Martinsville Speedway. The six-time NASCAR champion will race for his seventh championship, which would tie him for the record with Hall of Famers Richard Petty and Dale Earnhardt Sr.

“I’ve been trying to ignore this conversation about seven, and now I can’t,” said Johnson, who doesn’t particularly want to start thinking about the stakes just yet.

“I’ll probably lie to all of you guys and say I’m not going to think about it at all. But it’s inevitable. Fortunately, I don’t have to think about it for three weeks. But we’re going to enjoy this and savor it. We’re going to get our ducks in a row for Homestead.”

The victory blocked Joe Gibbs Racing from placing all four of Toyota drivers in the final round of the Chase for the Sprint Cup title. There are only three spots still open in the Nov. 20 finale at Homestead-Miami Speedway, and JGR’s hope of sweeping the final four ended Sunday.

Most likely to miss the final? Carl Edwards, who had a tire problem and finished 36th at Martinsville — lowest of the eight Chase drivers. Also in trouble: Stewart-Haas Racing teammates Kevin Harvick and Kurt Busch, who finished 20th and 22nd.

Brad Keselowski, eliminated from the Chase last week, finished second and was irritated by a lengthy caution earlier in the race when NASCAR struggled to figure out the running order. Had those laps not been wasted under yellow, Keselowski absolutely believed he could have beat Johnson.

“We don’t need to run 100 laps under yellow with the field, not trying to figure out where they’re at, and it probably cost us the race,” Keselowski said.

The caution took 29 laps, and left some grumbling the order still wasn’t correct when the race restarted.

“I think the stakes are so high, I really wish we would have red flagged the race, gone, reviewed it and gotten it right,” said third-place finisher Denny Hamlin. “There’s a 100 percent chance it was not right at the end. It changed the running order.

“Hopefully that doesn’t change what happens going into Homestead. I know that NASCAR is doing everything they can with the scoring they have and things like that. But you have to get it right. It definitely was not right.”

JGR finished third, fourth and fifth as Hamlin, Matt Kenseth and Kyle Busch are inside the top-four as the series heads to Texas Motor Speedway.

Jeff Gordon finished sixth in his final scheduled race as the replacement driver for Dale Earnhardt Jr. It is presumably the final race of Gordon’s career. He retired last season, but was pressed into eight races when Earnhardt suffered a concussion.

Martin Truex Jr. finished seventh and was followed by Jamie McMurray and Joey Logano, winner last week at Talladega but now the first driver below the cutline in the Chase.

It was an unusually fast race for Martinsville standards, and the five cautions were the fewest since April of 1989.

It was an unusual victory for Johnson, who tangled with Hamlin early in the race and contact between the two forced Johnson to pit road.

With about 200 laps remaining, Hamlin grew rapidly annoyed trying to pass Johnson, and grumbled that Johnson “thinks we’re bluffing” about the strength of his car. Out of patience, he moved Johnson out of his way.

The aggressive move caused damage to Johnson’s car, but he was saved when a torn banner forced NASCAR to call a caution. Hamlin was still aggravated as Johnson head to pit road for repairs.

Johnson was 25th on the restart, and crew chief Chad Knaus quickly reminded the driver that Hamlin had dropped deep into the field earlier in the race because of a speeding penalty and had driven back into the top-five.

Johnson did climb back into the top 10, but a long green-flag run combined with an untimely caution caused him to run out of gas. He was able to get his car fired, then thought he’d made a mistake on running out of fuel.

It all worked out and Johnson restarted fourth.

“There were a lot of moments, but anything in life, you have to work for it,” Johnson said. “It’s not going to come easy and we knew that coming into this race. It’s a great time to start winning races.”