lkml.org 
[lkml]   [2006]   [Dec]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH v2] libata: Simulate REPORT LUNS for ATAPI devices
    The Quantum GoVault SATAPI removable disk device returns ATA_ERR in
    response to a REPORT LUNS packet. If this happens to an ATAPI device
    that is attached to a SAS controller (this is the case with sas_ata),
    the device does not load because SCSI won't touch a "SCSI device"
    that won't report its LUNs. Since most ATAPI devices don't support
    multiple LUNs anyway, we might as well fake a response like we do for
    ATA devices.

    Signed-off-by: Darrick J. Wong <djwong@us.ibm.com>
    ---

    drivers/ata/libata-scsi.c | 9 +++++++--
    1 files changed, 7 insertions(+), 2 deletions(-)

    diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
    index 47ea111..5ecf260 100644
    --- a/drivers/ata/libata-scsi.c
    +++ b/drivers/ata/libata-scsi.c
    @@ -2833,8 +2833,13 @@ static inline int __ata_scsi_queuecmd(st
    rc = ata_scsi_translate(dev, cmd, done, xlat_func);
    else
    ata_scsi_simulate(dev, cmd, done);
    - } else
    - rc = ata_scsi_translate(dev, cmd, done, atapi_xlat);
    + } else {
    + /* Simulate REPORT LUNS for ATAPI devices */
    + if (cmd->cmnd[0] == REPORT_LUNS)
    + ata_scsi_simulate(dev, cmd, done);
    + else
    + rc = ata_scsi_translate(dev, cmd, done, atapi_xlat);
    + }

    return rc;
    }
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2006-12-05 00:37    [W:3.577 / U:0.064 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site