All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geoff Levand <geoffrey.levand@am.sony.com>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: Geert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: blk: queue cleanup at device shutdown
Date: Thu, 11 Sep 2008 13:17:29 -0700	[thread overview]
Message-ID: <48C97CD9.8000808@am.sony.com> (raw)

Hi Jens,

I'm wondering about what is needed in ps3disk_remove(), to clean
up the request_queue (priv->queue) the driver uses.
ps3disk_remove() is called from the main device_shutdown()
routine via the ps3_system_bus remove routine.

The current code follows, and as can be seen, there is no check
or handling of the queue before blk_cleanup_queue() is called.
Can it be assumed that the queue is empty at this point,
or is something else needed here?

-Geoff

static int ps3disk_remove(struct ps3_system_bus_device *_dev)
{
	struct ps3_storage_device *dev = to_ps3_storage_device(&_dev->core);
	struct ps3disk_private *priv = dev->sbd.core.driver_data;

	mutex_lock(&ps3disk_mask_mutex);
	__clear_bit(priv->gendisk->first_minor / PS3DISK_MINORS,
		    &ps3disk_mask);
	mutex_unlock(&ps3disk_mask_mutex);

	del_gendisk(priv->gendisk);
	blk_cleanup_queue(priv->queue);
	put_disk(priv->gendisk);
	dev_notice(&dev->sbd.core, "Synchronizing disk cache\n");
	ps3disk_sync_cache(dev);
	ps3stor_teardown(dev);
	kfree(dev->bounce_buf);
	dev->bounce_buf = NULL;
	kfree(priv);
	dev->sbd.core.driver_data = NULL;
	return 0;
}








             reply	other threads:[~2008-09-11 20:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-11 20:17 Geoff Levand [this message]
2008-09-18  4:31 ` blk: queue cleanup at device shutdown Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=48C97CD9.8000808@am.sony.com \
    --to=geoffrey.levand@am.sony.com \
    --cc=Geert.Uytterhoeven@sonycom.com \
    --cc=jens.axboe@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.