Project

General

Profile

Bug #12219

sata: Wrong minor number for devctl

Added by Marcel Telka 29 days ago.

Status:
In Progress
Priority:
Normal
Assignee:
Category:
driver - device drivers
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:

Description

The sata module creates devctl node with wrong minor number:

909    ASSERT(ddi_get_instance(dip) <= (L_MAXMIN >> INST_MINOR_SHIFT));
910    if (ddi_create_minor_node(dip, "devctl", S_IFCHR,
911        INST2DEVCTL(ddi_get_instance(dip)),
912        DDI_NT_SATA_NEXUS, 0) != DDI_SUCCESS) {

Instead of INST2DEVCTL() macro there had to be used SATA_MAKE_DEVCTL_MINOR(). This causes confusion in sata_devt_to_devinfo() and then also in sata_hba_open(), sata_hba_close(), and sata_hba_ioctl() respectively.

Examples of wrong minor numbers:

# ls -l /devices/pci@0,0/pci8086,159@1,2
total 1
drwxr-xr-x   4 root     sys            4 Jan  4 15:50 pci1b21,1060@0
crw-r--r--   1 root     sys       11, 3072 Jan 16 20:08 pci1b21,1060@0:0
crw-r--r--   1 root     sys       11, 3073 Jan 16 20:08 pci1b21,1060@0:1
crw-r--r--   1 root     sys       11, 64 Jan 17 15:33 pci1b21,1060@0:devctl
# ls -l /devices/pci@0,0/pci8086,1c10@1c
total 1
drwxr-xr-x   4 root     sys            4 Jan  4 15:24 pci1b21,1060@0
crw-r--r--   1 root     sys       11, 5120 Jan 16 20:08 pci1b21,1060@0:0
crw-r--r--   1 root     sys       11, 5121 Jan 16 20:08 pci1b21,1060@0:1
crw-r--r--   1 root     sys       11, 128 Jan 17 15:33 pci1b21,1060@0:devctl
#

Also available in: Atom PDF