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

Commit c104f1fa authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge branch 'for-3.4/drivers' of git://git.kernel.dk/linux-block

Pull block driver bits from Jens Axboe:

 - A series of fixes for mtip32xx.  Most from Asai at Micron, but also
   one from Greg, getting rid of the dependency on PCIE_HOTPLUG.

 - A few bug fixes for xen-blkfront, and blkback.

 - A virtio-blk fix for Vivek, making resize actually work.

 - Two fixes from Stephen, making larger transfers possible on cciss.
   This is needed for tape drive support.

* 'for-3.4/drivers' of git://git.kernel.dk/linux-block:
  block: mtip32xx: remove HOTPLUG_PCI_PCIE dependancy
  mtip32xx: dump tagmap on failure
  mtip32xx: fix handling of commands in various scenarios
  mtip32xx: Shorten macro names
  mtip32xx: misc changes
  mtip32xx: Add new sysfs entry 'status'
  mtip32xx: make setting comp_time as common
  mtip32xx: Add new bitwise flag 'dd_flag'
  mtip32xx: fix error handling in mtip_init()
  virtio-blk: Call revalidate_disk() upon online disk resize
  xen/blkback: Make optional features be really optional.
  xen/blkback: Squash the discard support for 'file' and 'phy' type.
  mtip32xx: fix incorrect value set for drv_cleanup_done, and re-initialize and start port in mtip_restart_port()
  cciss: Fix scsi tape io with more than 255 scatter gather elements
  cciss: Initialize scsi host max_sectors for tape drive support
  xen-blkfront: make blkif_io_lock spinlock per-device
  xen/blkfront: don't put bdev right after getting it
  xen-blkfront: use bitmap_set() and bitmap_clear()
  xen/blkback: Enable blkback on HVM guests
  xen/blkback: use grant-table.c hypercall wrappers
parents d8dd0b6d 63634806
Loading
Loading
Loading
Loading
+18 −0
Original line number Diff line number Diff line
What:           /sys/block/rssd*/registers
Date:           March 2012
KernelVersion:  3.3
Contact:        Asai Thambi S P <asamymuthupa@micron.com>
Description:    This is a read-only file. Dumps below driver information and
                hardware registers.
                    - S ACTive
                    - Command Issue
                    - Allocated
                    - Completed
                    - PORT IRQ STAT
                    - HOST IRQ STAT

What:           /sys/block/rssd*/status
Date:           April 2012
KernelVersion:  3.4
Contact:        Asai Thambi S P <asamymuthupa@micron.com>
Description:   This is a read-only file. Indicates the status of the device.
+2 −1
Original line number Diff line number Diff line
@@ -866,6 +866,7 @@ cciss_scsi_detect(ctlr_info_t *h)
	sh->can_queue = cciss_tape_cmds;
	sh->sg_tablesize = h->maxsgentries;
	sh->max_cmd_len = MAX_COMMAND_SIZE;
	sh->max_sectors = h->cciss_max_sectors;

	((struct cciss_scsi_adapter_data_t *) 
		h->scsi_ctlr)->scsi_host = sh;
