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

Fix CTL GET EVENT STATUS NOTIFICATION valid bits #1201

Closed
wants to merge 1 commit into from

Conversation

hpvb
Copy link
Contributor

@hpvb hpvb commented Apr 26, 2024

Linux as an initiator periodically sends the following to SCSI cdrom devices: 4a 01 00 00 10 00 00 00 08 00

According to the ctl_cmd_entry for this command this is invalid which leads to a lot of failed SCSI commands.

The mask in this commit is based off of the t10 spec available here: https://www.t10.org/ftp/t10/document.97/97-108r0.pdf

And @bsdimp's research.

This solves the issue with Linux initiators.

sys/cam/ctl/ctl_cmd_table.c Outdated Show resolved Hide resolved
@bsdimp
Copy link
Member

bsdimp commented Apr 26, 2024

So this one was fun to track down... Glad I spent a fair amount of time downloading the scsi specs ages ago... gotta go look for mmc5 and mmc6 it turns out...

@hpvb
Copy link
Contributor Author

hpvb commented Apr 26, 2024

I've adjusted the PR based on your input.

@amotin
Copy link
Member

amotin commented Apr 26, 2024

@hpvb I'm sorry, but I don't see the changes.

@hpvb
Copy link
Contributor Author

hpvb commented Apr 26, 2024

@hpvb I'm sorry, but I don't see the changes.

I forgot at git add the file when I amended the commit. Sorry! Fixed.

@@ -1227,7 +1227,7 @@ const struct ctl_cmd_entry ctl_cmd_table[256] =
CTL_CMD_FLAG_ALLOW_ON_PR_RESV |
CTL_FLAG_DATA_IN,
CTL_LUN_PAT_NONE,
10, {0x02, 0x01, 0, 0, 0, 0xff, 0xff, 0xff, 0x07}},
10, {0xe1, 0, 0, 0x7e, 0, 0x0, 0xff, 0xff, 0xc7}},

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This style checker message is a bit too zealous.

Copy link
Member

@bsdimp bsdimp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is good, but will defer to mav@ on the details since my ctl fu is still weak.

sys/cam/ctl/ctl_cmd_table.c Outdated Show resolved Hide resolved
Linux as an initiator periodically sends the following to SCSI cdrom
devices: 4a 01 00 00 10 00 00 00 08 00

According to the ctl_cmd_entry for this command this is invalid which
leads to a lot of failed SCSI commands.

The mask in this commit is based off of the t10 spec available here:
https://www.t10.org/ftp/t10/document.97/97-108r0.pdf

And @bsdimp's research.

This solves the issue with Linux initiators.

Signed-off-by: HP van Braam <hp@tmm.cx>
@bsdimp
Copy link
Member

bsdimp commented Apr 29, 2024

Landed with tweaked commit message to spell out what my research is / was.

@bsdimp bsdimp closed this Apr 29, 2024
@bsdimp bsdimp added the merged label Apr 29, 2024
freebsd-git pushed a commit that referenced this pull request Apr 29, 2024
Linux as an initiator periodically sends the following to SCSI cdrom
devices: 4a 01 00 00 10 00 00 00 08 00

According to the ctl_cmd_entry for this command this is invalid which
leads to a lot of failed SCSI commands.

The mask in this commit is based off of an early draft of the mmc
standard, https://www.t10.org/ftp/t10/document.97/97-108r0.pdf,
as well as subsequent standards (mmc2 through mmc6).

This solves the issue with Linux initiators.

Signed-off-by: HP van Braam <hp@tmm.cx>
Reviewed by: imp, mav
Pull Request: #1201
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants