From: Jens Axboe <axboe@kernel.dk>
To: "Diego Elio Pettenò" <flameeyes@flameeyes.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] cdrom: support Beurer GL50 evo CD-on-a-chip devices.
Date: Tue, 19 Nov 2019 09:08:58 -0700 [thread overview]
Message-ID: <80f9668f-2c2f-e81f-54e5-c47da6f0d6f3@kernel.dk> (raw)
In-Reply-To: <20191111132955.19361-1-flameeyes@flameeyes.com>
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
prev parent reply other threads:[~2019-11-19 16:09 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-11 13:29 [PATCH] cdrom: support Beurer GL50 evo CD-on-a-chip devices Diego Elio Pettenò
2019-11-19 16:08 ` Jens Axboe [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=80f9668f-2c2f-e81f-54e5-c47da6f0d6f3@kernel.dk \
--to=axboe@kernel.dk \
--cc=flameeyes@flameeyes.com \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox