I’m not sure on what’s the max read speed on the GPIOs. The code seems to be correct though. I will run some tests and let you know my results.
100khz is too fast, we can just about handle 10khz. Note that the more CPU load you get the more you'll miss. I used the SPI clock to generate a nice pulse and then set an interupt on pin3 (arduino breakout though that bit shouldn't matter) on RISING and then wrote a byte to spi, causing my count to read 8 (with a bit of load it drops to 7). This seems to be the limit at which we drop - lots! See code here - dpaste: 2QXV95Z