libi386: bd_io_workaround() is to be called for reads only

bd_io() can perform either reads or writes, we only need bd_io_workaround()
for reads.
This commit is contained in:
Toomas Soome 2018-08-16 07:13:36 +00:00
parent 8000f383bb
commit e7da951ee5
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337891

View File

@ -601,7 +601,7 @@ bd_io_workaround(struct disk_devdesc *dev)
{
uint8_t buf[8 * 1024];
bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, 0);
bd_edd_io(dev, 0xffffffff, 1, (caddr_t)buf, BD_RD);
}
@ -628,7 +628,7 @@ bd_io(struct disk_devdesc *dev, daddr_t dblk, int blks, caddr_t dest,
* the buggy read. It is not immediately known whether other models
* are similarly affected.
*/
if (dblk >= 0x100000000)
if (dowrite == BD_RD && dblk >= 0x100000000)
bd_io_workaround(dev);
/* Decide whether we have to bounce */