@@ -1410,7 +1411,7 @@ static void cciss_scatter_gather(ctlr_info_t *h, CommandList_struct *c,
	/* track how many SG entries we are using */
	if (request_nsgs > h->maxSG)
		h->maxSG = request_nsgs;
	c->Header.SGTotal = (__u8) request_nsgs + chained;
	c->Header.SGTotal = (u16) request_nsgs + chained;
	if (request_nsgs > h->max_cmd_sgentries)
		c->Header.SGList = h->max_cmd_sgentries;
	else
+1 −1
Original line number Diff line number Diff line
@@ -4,6 +4,6 @@

config BLK_DEV_PCIESSD_MTIP32XX
	tristate "Block Device Driver for Micron PCIe SSDs"
	depends on HOTPLUG_PCI_PCIE
	depends on PCI
	help
          This enables the block driver for Micron PCIe SSDs.
+664 −196

File changed.

Preview size limit exceeded, changes collapsed.

+45 −13
Original line number Diff line number Diff line
@@ -34,8 +34,8 @@
/* offset of Device Control register in PCIe extended capabilites space */
#define PCIE_CONFIG_EXT_DEVICE_CONTROL_OFFSET	0x48

/* # of times to retry timed out IOs */
#define MTIP_MAX_RETRIES	5
/* # of times to retry timed out/failed IOs */
#define MTIP_MAX_RETRIES	2

/* Various timeout values in ms */
#define MTIP_NCQ_COMMAND_TIMEOUT_MS       5000
@@ -114,12 +114,41 @@
#define __force_bit2int (unsigned int __force)

/* below are bit numbers in 'flags' defined in mtip_port */
#define MTIP_FLAG_IC_ACTIVE_BIT			0
#define MTIP_FLAG_EH_ACTIVE_BIT			1
#define MTIP_FLAG_SVC_THD_ACTIVE_BIT		2
#define MTIP_FLAG_ISSUE_CMDS_BIT		4
#define MTIP_FLAG_REBUILD_BIT			5
#define MTIP_FLAG_SVC_THD_SHOULD_STOP_BIT	8
#define MTIP_PF_IC_ACTIVE_BIT		0 /* pio/ioctl */
#define MTIP_PF_EH_ACTIVE_BIT		1 /* error handling */
#define MTIP_PF_SE_ACTIVE_BIT		2 /* secure erase */
#define MTIP_PF_DM_ACTIVE_BIT		3 /* download microcde */
#define MTIP_PF_PAUSE_IO	((1 << MTIP_PF_IC_ACTIVE_BIT) | \
				(1 << MTIP_PF_EH_ACTIVE_BIT) | \
				(1 << MTIP_PF_SE_ACTIVE_BIT) | \
				(1 << MTIP_PF_DM_ACTIVE_BIT))

#define MTIP_PF_SVC_THD_ACTIVE_BIT	4
#define MTIP_PF_ISSUE_CMDS_BIT		5
#define MTIP_PF_REBUILD_BIT		6
#define MTIP_PF_SVC_THD_STOP_BIT	8

/* below are bit numbers in 'dd_flag' defined in driver_data */
#define MTIP_DDF_REMOVE_PENDING_BIT	1
#define MTIP_DDF_OVER_TEMP_BIT		2
#define MTIP_DDF_WRITE_PROTECT_BIT	3
#define MTIP_DDF_STOP_IO	((1 << MTIP_DDF_REMOVE_PENDING_BIT) | \
				(1 << MTIP_DDF_OVER_TEMP_BIT) | \
				(1 << MTIP_DDF_WRITE_PROTECT_BIT))

#define MTIP_DDF_CLEANUP_BIT		5
#define MTIP_DDF_RESUME_BIT		6
#define MTIP_DDF_INIT_DONE_BIT		7
#define MTIP_DDF_REBUILD_FAILED_BIT	8

__packed struct smart_attr{
	u8 attr_id;
	u16 flags;
	u8 cur;
	u8 worst;
	u32 data;
	u8 res[3];
};

/* Register Frame Information Structure (FIS), host to device. */
struct host_to_dev_fis {
@@ -345,6 +374,12 @@ struct mtip_port {
	 * when the command slot and all associated data structures
	 * are no longer needed.
	 */
	u16 *log_buf;
	dma_addr_t log_buf_dma;

	u8 *smart_buf;
	dma_addr_t smart_buf_dma;

	unsigned long allocated[SLOTBITS_IN_LONGS];
	/*
	 * used to queue commands when an internal command is in progress
@@ -368,6 +403,7 @@ struct mtip_port {
	 * Timer used to complete commands that have been active for too long.
	 */
	struct timer_list cmd_timer;
	unsigned long ic_pause_timer;
	/*
	 * Semaphore used to block threads if there are no
	 * command slots available.
@@ -404,13 +440,9 @@ struct driver_data {

	unsigned slot_groups; /* number of slot groups the product supports */

	atomic_t drv_cleanup_done; /* Atomic variable for SRSI */

	unsigned long index; /* Index to determine the disk name */

	unsigned int ftlrebuildflag; /* FTL rebuild flag */

	atomic_t resumeflag; /* Atomic variable to track suspend/resume */
	unsigned long dd_flag; /* NOTE: use atomic bit operations on this */

	struct task_struct *mtip_svc_handler; /* task_struct of svc thd */
};
Loading