Commit 7b0cb1bd authored by Linus Torvalds's avatar Linus Torvalds

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

* 'for-2.6.38/drivers' of git://git.kernel.dk/linux-2.6-block:
  cciss: reinstate proper FIFO order of command queue list
  floppy: replace NO_GEOM macro with a function
parents 275220f0 e6e1ee93
...@@ -238,9 +238,9 @@ static void set_performant_mode(ctlr_info_t *h, CommandList_struct *c) ...@@ -238,9 +238,9 @@ static void set_performant_mode(ctlr_info_t *h, CommandList_struct *c)
/* /*
* Enqueuing and dequeuing functions for cmdlists. * Enqueuing and dequeuing functions for cmdlists.
*/ */
static inline void addQ(struct hlist_head *list, CommandList_struct *c) static inline void addQ(struct list_head *list, CommandList_struct *c)
{ {
hlist_add_head(&c->list, list); list_add_tail(&c->list, list);
} }
static inline void removeQ(CommandList_struct *c) static inline void removeQ(CommandList_struct *c)
...@@ -253,12 +253,12 @@ static inline void removeQ(CommandList_struct *c) ...@@ -253,12 +253,12 @@ static inline void removeQ(CommandList_struct *c)
* them off as 'stale' to prevent the driver from * them off as 'stale' to prevent the driver from
* falling over. * falling over.
*/ */
if (WARN_ON(hlist_unhashed(&c->list))) { if (WARN_ON(list_empty(&c->list))) {
c->cmd_type = CMD_MSG_STALE; c->cmd_type = CMD_MSG_STALE;
return; return;
} }
hlist_del_init(&c->list); list_del_init(&c->list);
} }
static void enqueue_cmd_and_start_io(ctlr_info_t *h, static void enqueue_cmd_and_start_io(ctlr_info_t *h,
...@@ -905,7 +905,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h) ...@@ -905,7 +905,7 @@ static CommandList_struct *cmd_alloc(ctlr_info_t *h)
c->cmdindex = i; c->cmdindex = i;
INIT_HLIST_NODE(&c->list); INIT_LIST_HEAD(&c->list);
c->busaddr = (__u32) cmd_dma_handle; c->busaddr = (__u32) cmd_dma_handle;
temp64.val = (__u64) err_dma_handle; temp64.val = (__u64) err_dma_handle;
c->ErrDesc.Addr.lower = temp64.val32.lower; c->ErrDesc.Addr.lower = temp64.val32.lower;
...@@ -944,7 +944,7 @@ static CommandList_struct *cmd_special_alloc(ctlr_info_t *h) ...@@ -944,7 +944,7 @@ static CommandList_struct *cmd_special_alloc(ctlr_info_t *h)
} }
memset(c->err_info, 0, sizeof(ErrorInfo_struct)); memset(c->err_info, 0, sizeof(ErrorInfo_struct));
INIT_HLIST_NODE(&c->list); INIT_LIST_HEAD(&c->list);
c->busaddr = (__u32) cmd_dma_handle; c->busaddr = (__u32) cmd_dma_handle;
temp64.val = (__u64) err_dma_handle; temp64.val = (__u64) err_dma_handle;
c->ErrDesc.Addr.lower = temp64.val32.lower; c->ErrDesc.Addr.lower = temp64.val32.lower;
...@@ -2888,8 +2888,8 @@ static void start_io(ctlr_info_t *h) ...@@ -2888,8 +2888,8 @@ static void start_io(ctlr_info_t *h)
{ {
CommandList_struct *c; CommandList_struct *c;
while (!hlist_empty(&h->reqQ)) { while (!list_empty(&h->reqQ)) {
c = hlist_entry(h->reqQ.first, CommandList_struct, list); c = list_entry(h->reqQ.next, CommandList_struct, list);
/* can't do anything if fifo is full */ /* can't do anything if fifo is full */
if ((h->access.fifo_full(h))) { if ((h->access.fifo_full(h))) {
dev_warn(&h->pdev->dev, "fifo full\n"); dev_warn(&h->pdev->dev, "fifo full\n");
...@@ -3402,11 +3402,10 @@ static inline u32 process_nonindexed_cmd(ctlr_info_t *h, u32 raw_tag) ...@@ -3402,11 +3402,10 @@ static inline u32 process_nonindexed_cmd(ctlr_info_t *h, u32 raw_tag)
{ {
u32 tag; u32 tag;
CommandList_struct *c = NULL; CommandList_struct *c = NULL;
struct hlist_node *tmp;
__u32 busaddr_masked, tag_masked; __u32 busaddr_masked, tag_masked;
tag = cciss_tag_discard_error_bits(raw_tag); tag = cciss_tag_discard_error_bits(raw_tag);
hlist_for_each_entry(c, tmp, &h->cmpQ, list) { list_for_each_entry(c, &h->cmpQ, list) {
busaddr_masked = cciss_tag_discard_error_bits(c->busaddr); busaddr_masked = cciss_tag_discard_error_bits(c->busaddr);
tag_masked = cciss_tag_discard_error_bits(tag); tag_masked = cciss_tag_discard_error_bits(tag);
if (busaddr_masked == tag_masked) { if (busaddr_masked == tag_masked) {
...@@ -4572,8 +4571,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev, ...@@ -4572,8 +4571,8 @@ static int __devinit cciss_init_one(struct pci_dev *pdev,
h = hba[i]; h = hba[i];
h->pdev = pdev; h->pdev = pdev;
h->busy_initializing = 1; h->busy_initializing = 1;
INIT_HLIST_HEAD(&h->cmpQ); INIT_LIST_HEAD(&h->cmpQ);
INIT_HLIST_HEAD(&h->reqQ); INIT_LIST_HEAD(&h->reqQ);
mutex_init(&h->busy_shutting_down); mutex_init(&h->busy_shutting_down);
if (cciss_pci_init(h) != 0) if (cciss_pci_init(h) != 0)
......
...@@ -103,8 +103,8 @@ struct ctlr_info ...@@ -103,8 +103,8 @@ struct ctlr_info
struct access_method access; struct access_method access;
/* queue and queue Info */ /* queue and queue Info */
struct hlist_head reqQ; struct list_head reqQ;
struct hlist_head cmpQ; struct list_head cmpQ;
unsigned int Qdepth; unsigned int Qdepth;
unsigned int maxQsinceinit; unsigned int maxQsinceinit;
unsigned int maxSG; unsigned int maxSG;
......
...@@ -195,7 +195,7 @@ typedef struct _CommandList_struct { ...@@ -195,7 +195,7 @@ typedef struct _CommandList_struct {
int ctlr; int ctlr;
int cmd_type; int cmd_type;
long cmdindex; long cmdindex;
struct hlist_node list; struct list_head list;
struct request * rq; struct request * rq;
struct completion *waiting; struct completion *waiting;
int retry_count; int retry_count;
......
...@@ -597,6 +597,11 @@ static unsigned char fsector_t; /* sector in track */ ...@@ -597,6 +597,11 @@ static unsigned char fsector_t; /* sector in track */
static unsigned char in_sector_offset; /* offset within physical sector, static unsigned char in_sector_offset; /* offset within physical sector,
* expressed in units of 512 bytes */ * expressed in units of 512 bytes */
static inline bool drive_no_geom(int drive)
{
return !current_type[drive] && !ITYPE(UDRS->fd_device);
}
#ifndef fd_eject #ifndef fd_eject
static inline int fd_eject(int drive) static inline int fd_eject(int drive)
{ {
...@@ -3782,7 +3787,7 @@ static int check_floppy_change(struct gendisk *disk) ...@@ -3782,7 +3787,7 @@ static int check_floppy_change(struct gendisk *disk)
if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) ||
test_bit(FD_VERIFY_BIT, &UDRS->flags) || test_bit(FD_VERIFY_BIT, &UDRS->flags) ||
test_bit(drive, &fake_change) || test_bit(drive, &fake_change) ||
(!ITYPE(UDRS->fd_device) && !current_type[drive])) drive_no_geom(drive))
return 1; return 1;
return 0; return 0;
} }
...@@ -3848,13 +3853,13 @@ static int __floppy_read_block_0(struct block_device *bdev) ...@@ -3848,13 +3853,13 @@ static int __floppy_read_block_0(struct block_device *bdev)
static int floppy_revalidate(struct gendisk *disk) static int floppy_revalidate(struct gendisk *disk)
{ {
int drive = (long)disk->private_data; int drive = (long)disk->private_data;
#define NO_GEOM (!current_type[drive] && !ITYPE(UDRS->fd_device))
int cf; int cf;
int res = 0; int res = 0;
if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || if (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) ||
test_bit(FD_VERIFY_BIT, &UDRS->flags) || test_bit(FD_VERIFY_BIT, &UDRS->flags) ||
test_bit(drive, &fake_change) || NO_GEOM) { test_bit(drive, &fake_change) ||
drive_no_geom(drive)) {
if (WARN(atomic_read(&usage_count) == 0, if (WARN(atomic_read(&usage_count) == 0,
"VFS: revalidate called on non-open device.\n")) "VFS: revalidate called on non-open device.\n"))
return -EFAULT; return -EFAULT;
...@@ -3862,7 +3867,7 @@ static int floppy_revalidate(struct gendisk *disk) ...@@ -3862,7 +3867,7 @@ static int floppy_revalidate(struct gendisk *disk)
lock_fdc(drive, false); lock_fdc(drive, false);
cf = (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) || cf = (test_bit(FD_DISK_CHANGED_BIT, &UDRS->flags) ||
test_bit(FD_VERIFY_BIT, &UDRS->flags)); test_bit(FD_VERIFY_BIT, &UDRS->flags));
if (!(cf || test_bit(drive, &fake_change) || NO_GEOM)) { if (!(cf || test_bit(drive, &fake_change) || drive_no_geom(drive))) {
process_fd_request(); /*already done by another thread */ process_fd_request(); /*already done by another thread */
return 0; return 0;
} }
...@@ -3874,7 +3879,7 @@ static int floppy_revalidate(struct gendisk *disk) ...@@ -3874,7 +3879,7 @@ static int floppy_revalidate(struct gendisk *disk)
clear_bit(FD_DISK_CHANGED_BIT, &UDRS->flags); clear_bit(FD_DISK_CHANGED_BIT, &UDRS->flags);
if (cf) if (cf)
UDRS->generation++; UDRS->generation++;
if (NO_GEOM) { if (drive_no_geom(drive)) {
/* auto-sensing */ /* auto-sensing */
res = __floppy_read_block_0(opened_bdev[drive]); res = __floppy_read_block_0(opened_bdev[drive]);
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment