The patch titled areca-raid-linux-scsi-driver update7 has been added to the -mm tree. Its filename is areca-raid-linux-scsi-driver-update7.patch See http://www.zip.com.au/~akpm/linux/patches/stuff/added-to-mm.txt to find out what to do about this ------------------------------------------------------ Subject: areca-raid-linux-scsi-driver update7 From: Erich Chen <erich@xxxxxxxxxxxx> 1- fix sysfs has more than one value per file 2- PAE issues (cast of dma_addr_t to unsigned long) 3- unblock SYNCHRONIZE_CACHE Areca had tested its arcmsr linux raid driver on ppc machines G5 and it worked fine. Signed-off-by: Erich Chen <erich@xxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxx> --- drivers/scsi/arcmsr/arcmsr_attr.c | 100 ++++++++++++++++++++++++---- drivers/scsi/arcmsr/arcmsr_hba.c | 19 ++--- 2 files changed, 97 insertions(+), 22 deletions(-) diff -puN drivers/scsi/arcmsr/arcmsr_attr.c~areca-raid-linux-scsi-driver-update7 drivers/scsi/arcmsr/arcmsr_attr.c --- a/drivers/scsi/arcmsr/arcmsr_attr.c~areca-raid-linux-scsi-driver-update7 +++ a/drivers/scsi/arcmsr/arcmsr_attr.c @@ -58,7 +58,6 @@ #include "arcmsr.h" struct class_device_attribute *arcmsr_host_attrs[]; -void arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *acb); static ssize_t arcmsr_sysfs_iop_message_read(struct kobject *kobj, char *buf, loff_t off, @@ -152,33 +151,112 @@ arcmsr_sysfs_iop_message_write(struct ko } } -static struct bin_attribute arcmsr_sysfs_message_transfer_attr = { +static ssize_t +arcmsr_sysfs_iop_message_clear(struct kobject *kobj, char *buf, loff_t off, + size_t count) +{ + struct class_device *cdev = container_of(kobj,struct class_device,kobj); + struct Scsi_Host *host = class_to_shost(cdev); + struct AdapterControlBlock *acb = (struct AdapterControlBlock *) host->hostdata; + struct MessageUnit __iomem *reg = acb->pmu; + uint8_t *pQbuffer; + + if (!capable(CAP_SYS_ADMIN) || (count && off) == 0) + return 0; + + if (acb->acb_flags & ACB_F_IOPDATA_OVERFLOW) { + acb->acb_flags &= ~ACB_F_IOPDATA_OVERFLOW; + writel(ARCMSR_INBOUND_DRIVER_DATA_READ_OK + , ®->inbound_doorbell); + } + acb->acb_flags |= + (ACB_F_MESSAGE_WQBUFFER_CLEARED + | ACB_F_MESSAGE_RQBUFFER_CLEARED + | ACB_F_MESSAGE_WQBUFFER_READED); + acb->rqbuf_firstindex = 0; + acb->rqbuf_lastindex = 0; + acb->wqbuf_firstindex = 0; + acb->wqbuf_lastindex = 0; + pQbuffer = acb->rqbuffer; + memset(pQbuffer, 0, sizeof (struct QBUFFER)); + pQbuffer = acb->wqbuffer; + memset(pQbuffer, 0, sizeof (struct QBUFFER)); + return 1; +} + +static struct bin_attribute arcmsr_sysfs_message_read_attr = { .attr = { - .name = "iop_message_transfer", - .mode = S_IRUSR | S_IWUSR, + .name = "mu_read", + .mode = S_IRUSR , .owner = THIS_MODULE, }, - .size = 0, + .size = 1032, .read = arcmsr_sysfs_iop_message_read, +}; + +static struct bin_attribute arcmsr_sysfs_message_write_attr = { + .attr = { + .name = "mu_write", + .mode = S_IWUSR, + .owner = THIS_MODULE, + }, + .size = 1032, .write = arcmsr_sysfs_iop_message_write, }; -void +static struct bin_attribute arcmsr_sysfs_message_clear_attr = { + .attr = { + .name = "mu_clear", + .mode = S_IWUSR, + .owner = THIS_MODULE, + }, + .size = 1, + .write = arcmsr_sysfs_iop_message_clear, +}; + +int arcmsr_alloc_sysfs_attr(struct AdapterControlBlock *acb) { struct Scsi_Host *host = acb->host; + int error; - sysfs_create_bin_file(&host->shost_classdev.kobj, - &arcmsr_sysfs_message_transfer_attr); + error = sysfs_create_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_read_attr); + if (error) + goto error_bin_file_message_read; + + error = sysfs_create_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_write_attr); + if (error) + goto error_bin_file_message_write; + + error = sysfs_create_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_clear_attr); + if (error) + goto error_bin_file_message_clear; + + return 0; +error_bin_file_message_clear: + sysfs_remove_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_write_attr); +error_bin_file_message_write: + sysfs_remove_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_read_attr); +error_bin_file_message_read: + return error; } -#if 0 void arcmsr_free_sysfs_attr(struct AdapterControlBlock *acb) { struct Scsi_Host *host = acb->host; - sysfs_remove_bin_file(&host->shost_gendev.kobj, &arcmsr_sysfs_message_transfer_attr); + sysfs_remove_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_clear_attr); + sysfs_remove_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_write_attr); + sysfs_remove_bin_file(&host->shost_classdev.kobj, + &arcmsr_sysfs_message_read_attr); } -#endif /* 0 */ + static ssize_t arcmsr_attr_host_driver_version(struct class_device *cdev, char *buf) { diff -puN drivers/scsi/arcmsr/arcmsr_hba.c~areca-raid-linux-scsi-driver-update7 drivers/scsi/arcmsr/arcmsr_hba.c --- a/drivers/scsi/arcmsr/arcmsr_hba.c~areca-raid-linux-scsi-driver-update7 +++ a/drivers/scsi/arcmsr/arcmsr_hba.c @@ -334,10 +334,13 @@ static int arcmsr_probe(struct pci_dev * if (error) goto out_free_irq; - arcmsr_alloc_sysfs_attr(acb); + error = arcmsr_alloc_sysfs_attr(acb); + if (error) + goto out_free_sysfs; + scsi_scan_host(host); return 0; - + out_free_sysfs: out_free_irq: free_irq(pdev->irq, acb); out_free_ccb_pool: @@ -378,7 +381,7 @@ static void arcmsr_pci_unmap_dma(struct } else if (pcmd->request_bufflen != 0) pci_unmap_single(acb->pdev, - (dma_addr_t)(unsigned long)pcmd->SCp.ptr, + pcmd->SCp.dma_handle, pcmd->request_bufflen, pcmd->sc_data_direction); } @@ -404,6 +407,7 @@ static void arcmsr_remove(struct pci_dev struct MessageUnit __iomem *reg = acb->pmu; int poll_count = 0; + arcmsr_free_sysfs_attr(acb); scsi_remove_host(host); arcmsr_stop_adapter_bgrb(acb); arcmsr_flush_adapter_cache(acb); @@ -599,7 +603,7 @@ static void arcmsr_build_ccb(struct Adap dma_addr_t dma_addr; dma_addr = pci_map_single(acb->pdev, pcmd->request_buffer, pcmd->request_bufflen, pcmd->sc_data_direction); - pcmd->SCp.ptr = (char *)(unsigned long) dma_addr; + pcmd->SCp.dma_handle = dma_addr; address_lo = cpu_to_le32(dma_addr_lo32(dma_addr)); address_hi = cpu_to_le32(dma_addr_hi32(dma_addr)); if (address_hi == 0) { @@ -1140,17 +1144,10 @@ static int arcmsr_queue_command(struct s struct CommandControlBlock *ccb; int target = cmd->device->id; int lun = cmd->device->lun; - uint8_t scsicmd = cmd->cmnd[0]; cmd->scsi_done = done; cmd->host_scribble = NULL; cmd->result = 0; - if (scsicmd == SYNCHRONIZE_CACHE) { - if (acb->devstate[target][lun] == ARECA_RAID_GONE) - cmd->result = (DID_NO_CONNECT << 16); - cmd->scsi_done(cmd); - return 0; - } if (acb->acb_flags & ACB_F_BUS_RESET) { printk(KERN_NOTICE "arcmsr%d: bus reset" " and return busy \n" _ Patches currently in -mm which might be from erich@xxxxxxxxxxxx are areca-raid-linux-scsi-driver.patch drivers-scsi-arcmsr-cleanups.patch areca-raid-linux-scsi-driver-update7.patch - To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html