Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 182935
b: refs/heads/master
c: 1b7d0d2
h: refs/heads/master
i:
  182933: bdd4e35
  182931: b10e504
  182927: 6fdf699
v: v3
  • Loading branch information
Stephen M. Cameron authored and Jens Axboe committed Feb 28, 2010
1 parent ea886f9 commit ce2a9ab
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 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: 58daa9ce96b847ed130453f5fdd63c579fb1f84f
refs/heads/master: 1b7d0d28ad82cbd5650c26ec8e370176b112e407
2 changes: 1 addition & 1 deletion trunk/drivers/block/cciss.c
Original file line number Diff line number Diff line change
Expand Up @@ -4496,7 +4496,7 @@ static int __init cciss_init(void)
* boundary. Given that we use pci_alloc_consistent() to allocate an
* array of them, the size must be a multiple of 8 bytes.
*/
BUILD_BUG_ON(sizeof(CommandList_struct) % 8);
BUILD_BUG_ON(sizeof(CommandList_struct) % COMMANDLIST_ALIGNMENT);

printk(KERN_INFO DRIVER_NAME "\n");

Expand Down
9 changes: 6 additions & 3 deletions trunk/drivers/block/cciss_cmd.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,13 @@ typedef struct _SGDescriptor_struct {
#define CMD_MSG_TIMEOUT 0x05
#define CMD_MSG_STALE 0xff

/* This structure needs to be divisible by 8 for new
* indexing method. PAD_32 and PAD_64 can be adjusted
* independently as needed for 32-bit and 64-bits systems.
/* This structure needs to be divisible by COMMANDLIST_ALIGNMENT
* because low bits of the address are used to to indicate that
* whether the tag contains an index or an address. PAD_32 and
* PAD_64 can be adjusted independently as needed for 32-bit
* and 64-bits systems.
*/
#define COMMANDLIST_ALIGNMENT (8)
#define IS_64_BIT ((sizeof(long) - 4)/4)
#define IS_32_BIT (!IS_64_BIT)
#define PAD_32 (0)
Expand Down
12 changes: 8 additions & 4 deletions trunk/drivers/block/cciss_scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,15 @@ static struct scsi_host_template cciss_driver_template = {
};

#pragma pack(1)

#define SCSI_PAD_32 4
#define SCSI_PAD_64 4

struct cciss_scsi_cmd_stack_elem_t {
CommandList_struct cmd;
ErrorInfo_struct Err;
__u32 busaddr;
__u32 pad;
u8 pad[IS_32_BIT * SCSI_PAD_32 + IS_64_BIT * SCSI_PAD_64];
};

#pragma pack()
Expand Down Expand Up @@ -202,9 +206,9 @@ scsi_cmd_stack_setup(int ctlr, struct cciss_scsi_adapter_data_t *sa)
stk = &sa->cmd_stack;
size = sizeof(struct cciss_scsi_cmd_stack_elem_t) * CMD_STACK_SIZE;

// pci_alloc_consistent guarantees 32-bit DMA address will
// be used

/* Check alignment, see cciss_cmd.h near CommandList_struct def. */
BUILD_BUG_ON((sizeof(*stk->pool) % COMMANDLIST_ALIGNMENT) != 0);
/* pci_alloc_consistent guarantees 32-bit DMA address will be used */
stk->pool = (struct cciss_scsi_cmd_stack_elem_t *)
pci_alloc_consistent(hba[ctlr]->pdev, size, &stk->cmd_pool_handle);

Expand Down

0 comments on commit ce2a9ab

Please sign in to comment.