Ryu said he had "a little pain, a little stiffness" that he first noticed in pregame warmups, which he said was not unusual. But it worsened when he faced the third hitter of the game, Buster Posey, who doubled in the first run.
"I couldn't execute my pitches as usual, and the result showed," Ryu said.
Mattingly said the first he heard about any physical problem was when Ryu came into the dugout at the end of the first inning.
"There are games you see him 88-89 [mph], but as the game goes on, he adds on to that," said Mattingly, who said a shoulder issue with "one of our top guys" is a concern at any point in the season.
Ryu allowed the Giants to bat around in a four-run first inning. Ryu also spent time on the disabled list last month with a strained right glute muscle. This was his third start since returning from that break.
Ryu came into the game having won five of his last six decisions. But in the 27-pitch inning, he threw 17 fastballs, only one exceeding 90 mph.
Ken Gurnick is a reporter for MLB.com. This story was not subject to the approval of Major League Baseball or its clubs.