Block device driver: How to handle hardware failure

2007-07-31 Thread beck0778
Hello, I am writing a block device driver to access Secure Digital (SD) cards over an SPI interface for an embedded (ppc) product. If the SD card is removed while it is still mounted, the kernel will continue to generate read and write requests for the driver, which it obviously can't perfor

Reading flags from device driver "open" call

2007-07-30 Thread beck0778
Hello, I am writing a block device driver for an SD card accessed over SPI. If the card is write-protected (using the little switch on the side), I would like to inform the kernel that the device is read-only, and can't be written to. After a bit of research, I've come to the conclusion that