Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03939864 authored by Gerd Hoffmann's avatar Gerd Hoffmann Committed by Greg Kroah-Hartman
Browse files

USB: uas: fix task management



Allocate one tag for task management functions and
use it properly.

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent a0e39e34
Loading
Loading
Loading
Loading
+3 −3
Original line number Original line Diff line number Diff line
@@ -611,7 +611,7 @@ static int uas_eh_task_mgmt(struct scsi_cmnd *cmnd,
{
{
	struct Scsi_Host *shost = cmnd->device->host;
	struct Scsi_Host *shost = cmnd->device->host;
	struct uas_dev_info *devinfo = (void *)shost->hostdata[0];
	struct uas_dev_info *devinfo = (void *)shost->hostdata[0];
	u16 tag = 9999; /* FIXME */
	u16 tag = devinfo->qdepth - 1;


	memset(&devinfo->response, 0, sizeof(devinfo->response));
	memset(&devinfo->response, 0, sizeof(devinfo->response));
	if (uas_submit_sense_urb(shost, GFP_NOIO, tag)) {
	if (uas_submit_sense_urb(shost, GFP_NOIO, tag)) {
@@ -701,7 +701,7 @@ static int uas_slave_configure(struct scsi_device *sdev)
{
{
	struct uas_dev_info *devinfo = sdev->hostdata;
	struct uas_dev_info *devinfo = sdev->hostdata;
	scsi_set_tag_type(sdev, MSG_ORDERED_TAG);
	scsi_set_tag_type(sdev, MSG_ORDERED_TAG);
	scsi_activate_tcq(sdev, devinfo->qdepth - 2);
	scsi_activate_tcq(sdev, devinfo->qdepth - 3);
	return 0;
	return 0;
}
}


@@ -880,7 +880,7 @@ static int uas_probe(struct usb_interface *intf, const struct usb_device_id *id)
	init_usb_anchor(&devinfo->data_urbs);
	init_usb_anchor(&devinfo->data_urbs);
	uas_configure_endpoints(devinfo);
	uas_configure_endpoints(devinfo);


	result = scsi_init_shared_tag_map(shost, devinfo->qdepth - 2);
	result = scsi_init_shared_tag_map(shost, devinfo->qdepth - 3);
	if (result)
	if (result)
		goto free;
		goto free;