Re: TYPE_RBC cache fixes (sbp2.c affected)

Al Viro
2005-05-16T04:17:50Z

On Mon, May 16, 2005 at 01:26:54PM +1000, Douglas Gilbert wrote:
> >TYPE_RBC - these guys have writeback cache flag there and are not
> >guaranteed
> >to have page 8 at all.
>
> The Write(back) Cache Disable (WCD) flag in mode page 6
> is logically flipped from WCE in DASD (i.e. disk) caching
> mode page (page number 8).

Thus the
if (modepage == 8) {
sdkp->WCE = ((buffer[offset + 2] & 0x04) != 0);
sdkp->RCD = ((buffer[offset + 2] & 0x01) != 0);
} else {
sdkp->WCE = ((buffer[offset + 2] & 0x01) == 0);
sdkp->RCD = 0;
}
in there - note the inverse check in the second case.

> > f) sbp2 sets sdev->use_10_for_rw and sdev->use_10_for_ms instead
> >of bothering to remap READ6/WRITE6/MOD_SENSE, so most of the conversions
> >in there are gone now.
>
> RBC makes MODE_SENSE/SELECT (6) support mandatory but does
> not support MODE_SENSE/SELECT(10).

I know. However, behaviour of sbp2 before that patch was to remap
MODE_SENSE(6) to MODE_SENSE(10). I'd rather not change that without
heavy testing - note that here we are talking about firewire devices
that talk sbp2 and happen to claim RBC as command set. *IF* they
work with driver in Linus' tree, they will with ->use_10_for_...;
if/when we decide to change that behaviour, we'd better get ready for
random breakage. IMO that's a separate story - let's keep the current
behaviour for now and just get rid of (badly broken) remapping in
favour of using flags.