Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 208294
b: refs/heads/master
c: dd9c426
h: refs/heads/master
v: v3
  • Loading branch information
Stephen M. Cameron authored and Jens Axboe committed Aug 7, 2010
1 parent c50ee80 commit 852ff79
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 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: 6539fa9b2e2e7fc3b3fe819e54aa7be83f0370fa
refs/heads/master: dd9c426e92d0cbd710c8df5b84afe9a2eeda3918
15 changes: 9 additions & 6 deletions trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -4002,9 +4002,16 @@ static int __devinit cciss_lookup_board_id(struct pci_dev *pdev, u32 *board_id)
return -ENODEV;
}

static inline bool cciss_board_disabled(ctlr_info_t *h)
{
u16 command;

(void) pci_read_config_word(h->pdev, PCI_COMMAND, &command);
return ((command & PCI_COMMAND_MEMORY) == 0);
}

static int __devinit cciss_pci_init(ctlr_info_t *c)
{
ushort command;
__u32 scratchpad = 0;
__u64 cfg_offset;
__u32 cfg_base_addr;
Expand All @@ -4018,15 +4025,11 @@ static int __devinit cciss_pci_init(ctlr_info_t *c)
c->product_name = products[prod_index].product_name;
c->access = *(products[prod_index].access);

/* check to see if controller has been disabled */
/* BEFORE trying to enable it */
(void)pci_read_config_word(c->pdev, PCI_COMMAND, &command);
if (!(command & 0x02)) {
if (cciss_board_disabled(c)) {
printk(KERN_WARNING
"cciss: controller appears to be disabled\n");
return -ENODEV;
}

err = pci_enable_device(c->pdev);
if (err) {
printk(KERN_ERR "cciss: Unable to Enable PCI device\n");
Expand Down

0 comments on commit 852ff79

Please sign in to comment.