Skip to contentSkip to conversation

megaraid_sas: direct drive access for smartctl and hdparm

DISCUSSION Jochen Radmacher 1 participant 1 message May 7, 2008 SCSI

lore
Share & tools
lore
#0 lore raw

I was trying to get some useful SMART Information from the SATA drives connected to my PERC5/i controller, but the PERC had no options for that. When browsing through the kernel sources I found this:

static int megasas_slave_configure(struct scsi_device *sdev) {
/*
* Don't export physical disk devices to the disk driver. *
* FIXME: Currently we don't export them to the midlayer at all.
* That will be fixed once LSI engineers have audited the
* firmware for possible issues.
*/
if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type ==
TYPE_DISK)

                return -ENXIO;

I changed the if{ } to:

        if (sdev->channel < MEGASAS_MAX_PD_CHANNELS && sdev->type == 
TYPE_DISK)
        {
                sdev->writeable=1;
                sdev->no_uld_attach=1;
                return 0;
        }

This way I get sgX devices (and no extra sdX devices), which work fine with smartctl 5.37 and hdparm 8.4 . hdparm seems to need kernel 2.6.24 or greater for the pass through to work.

This only is a proof of concept and I have no idea how to implement this correctly. Regards,
Jochen Radmacher