Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93923
b: refs/heads/master
c: 93c20a5
h: refs/heads/master
i:
  93921: 0710e99
  93919: d996bd7
v: v3
  • Loading branch information
FUJITA Tomonori authored and James Bottomley committed Apr 22, 2008
1 parent 09c47b1 commit 5faac1b
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 97f46ae45c70857e459b7f8df1fc2807e7bd90a9
refs/heads/master: 93c20a59af4624aedf53f8320606b355aa951bc1
22 changes: 20 additions & 2 deletions trunk/drivers/scsi/scsi_transport_sas.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,13 +192,24 @@ static void sas_non_host_smp_request(struct request_queue *q)
sas_smp_request(q, rphy_to_shost(rphy), rphy);
}

static void sas_host_release(struct device *dev)
{
struct Scsi_Host *shost = dev_to_shost(dev);
struct sas_host_attrs *sas_host = to_sas_host_attrs(shost);
struct request_queue *q = sas_host->q;

if (q)
blk_cleanup_queue(q);
}

static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
{
struct request_queue *q;
int error;
struct device *dev;
char namebuf[BUS_ID_SIZE];
const char *name;
void (*release)(struct device *);

if (!to_sas_internal(shost->transportt)->f->smp_handler) {
printk("%s can't handle SMP requests\n", shost->hostt->name);
Expand All @@ -209,17 +220,19 @@ static int sas_bsg_initialize(struct Scsi_Host *shost, struct sas_rphy *rphy)
q = blk_init_queue(sas_non_host_smp_request, NULL);
dev = &rphy->dev;
name = dev->bus_id;
release = NULL;
} else {
q = blk_init_queue(sas_host_smp_request, NULL);
dev = &shost->shost_gendev;
snprintf(namebuf, sizeof(namebuf),
"sas_host%d", shost->host_no);
name = namebuf;
release = sas_host_release;
}
if (!q)
return -ENOMEM;

error = bsg_register_queue(q, dev, name, NULL);
error = bsg_register_queue(q, dev, name, release);
if (error) {
blk_cleanup_queue(q);
return -ENOMEM;
Expand Down Expand Up @@ -253,7 +266,6 @@ static void sas_bsg_remove(struct Scsi_Host *shost, struct sas_rphy *rphy)
return;

bsg_unregister_queue(q);
blk_cleanup_queue(q);
}

/*
Expand Down Expand Up @@ -1301,6 +1313,9 @@ static void sas_expander_release(struct device *dev)
struct sas_rphy *rphy = dev_to_rphy(dev);
struct sas_expander_device *edev = rphy_to_expander_device(rphy);

if (rphy->q)
blk_cleanup_queue(rphy->q);

put_device(dev->parent);
kfree(edev);
}
Expand All @@ -1310,6 +1325,9 @@ static void sas_end_device_release(struct device *dev)
struct sas_rphy *rphy = dev_to_rphy(dev);
struct sas_end_device *edev = rphy_to_end_device(rphy);

if (rphy->q)
blk_cleanup_queue(rphy->q);

put_device(dev->parent);
kfree(edev);
}
Expand Down

0 comments on commit 5faac1b

Please sign in to comment.