Bug 5755 - 16 byte CDBs not enabled in Adaptec SCSI HBA drivers
Summary: 16 byte CDBs not enabled in Adaptec SCSI HBA drivers
Status: RESOLVED CODE_FIX
Alias: None
Product: SCSI Drivers
Classification: Unclassified
Component: Other (show other bugs)
Hardware: i386 Linux
: P2 low
Assignee: Hannes Reinecke
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-12-16 14:42 UTC by Brian Rodriguez
Modified: 2007-07-23 02:00 UTC (History)
2 users (show)

See Also:
Kernel Version: 2.6.12
Subsystem:
Regression: ---
Bisected commit-id:


Attachments
proposed patch to enable 16 byte CDBs in the aic7xxx/aic79xx driver (1.15 KB, patch)
2006-02-15 08:26 UTC, Chip Coldwell
Details | Diff
aic7xx-enable-16byte-CDBs (1.31 KB, patch)
2007-07-23 01:59 UTC, Hannes Reinecke
Details | Diff

Description Brian Rodriguez 2005-12-16 14:42:07 UTC
Problem Description:

The Adaptec aic7xxx / aic79xx HBA drivers use the default max_cmd_len of 12,
when in fact the hardware supports 16 byte CDBs. This can be corrected by adding
the line:

host->max_cmd_len = 16;

soon after the call to scsi_host_alloc() in aic7xxx_osm.c and aic79xx_osm.c. I
have confirmed that this change functions correctly. 

This feature is important because Quantum's latest drives (SDLT600, DLT-S4 and
DLT-V4) use the 16 byte commands 8C (Read Attributes) and 8D (Write Attributes)
to implement their WORM functionality. In order to support this feature on Linux
platforms 16 byte CDBs must be enabled in the individual HBA driver.
Comment 1 Brian Rodriguez 2005-12-16 14:52:24 UTC
This same problem applies to many other HBAs as well, but I have not tested the
change since I don't have the hardware available. Some hardware may not support
16 byte CDBs.
Comment 2 Andrew Morton 2006-01-19 03:46:17 UTC

Begin forwarded message:

Date: Fri, 16 Dec 2005 14:50:39 -0800
From: bugme-daemon@bugzilla.kernel.org
To: bugme-new@lists.osdl.org
Subject: [Bugme-new] [Bug 5755] New: 16 byte CDBs not enabled in Adaptec SCSI HBA drivers


http://bugzilla.kernel.org/show_bug.cgi?id=5755

           Summary: 16 byte CDBs not enabled in Adaptec SCSI HBA drivers
    Kernel Version: 2.6.12
            Status: NEW
          Severity: low
             Owner: andmike@us.ibm.com
         Submitter: brianr01@yahoo.com


Problem Description:

The Adaptec aic7xxx / aic79xx HBA drivers use the default max_cmd_len of 12,
when in fact the hardware supports 16 byte CDBs. This can be corrected by adding
the line:

host->max_cmd_len = 16;

soon after the call to scsi_host_alloc() in aic7xxx_osm.c and aic79xx_osm.c. I
have confirmed that this change functions correctly. 

This feature is important because Quantum's latest drives (SDLT600, DLT-S4 and
DLT-V4) use the 16 byte commands 8C (Read Attributes) and 8D (Write Attributes)
to implement their WORM functionality. In order to support this feature on Linux
platforms 16 byte CDBs must be enabled in the individual HBA driver.

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.

Comment 3 Chip Coldwell 2006-02-15 08:26:44 UTC
Created attachment 7346 [details]
proposed patch to enable 16 byte CDBs in the aic7xxx/aic79xx driver

Here's a proposed patch to resolve this bug; it changes two lines of code.

The only risks I can see is if there are versions of the Adaptec HBAs that
don't support 16 byte CDBs that are supported by these drivers.
Comment 4 Hannes Reinecke 2006-10-24 00:08:06 UTC
Not quite so. aic79xx has a specific register CDBLIMIT which holds the maximum
CDB length. It is initialised with 0xc, ie 12 byte CDBs.
It's 
Comment 5 Hannes Reinecke 2006-10-24 00:10:19 UTC
(Rah, hit the 'commit' button too early).
It's quite unclear if this is a soft- or a hard limit. The sources seem to
indicate that 16-byte CDBs are possible, but only for 12-byte CDBs it can do
autosense. Some more investigation is needed, I think.
Comment 6 Natalie Protasevich 2007-07-22 17:31:54 UTC
Any updates on this problem?
Thanks.
Comment 7 Hannes Reinecke 2007-07-23 01:59:22 UTC
Created attachment 12099 [details]
aic7xx-enable-16byte-CDBs

Patch to enable large CDBs in aic7xxx/aic79xx.
Comment 8 Hannes Reinecke 2007-07-23 02:00:37 UTC
After further digging I think it's reasonably safe to enable large CDBs in the driver. However, we should stick to the driver defined values (ie 32 bytes for aic7xxx and 16 byte for aic79xx).
Patch has been sent to linux-scsi for inclusion.

Note You need to log in before you can comment on or make changes to this bug.