Project

General

Profile

Actions

Bug #13818

closed

Insyde BMC virtual CD-ROM confused by MODE SENSE

Added by Joshua M. Clulow about 1 year ago. Updated 11 months ago.

Status:
Closed
Priority:
Normal
Category:
driver - device drivers
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Medium
Tags:
Gerrit CR:

Description

Many baseboard management controllers (BMC) include a facility to attach an ISO file as an emulated CD-ROM drive, allowing a server to be booted remotely from virtual media. At least one model of BMC from Insyde Software has an incompletely implemented virtual CD-ROM device. The implementation is mostly in Javascript, running within the browser where the operator has mounted the ISO file, to which USB messages are tunneled to be handled by the emulation. Fortunately our scsa2usb quirks list is able to avoid sending the MODE SENSE to this emulated device.


Related issues

Related to illumos gate - Bug #13817: scsa2usb quirks list does not correctly use revision fieldClosedJoshua M. Clulow

Actions
Actions #1

Updated by Electric Monk about 1 year ago

  • Gerrit CR set to 1506
Actions #2

Updated by Joshua M. Clulow 11 months ago

  • Related to Bug #13817: scsa2usb quirks list does not correctly use revision field added
Actions #3

Updated by Joshua M. Clulow 11 months ago

Testing Notes

Before Change

I created a ramdisk image of stock illumos bits and used it to boot (via PXE) a system with an Insyde BMC. Once booted, I confirmed that "inserting" an ISO file into the virtual CD-ROM messed things up. In particular, diskinfo would hang forever, trying to get a devices snapshot, and through kmdb we could see that sd was trapped in a MODE SENSE:

    [3]> ::stacks -m sd
    THREAD           STATE    SOBJ                COUNT
    fffffe00f7a23c20 SLEEP    SEMA                    1
                     swtch+0x133
                     sema_p+0x1cf
                     biowait+0xa4
                     default_physio+0x2cc
                     physio+0x11
                     scsi`scsi_uscsi_handle_cmd+0x2bd
                     sd`sd_ssc_send+0x12f
                     sd`sd_send_scsi_MODE_SENSE+0x174
                     sd`sd_get_caching_mode_page+0xb4
                     sd`sd_get_write_cache_enabled+0x6d
                     sd`sd_unit_attach+0xa84
                     sd`sdattach+0x2d
                     devi_attach+0xa1
                     attach_node+0x8b
                     i_ndi_config_node+0x12c
                     i_ddi_attachchild+0x3a
                     devi_attach_node+0x5d
                     config_immediate_children+0xd0
                     ndi_busop_bus_config+0x98
                     scsa2usb`scsa2usb_scsi_bus_config+0xbc
                     scsi`scsi_hba_bus_config+0x72
                     devi_config_common+0xcf
                     mt_config_thread+0x13a
                     thread_start+0xb

I "unplugged" the virtual CD-ROM and things immediately came good after we gave up:

    Oct  5 04:02:22 unknown scsi: WARNING: /pci@1d,0/pci1022,1484@8,1/pci1022,148c@0,3/hub@2/storage@1/disk@0,0 (sd1):
    Oct  5 04:02:22 unknown         Command failed to complete...Device is gone

After Change

I build another ramdisk with new bits built with this change (and #13817 upon which it depends). After inserting the CD-ROM this time, diskinfo was able to complete; NB, diskinfo does not actually list CD-ROM drives, but it at least was not hung. I was able to mount the hsfs file system on the device and read the contents.

I confirmed at the scsa2usb level that the device had the expected attribute disabled as per the quirks table:

> *scsa2usb_statep::walk softstate | ::print struct scsa2usb_state scsa2usb_dip | ::devinfo -q
fffffeb1cdd65c78 usbif,class8, instance #0 (driver name: scsa2usb)

> fffffeb1cdd65c78::devinfo ! grep -A1 usb-.*-id
            name='usb-revision-id' type=int items=1
                value=00000409
            name='usb-product-id' type=int items=1
                value=000003ea
            name='usb-vendor-id' type=int items=1
                value=00000b1f

> *scsa2usb_statep::walk softstate | ::print struct scsa2usb_state scsa2usb_attrs
scsa2usb_attrs = 0xfdff
> ~fdff=x
                200
> scsa2usb_quirks::print ! tail
        q_rev = 0xffff
        q_attr = 0x4000
    },
    {
        q_vid = 0xb1f
        q_pid = 0x3ea
        q_rev = 0xffff
        q_attr = 0x200
    },
]
Actions #4

Updated by Electric Monk 11 months ago

  • Status changed from New to Closed
  • % Done changed from 0 to 100

git commit cefe3a5bc6997118798a0014a97aafc3a381efce

commit  cefe3a5bc6997118798a0014a97aafc3a381efce
Author: Joshua M. Clulow <josh@sysmgr.org>
Date:   2021-06-29T18:31:06.000Z

    13818 Insyde BMC virtual CD-ROM confused by MODE SENSE
    Reviewed by: Andy Fiddaman <andy@omnios.org>
    Reviewed by: Toomas Soome <tsoome@me.com>
    Approved by: Richard Lowe <richlowe@richlowe.net>

Actions

Also available in: Atom PDF