Re: Addronics 5-Port HPM-XU (USB/ESATA) port multiplier

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

 



Am Mittwoch, 4. Januar 2012, 21:16:09 schrieb Alan Stern:
> On Tue, 3 Jan 2012, Perry Wagle wrote:
> 
> > > You can test this by applying the patch below.  If it fixes the 
> > > problem, we'll know the diagnosis is correct.
> > 
> > With the patch, I'm able to mount both disks.  Thanks!
> > 
> > Now what?
> 
> Now that we know what the problem is, here's a real fix.  Replace the 
> previous patch with this one; if it works okay then I'll submit it for 
> inclusion in the next stable kernel release.

Looking at the following code from scsi.c:

int scsi_dispatch_cmd(struct scsi_cmnd *cmd)
{
        struct Scsi_Host *host = cmd->device->host;
        unsigned long timeout;
        int rtn = 0;

        atomic_inc(&cmd->device->iorequest_cnt);

        /* check if the device is still usable */
        if (unlikely(cmd->device->sdev_state == SDEV_DEL)) {
                /* in SDEV_DEL we error all commands. DID_NO_CONNECT
                 * returns an immediate error upwards, and signals
                 * that the device is no longer present */
                cmd->result = DID_NO_CONNECT << 16;
                scsi_done(cmd);
                /* return 0 (because the command has been processed) */
                goto out;
        }

        /* Check to see if the scsi lld made this device blocked. */
        if (unlikely(scsi_device_blocked(cmd->device))) {
                /* 
                 * in blocked state, the command is just put back on
                 * the device queue.  The suspend state has already
                 * blocked the queue so future requests should not
                 * occur until the device transitions out of the
                 * suspend state.
                 */

                scsi_queue_insert(cmd, SCSI_MLQUEUE_DEVICE_BUSY);

                SCSI_LOG_MLQUEUE(3, printk("queuecommand : device blocked \n"));

                /*
                 * NOTE: rtn is still zero here because we don't need the
                 * queue to be plugged on return (it's already stopped)
                 */
                goto out;
        }

        /* 
         * If SCSI-2 or lower, store the LUN value in cmnd.
         */
        if (cmd->device->scsi_level <= SCSI_2 &&
            cmd->device->scsi_level != SCSI_UNKNOWN) {
                cmd->cmnd[1] = (cmd->cmnd[1] & 0x1f) |
                               (cmd->device->lun << 5 & 0xe0);


I am really unsure whether this change is really safe.
In particular I doubt it is material for the stable tree.

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


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux