Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModePageDevice::ModeSelect() is unimplemented but called by ScsiController::XferOutBlockOriented() #1397

Closed
kkaempf opened this issue Dec 11, 2023 · 1 comment · Fixed by #1406

Comments

@kkaempf
Copy link
Contributor

kkaempf commented Dec 11, 2023

Info

  • Which version of Pi are you using: 3
  • Which github revision of software: HEAD (tag 23.11.01)
  • Which board version: 2.3B
  • Which computer is the PiSCSI connected to: VAXStation 3100, running VAX/VMS 6.1
  • Which OS you are using (output of 'lsb_release -a'): Debian 11 (bullseye)

Describe the issue

While hard disk emulation works nicely, mounting a CDROM ISO results in "fatal controller error" from VAX/VMS.

Running piscsi in trace mode reveals

[2023-12-11 20:28:52.262] [trace] (ID 5) - Controller is executing ModeSelect6, CDB $151000001800
[2023-12-11 20:28:52.262] [debug] (ID:LUN 5:0) - Device is executing ModeSelect6 ($15)
[2023-12-11 20:28:52.262] [trace] (ID 5) - Data Out phase
[2023-12-11 20:28:52.262] [trace] (ID 5) - Receiving data, transfer length: 24 byte(s)
[2023-12-11 20:28:52.262] [trace] (ID 5) - Phase: dataout
[2023-12-11 20:28:52.262] [debug] (ID 5) - Error status: Sense Key $05, ASC $20
[2023-12-11 20:28:52.262] [trace] (ID 5) - Status phase, status is $02
[2023-12-11 20:28:52.262] [trace] (ID 5) - Bus Free phase

-> illegal_request, invalid_command_operation_code

Looking through the code (and adding a respective LogTrace call) reveals that
ModePageDevice::ModeSelect - which is not implemented and always throws - is called from ScsiController::XferOutBlockOriented.

It looks like an incomplete implementation ?!

kkaempf added a commit to kkaempf/piscsi that referenced this issue Dec 26, 2023
and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes PiSCSI#1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
kkaempf added a commit to kkaempf/piscsi that referenced this issue Dec 26, 2023
and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes PiSCSI#1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
kkaempf added a commit to kkaempf/piscsi that referenced this issue Jan 5, 2024
and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes PiSCSI#1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
kkaempf added a commit to kkaempf/piscsi that referenced this issue Jan 6, 2024
and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes PiSCSI#1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
kkaempf added a commit to kkaempf/piscsi that referenced this issue Jan 7, 2024
and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes PiSCSI#1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
rdmark pushed a commit that referenced this issue Jan 9, 2024
* Make ModeSelect() non-const

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Implement ModeSelect for scsicd

and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes #1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Test sector size setting via ModeSelect in SCSICD

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Re-calculate total blocks when sector size changes

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Reset CD data tracks after sector size change

The track calculation is based on sector size and must be reset after
change of sector size.

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* resize cache after change of sector size

The disk cache is based on sector size and must be resized when the
sector size changes.

Disk::ResizeCache needs a `raw` parameter, make this value accessible
from the current cache.

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Make GetRawMode const

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

---------

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
@rdmark
Copy link
Member

rdmark commented Jan 9, 2024

Merged. Thanks for contributing!

@rdmark rdmark closed this as completed Jan 9, 2024
kkaempf added a commit to kkaempf/piscsi that referenced this issue Apr 2, 2024
* Make ModeSelect() non-const

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Implement ModeSelect for scsicd

and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes PiSCSI#1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Test sector size setting via ModeSelect in SCSICD

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Re-calculate total blocks when sector size changes

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Reset CD data tracks after sector size change

The track calculation is based on sector size and must be reset after
change of sector size.

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* resize cache after change of sector size

The disk cache is based on sector size and must be resized when the
sector size changes.

Disk::ResizeCache needs a `raw` parameter, make this value accessible
from the current cache.

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Make GetRawMode const

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

---------

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
rdmark pushed a commit that referenced this issue May 1, 2024
* Make ModeSelect() non-const

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Implement ModeSelect for scsicd

and honor sector size setting.

DEC's VMS can't handle 2k sector sizes and uses ModeSelect6 to set the
sector size to 512 bytes.

Fixes #1397

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Test sector size setting via ModeSelect in SCSICD

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Re-calculate total blocks when sector size changes

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Reset CD data tracks after sector size change

The track calculation is based on sector size and must be reset after
change of sector size.

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* resize cache after change of sector size

The disk cache is based on sector size and must be resized when the
sector size changes.

Disk::ResizeCache needs a `raw` parameter, make this value accessible
from the current cache.

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

* Make GetRawMode const

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>

---------

Signed-off-by: Klaus Kämpf <kkaempf@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants