| Summary: | [cam] [patch] cd(4) patch for drives/discs failing the 'read toc' command | ||||||
|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Juergen Lock <nox> | ||||
| Component: | kern | Assignee: | Andriy Gapon <avg> | ||||
| Status: | Closed FIXED | ||||||
| Severity: | Affects Only Me | ||||||
| Priority: | Normal | ||||||
| Version: | 8.0-BETA3 | ||||||
| Hardware: | Any | ||||||
| OS: | Any | ||||||
| Attachments: |
|
||||||
|
Description
Juergen Lock
2009-09-13 22:20:07 UTC
Clarification: drives accessed as /dev/cdX are affected, drives accessed as /dev/acdX are not. Responsible Changed From-To: freebsd-bugs->freebsd-scsi Patch affects CAM. State Changed From-To: open->analyzed I will take over this PR... The problem is that the scsi-cd.c driver attempts to read the LEADOUT track of the disc, and if it can't, assumes the disc is not valid.. For some Blu-Ray drives, they, per the spec, do not allow reading of the LEADOUT track... I also have a drive that fails.. I am currently working on a patch to not read the LEADOUT track, but keep the original behavior as a sysctl incase it breaks older cd-rom drives. Responsible Changed From-To: freebsd-scsi->jmg I will take over this PR... The problem is that the scsi-cd.c driver attempts to read the LEADOUT track of the disc, and if it can't, assumes the disc is not valid.. For some Blu-Ray drives, they, per the spec, do not allow reading of the LEADOUT track... I also have a drive that fails.. I am currently working on a patch to not read the LEADOUT track, but keep the original behavior as a sysctl incase it breaks older cd-rom drives. It seems that I completely missed this problem and the PR and the patch, and while looking into a similar issue I came up with the same conclusions and with a somewhat similar patch: http://docs.freebsd.org/cgi/mid.cgi?4BBCFE30.2010709 Juergen, could you please give a try to my patch as well? John-Mark, I can take over the PR if you are busy at the moment. Thanks! -- Andriy Gapon On Thu, Apr 08, 2010 at 01:12:24AM +0300, Andriy Gapon wrote:
>
> It seems that I completely missed this problem and the PR and the patch, and
> while looking into a similar issue I came up with the same conclusions and with
> a somewhat similar patch:
> http://docs.freebsd.org/cgi/mid.cgi?4BBCFE30.2010709
>
> Juergen,
> could you please give a try to my patch as well?
Just did, and found that patch fixes my issue as well.
Thanx, :)
Juergen
I have a Plextor CD-RW drive, where reading "mastered" DVDs via cd(4) is failing (via acd(4) it's working fine) and the patch proposed initially solved this. Please give me a day or two to test the second patch. Thanks! Responsible Changed From-To: jmg->avg I have an interest in this issue, so I am helping jmg here. State Changed From-To: analyzed->patched A fix is applied in head. Author: avg Date: Thu Apr 15 09:22:14 2010 New Revision: 206651 URL: http://svn.freebsd.org/changeset/base/206651 Log: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and d_mediasize [Forced commit to correct PR number.] CD_FLAG_VALID_TOC is not required for setting those media properties. PR: kern/138789 Submitted by: Juergen Lock <nox@jelal.kn-bremen.de> a slightly different version Tested by: Pavel Sukhoy <sukhoy@ripn.net>, Markus Wild <m.wild@cybernet.ch>, Juergen Lock <nox@jelal.kn-bremen.de>, uqs MFC after: 1 week Modified: head/sys/cam/scsi/scsi_cd.c Modified: head/sys/cam/scsi/scsi_cd.c ============================================================================== _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Author: avg Date: Thu Apr 22 11:46:42 2010 New Revision: 207059 URL: http://svn.freebsd.org/changeset/base/207059 Log: MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and d_mediasize PR: kern/138789 Modified: stable/8/sys/cam/scsi/scsi_cd.c Directory Properties: stable/8/sys/ (props changed) stable/8/sys/amd64/include/xen/ (props changed) stable/8/sys/cddl/contrib/opensolaris/ (props changed) stable/8/sys/contrib/dev/acpica/ (props changed) stable/8/sys/contrib/pf/ (props changed) stable/8/sys/dev/xen/xenpci/ (props changed) stable/8/sys/geom/sched/ (props changed) Modified: stable/8/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/8/sys/cam/scsi/scsi_cd.c Thu Apr 22 09:30:02 2010 (r207058) +++ stable/8/sys/cam/scsi/scsi_cd.c Thu Apr 22 11:46:42 2010 (r207059) @@ -2777,8 +2777,12 @@ cdcheckmedia(struct cam_periph *periph) softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC); cdprevent(periph, PR_ALLOW); return (error); - } else + } else { softc->flags |= CD_FLAG_VALID_MEDIA; + softc->disk->d_sectorsize = softc->params.blksize; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * softc->params.disksize; + } /* * Now we check the table of contents. This (currently) is only @@ -2867,9 +2871,6 @@ cdcheckmedia(struct cam_periph *periph) } softc->flags |= CD_FLAG_VALID_TOC; - softc->disk->d_sectorsize = softc->params.blksize; - softc->disk->d_mediasize = - (off_t)softc->params.blksize * softc->params.disksize; bailout: _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" Author: avg Date: Thu Apr 22 12:12:52 2010 New Revision: 207060 URL: http://svn.freebsd.org/changeset/base/207060 Log: MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set d_sectorsize and d_mediasize Note that there is a redundant assignment of d_maxsize. PR: kern/138789 Modified: stable/7/sys/cam/scsi/scsi_cd.c Directory Properties: stable/7/sys/ (props changed) stable/7/sys/cddl/contrib/opensolaris/ (props changed) stable/7/sys/contrib/dev/acpica/ (props changed) stable/7/sys/contrib/pf/ (props changed) Modified: stable/7/sys/cam/scsi/scsi_cd.c ============================================================================== --- stable/7/sys/cam/scsi/scsi_cd.c Thu Apr 22 11:46:42 2010 (r207059) +++ stable/7/sys/cam/scsi/scsi_cd.c Thu Apr 22 12:12:52 2010 (r207060) @@ -2773,8 +2773,12 @@ cdcheckmedia(struct cam_periph *periph) softc->flags &= ~(CD_FLAG_VALID_MEDIA|CD_FLAG_VALID_TOC); cdprevent(periph, PR_ALLOW); return (error); - } else + } else { softc->flags |= CD_FLAG_VALID_MEDIA; + softc->disk->d_sectorsize = softc->params.blksize; + softc->disk->d_mediasize = + (off_t)softc->params.blksize * softc->params.disksize; + } /* * Now we check the table of contents. This (currently) is only @@ -2864,9 +2868,6 @@ cdcheckmedia(struct cam_periph *periph) softc->flags |= CD_FLAG_VALID_TOC; softc->disk->d_maxsize = DFLTPHYS; - softc->disk->d_sectorsize = softc->params.blksize; - softc->disk->d_mediasize = - (off_t)softc->params.blksize * softc->params.disksize; bailout: _______________________________________________ svn-src-all@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/svn-src-all To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org" State Changed From-To: patched->closed This PR has been resolved in HEAD and supported stable branches. |