Skip to content

Fix BSY pin handling in initiator mode#1312

Merged
uweseimet merged 4 commits intodevelopfrom
issue_1311
Nov 13, 2023
Merged

Fix BSY pin handling in initiator mode#1312
uweseimet merged 4 commits intodevelopfrom
issue_1311

Conversation

@uweseimet
Copy link
Copy Markdown
Contributor

@uweseimet uweseimet commented Nov 7, 2023

Just like #1284 this is another bug that must have always been there but has never been detected because usually initiator mode is not used. It's a pity, because I guess that none of the other SCSI solutions supports initiator mode.

Tested with the upcoming scsidump, which supports bus arbitration, which requires BSY to work.

@uweseimet uweseimet requested a review from dialtr November 7, 2023 15:34
@uweseimet uweseimet linked an issue Nov 7, 2023 that may be closed by this pull request
@uweseimet uweseimet changed the title In initiator mode configure BSY as an output pin when BSY is set Fix BSY pin handling in intiator mode Nov 7, 2023
@uweseimet uweseimet changed the title Fix BSY pin handling in intiator mode Fix BSY pin handling in initiator mode Nov 7, 2023
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Nov 9, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@uweseimet uweseimet marked this pull request as ready for review November 11, 2023 15:46
Copy link
Copy Markdown
Member

@rdmark rdmark left a comment

Choose a reason for hiding this comment

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

So you're saying that the BSY pin must be set for initiator mode and target mode alike, not just target mode?

@uweseimet
Copy link
Copy Markdown
Contributor Author

@rdmark Yes, exactly. The initiator has to set BSY in particular for a proper arbitration/selection, but the original code did not configure the BSY pin as output pin when setting BSY in initiator mode. So BSY was affectively never set in initiator mode. The result was the target only seeing the initiator ID but not its own when there was arbitration before selection, which is what the SCSI standard requires. And when there is no target ID on the bus, no potential target will do anything.
This bug became visible after I added arbitration to the new (upcoming) scsidump.

@uweseimet uweseimet merged commit 23e5286 into develop Nov 13, 2023
uweseimet added a commit that referenced this pull request Nov 13, 2023
* In initiator mode configure BSY as an output pin when BSY is set
uweseimet added a commit that referenced this pull request Nov 13, 2023
* In initiator mode configure BSY as an output pin when BSY is set
uweseimet added a commit that referenced this pull request Nov 13, 2023
* In initiator mode configure BSY as an output pin when BSY is set
@uweseimet uweseimet added the bug Something isn't working label Nov 13, 2023
@uweseimet uweseimet deleted the issue_1311 branch November 24, 2023 14:34
rdmark pushed a commit that referenced this pull request May 1, 2024
* In initiator mode configure BSY as an output pin when BSY is set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Initiator mode: Initiator cannot set BSY during ARBITRATION phase

2 participants