tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: [patch] Attempting to bring arcmsr(4) up to date
Hello,
Forgot to post the updated diff[1].
On 11/05/17 05:57, Sevan Janiyan wrote:
> As a work around to get the driver "working", by reducing the tested
> values from 3 down to 2 in arc_msgbuf()
>
> if ((rlen > 3) && (rdone == 3)) {
> rlen = *(u_int16_t *)rwbuf;
> rlen = sizeof(struct arc_fw_bufhdr) + rlen + 1;
> }
>
> if ((rlen > 2) && (rdone == 2)) { ... }
Ended up resolving this issue by not reusing the rlen variable halfway
through the process but using a new variable instead, rlen2 and using
that to do the calculation of how much IO we've done so far.
if ((rlen > 3) && (rdone == 3)) {
rlen2 = *(u_int16_t *)rwbuf;
rlen2 = sizeof(struct arc_fw_bufhdr) + rlen2 + 1;
if ((rdone + rwlen) > rlen2) {
DNPRINTF(ARC_D_DB, "%s: rwbuf too big\n", device_xname(sc->sc_dev));
error = EIO;
goto out;
}
}
This results in the driver binding successfully and is happy to run
without crashing.[1]
Moving on from there, it turns out the sensor framework stuff and bioctl
support is completely broken. I've not made any progress with that yet
(haven't tried).
Sevan
[1] http://www.netbsd.org/~sevan/patch-arcmsr-mk4.txt
[2] http://dmesgd.nycbug.org/index.cgi?do=view&id=3391
Home |
Main Index |
Thread Index |
Old Index