Bug 211716 - [PATCH] USB Driver didn't get the right size
Summary: [PATCH] USB Driver didn't get the right size
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: usb (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-usb (Nobody)
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-08-10 07:10 UTC by howard0su
Modified: 2019-01-21 19:15 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description howard0su 2016-08-10 07:10:45 UTC
One I-O Data USB Flash Disk cannot get the right size. the dmesg shows
umass0: <I-O DATA USB Flash Disk, class 0/0, rev 2.10/0.01, addr 2> on usbus7
umass0:  SCSI over Bulk-Only; quirks = 0x8100
umass0:6:0: Attached to scbus6
da0 at umass-sim0 bus 0 scbus6 target 0 lun 0
da0: <I-O DATA USB Flash Disk 1.00> Removable Direct Access SPC-4 SCSI device
da0: Serial Number 137161312223005B
da0: 40.000MB/s transfers
da0: 0MB (1 512 byte sectors)
da0: quirks=0x2<NO_6_BYTE>

The following patch solves the problem:
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c
index b869467..0614b28 100644
--- a/sys/cam/scsi/scsi_da.c
+++ b/sys/cam/scsi/scsi_da.c
@@ -1295,6 +1295,13 @@ static struct da_quirk_entry da_quirk_table[] =
                { T_DIRECT, SIP_MEDIA_REMOVABLE, "MX", "MXUB3*", "*"},
                /*quirks*/DA_Q_NO_RC16
        },
+       {
+               /*
+                * I-O Data USB Flash Disk
+                */
+               { T_DIRECT, SIP_MEDIA_REMOVABLE, "I-O DATA", "USB Flash Disk*", "*"},
+               /*quirks*/DA_Q_NO_RC16
+       },
 };
 
 static disk_strategy_t dastrategy;

After the patch the size is correctly detected.
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-08-11 03:13:11 UTC
A commit references this bug:

Author: sephe
Date: Thu Aug 11 03:12:57 UTC 2016
New revision: 303944
URL: https://svnweb.freebsd.org/changeset/base/303944

Log:
  cam/da: Add quirk for I-O Data USB Flash Disk

  PR:		211716
  Submitted by:	Jun Su <junsu microsoft com>
  Reported by:	Jun Su <junsu microsoft com>
  MFC after:	1 week
  Sponsored by:	Microsoft

Changes:
  head/sys/cam/scsi/scsi_da.c
Comment 2 commit-hook freebsd_committer freebsd_triage 2016-10-13 01:59:29 UTC
A commit references this bug:

Author: sephe
Date: Thu Oct 13 01:58:50 UTC 2016
New revision: 307162
URL: https://svnweb.freebsd.org/changeset/base/307162

Log:
  MFC 303944

      cam/da: Add quirk for I-O Data USB Flash Disk

      PR:             211716
      Submitted by:   Jun Su <junsu microsoft com>
      Reported by:    Jun Su <junsu microsoft com>
      Sponsored by:   Microsoft

Changes:
_U  stable/10/
  stable/10/sys/cam/scsi/scsi_da.c
Comment 3 commit-hook freebsd_committer freebsd_triage 2016-10-17 05:40:02 UTC
A commit references this bug:

Author: sephe
Date: Mon Oct 17 05:39:45 UTC 2016
New revision: 307474
URL: https://svnweb.freebsd.org/changeset/base/307474

Log:
  MFC 303944

      cam/da: Add quirk for I-O Data USB Flash Disk

      PR:             211716
      Submitted by:   Jun Su <junsu microsoft com>
      Reported by:    Jun Su <junsu microsoft com>
      Sponsored by:   Microsoft

Changes:
_U  stable/11/
  stable/11/sys/cam/scsi/scsi_da.c
Comment 4 Oleksandr Tymoshenko freebsd_committer freebsd_triage 2019-01-21 19:15:10 UTC
There is a commit referencing this PR, but it's still not closed and has been inactive for some time. Closing the PR as fixed but feel free to re-open it if the issue hasn't been completely resolved.

Thanks