Re: [PATCH] Add HDIO_DRIVE_RESET ioctl to libata.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Aug 02, 2013 at 04:10:28PM -0700, Lucas Magasweran wrote:
> +static int ata_drive_reset_ioctl(struct scsi_device *scsidev, struct ata_port *ap)
> +{
> +	unsigned long deadline = ata_deadline(jiffies, ATA_TMOUT_INTERNAL_QUICK);
> +	unsigned int class;
> +	int rc = 0;
> +	unsigned long sleep_ms = ATA_TMOUT_INTERNAL_QUICK;
> +	/* unsigned long flags; */
> +
> +	if (ap->ops->softreset) {
> +		/* block further commands from being queued during reset */
> +		rc = scsi_internal_device_block(scsidev);
> +
> +		/*
> +		 * TODO Find the worst-case timeout value and sleep until it completes.
> +		 * Alternatively, we can blk_abort_request in-flight commands as
> +		 * done in ata_qc_schedule_eh() if the SRST should be immediate.
> +		 */
> +		while ( ap->qc_active && sleep_ms > 0 ) {
> +			ata_msleep(ap, sleep_ms);
> +			sleep_ms -= 1000;
> +		}

Whoa...

> +		/* should not need to acquire ap->lock since command queue is blocked */
> +		/* spin_lock_irqsave(ap->lock, flags); */
> +
> +		/* send ATA Software Reset SRST */
> +		rc = ap->ops->softreset(&ap->link, &class, deadline);

Nope nope nope.

It can actually be pretty trivially implemented by scheduling EH with
SRST action.  That said, I don't konw what use this would be?  Why is
the ioctl even necessary?

Thanks.

-- 
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Filesystems]     [Linux SCSI]     [Linux RAID]     [Git]     [Kernel Newbies]     [Linux Newbie]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Samba]     [Device Mapper]

  Powered by Linux