On 11/11/19 6:29 AM, Diego Elio Pettenò wrote: > The Beurer GL50 evo uses a Cygnal/Cypress-manufactured CD-on-a-chip that > only accepts a subset of SCSI commands. > > Most of the not-implemented commands are fine to fail, but a few, > particularly around the MMC or Audio commands, will put the device into an > unrecoverable state, so they need to be avoided at all costs. > > In addition to adding a new vendor entry to sr_vendor, this required gating > a few functions in the cdrom driver to not even try sending the command > when the capability is not present. This is pretty horrible, but not really your fault. Just one minor note: > @@ -1162,7 +1168,9 @@ int cdrom_open(struct cdrom_device_info *cdi, struct block_device *bdev, > ret = open_for_data(cdi); > if (ret) > goto err; > - cdrom_mmc3_profile(cdi); > + if (CDROM_CAN(CDC_GENERIC_PACKET)) { > + cdrom_mmc3_profile(cdi); > + } > if (mode & FMODE_WRITE) { > ret = -EROFS; > if (cdrom_open_write(cdi)) Just make that: if (CDROM_CAN(CDC_GENERIC_PACKET)) cdrom_mmc3_profile(cdi); And you probably want to split this patch into two, one with the necessary changes to cdrom.c, and one that adds the Beuer device to sr_vendor.c. -- Jens Axboe