1784, "old, musty," in reference to cheeses, then "repulsive," from funk (n.2) + -y (2). It began to develop an approving sense in jazz slang c.1900, probably on the notion of "earthy, strong, deeply felt." Funky also was used early 20c. by white writers in reference to body odor allegedly peculiar to blacks. The word reached wider popularity c.1954 (e.g. definition in "Time" magazine, Nov. 8, 1954) and in the 1960s acquired a broad slang sense of "fine, stylish, excellent."
The excited, hard-edged, soulful, or rhythmically compelling mood associated with funk: Cannonball's alto sax has lost its old zesty funkiness (1980s+)