summaryrefslogtreecommitdiff
path: root/sys/src/9/port/devsd.c
AgeCommit message (Collapse)Author
2023-01-15devsd: fix wrong range check for subunit numbercinap_lenrek
2022-03-30devsd: cache SDunit pointer in Chan.aux, improve error handlingcinap_lenrek
Avoid calling sdgetdev() for every I/O. Instead, put the SDunit pointer for #S/sdXX/* files in Chan.aux and keep a reference to SDev between sdopen()/sdclose(). This avoids having to do the sdindex() lookup and qlock(),incref(),decref() on every read/write operation. Removal of SDev's is quite rare and only can happen with pcmcia ide controllers, and i assume that for that we can assume thet fileservers having been exited properly and closed their files before we attempt to remove a device. The rest is improving waserror() codepaths, making sure we release the locks for any of the interface callbacks (verify/online). Also get rid of tas() and instead only change the unit's rawopen flag while holding raw qlock.
2019-04-16devsd: fix sddelpart() AGAINcinap_lenrek
the previous "fix" missed to advance pp so after we hit a invalid partition all following partitions would be ignored.
2019-04-15devsd: fix panic when using "delpart" to remove a partition that was already ↵BurnZeZ
removed
2018-02-25kernel: properly handle bad attach specifierscinap_lenrek
- only accept decimal for numeric device id's - exclude negative device id's - device id's out of range yield Enodev
2017-03-26devsd: handle case where theres no ifc->enable() functioncinap_lenrek
2017-03-26devsd: check return value of ifc->enable(), don't leak unit name/user stringscinap_lenrek
2015-09-20devsd: handle SYNCHRONIZE CACHE scsi commands as nops in sdfakescsi()cinap_lenrek
2015-09-20devsd: remove unused timeout field from SDreqcinap_lenrek
2015-03-06devsd: always page align sd bufferscinap_lenrek
sdbio() tests if it can pass the buffer pointer directly to the driver when it is already in kernel memory. we also need to check if the buffer is properly aligned but alignment requirement is handled in system specific sdmalloc() and was not known to devsd. to solve this, we *always* page align sd buffers and get rid of the system specific sdmalloc() macro (was only used in bcm kernel).
2013-11-12devsd: fix scsi emulation for disks bigger than 4 billion sectors (from erik ↵cinap_lenrek
quanstros 9atom) for read capacity (10 (0x25) if we have more than 4 billion sectors, we must not return nsectors % (1<<32), we must return 0xffffffff.
2013-05-27devfs/devsd: fix waserror() and unused variable compiler problemcinap_lenrek
the compiler optimizes setting unused variables out, which is problematic if they are used in waserror() handler which the compiler isnt aware of. rearrange the code to avoid this problem.
2013-05-20use resrcwait() when waiting for memory to become availablecinap_lenrek
use resrcwait() when waiting for memory to become available. randomize the sleep time and properly restore old process status in case tsleep() gets interrupted.
2013-05-19devsd: don't raise Enomem error if sdmalloc() fails, instead wait for the ↵cinap_lenrek
memory to become available filesystems do not handle i/o errors well (cwfs will abandon the blocks), and temporary exhaustion of kernel memory (because of too many i/o's in parallel) causes read and write on the partition to fail. i think it is better to wait for the memory to become available in this case. the single allocation is at max SDmaxio bytes, which makes it likely to become available. if we havnt even enought fo that, then rebooting the machine would be the best option. (aux/reboot)
2013-05-02devsd: initialize unit->sense[0] in sdsetsense() (from erik quanstroms 9atom)cinap_lenrek
2012-12-26devsd: fix possible sdbio() race with inquiry data changing (due to ahci ↵cinap_lenrek
hotplug) the unit inquiry data might change in case the drive got pulled with ahci. so keep track if we locked the ctl in a local stack variable instead of relying on that the inquiry data stays the same.
2012-08-07add Echange[] error stringcinap_lenrek
2011-12-12kernel: fix more malloc/smalloc errorscinap_lenrek
2011-07-10merge sd changes from 9atomcinap_lenrek
2011-03-30Import sources from 2011-03-30 iso image - libTaru Karttunen
2011-03-30Import sources from 2011-03-30 iso imageTaru Karttunen