diff options
Diffstat (limited to 'drivers/block')
-rw-r--r-- | drivers/block/cciss.c | 96 | ||||
-rw-r--r-- | drivers/block/floppy.c | 2 | ||||
-rw-r--r-- | drivers/block/ub.c | 18 |
3 files changed, 60 insertions, 56 deletions
diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c index 1b0fd31c57c3..1319d8f20640 100644 --- a/drivers/block/cciss.c +++ b/drivers/block/cciss.c | |||
@@ -1180,6 +1180,53 @@ static int revalidate_allvol(ctlr_info_t *host) | |||
1180 | return 0; | 1180 | return 0; |
1181 | } | 1181 | } |
1182 | 1182 | ||
1183 | static inline void complete_buffers(struct bio *bio, int status) | ||
1184 | { | ||
1185 | while (bio) { | ||
1186 | struct bio *xbh = bio->bi_next; | ||
1187 | int nr_sectors = bio_sectors(bio); | ||
1188 | |||
1189 | bio->bi_next = NULL; | ||
1190 | blk_finished_io(len); | ||
1191 | bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO); | ||
1192 | bio = xbh; | ||
1193 | } | ||
1194 | |||
1195 | } | ||
1196 | |||
1197 | static void cciss_softirq_done(struct request *rq) | ||
1198 | { | ||
1199 | CommandList_struct *cmd = rq->completion_data; | ||
1200 | ctlr_info_t *h = hba[cmd->ctlr]; | ||
1201 | unsigned long flags; | ||
1202 | u64bit temp64; | ||
1203 | int i, ddir; | ||
1204 | |||
1205 | if (cmd->Request.Type.Direction == XFER_READ) | ||
1206 | ddir = PCI_DMA_FROMDEVICE; | ||
1207 | else | ||
1208 | ddir = PCI_DMA_TODEVICE; | ||
1209 | |||
1210 | /* command did not need to be retried */ | ||
1211 | /* unmap the DMA mapping for all the scatter gather elements */ | ||
1212 | for(i=0; i<cmd->Header.SGList; i++) { | ||
1213 | temp64.val32.lower = cmd->SG[i].Addr.lower; | ||
1214 | temp64.val32.upper = cmd->SG[i].Addr.upper; | ||
1215 | pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir); | ||
1216 | } | ||
1217 | |||
1218 | complete_buffers(rq->bio, rq->errors); | ||
1219 | |||
1220 | #ifdef CCISS_DEBUG | ||
1221 | printk("Done with %p\n", rq); | ||
1222 | #endif /* CCISS_DEBUG */ | ||
1223 | |||
1224 | spin_lock_irqsave(&h->lock, flags); | ||
1225 | end_that_request_last(rq, rq->errors); | ||
1226 | cmd_free(h, cmd,1); | ||
1227 | spin_unlock_irqrestore(&h->lock, flags); | ||
1228 | } | ||
1229 | |||
1183 | /* This function will check the usage_count of the drive to be updated/added. | 1230 | /* This function will check the usage_count of the drive to be updated/added. |
1184 | * If the usage_count is zero then the drive information will be updated and | 1231 | * If the usage_count is zero then the drive information will be updated and |
1185 | * the disk will be re-registered with the kernel. If not then it will be | 1232 | * the disk will be re-registered with the kernel. If not then it will be |
@@ -1248,6 +1295,8 @@ static void cciss_update_drive_info(int ctlr, int drv_index) | |||
1248 | 1295 | ||
1249 | blk_queue_max_sectors(disk->queue, 512); | 1296 | blk_queue_max_sectors(disk->queue, 512); |
1250 | 1297 | ||
1298 | blk_queue_softirq_done(disk->queue, cciss_softirq_done); | ||
1299 | |||
1251 | disk->queue->queuedata = hba[ctlr]; | 1300 | disk->queue->queuedata = hba[ctlr]; |
1252 | 1301 | ||
1253 | blk_queue_hardsect_size(disk->queue, | 1302 | blk_queue_hardsect_size(disk->queue, |
@@ -2147,20 +2196,6 @@ static void start_io( ctlr_info_t *h) | |||
2147 | addQ (&(h->cmpQ), c); | 2196 | addQ (&(h->cmpQ), c); |
2148 | } | 2197 | } |
2149 | } | 2198 | } |
2150 | |||
2151 | static inline void complete_buffers(struct bio *bio, int status) | ||
2152 | { | ||
2153 | while (bio) { | ||
2154 | struct bio *xbh = bio->bi_next; | ||
2155 | int nr_sectors = bio_sectors(bio); | ||
2156 | |||
2157 | bio->bi_next = NULL; | ||
2158 | blk_finished_io(len); | ||
2159 | bio_endio(bio, nr_sectors << 9, status ? 0 : -EIO); | ||
2160 | bio = xbh; | ||
2161 | } | ||
2162 | |||
2163 | } | ||
2164 | /* Assumes that CCISS_LOCK(h->ctlr) is held. */ | 2199 | /* Assumes that CCISS_LOCK(h->ctlr) is held. */ |
2165 | /* Zeros out the error record and then resends the command back */ | 2200 | /* Zeros out the error record and then resends the command back */ |
2166 | /* to the controller */ | 2201 | /* to the controller */ |
@@ -2178,39 +2213,6 @@ static inline void resend_cciss_cmd( ctlr_info_t *h, CommandList_struct *c) | |||
2178 | start_io(h); | 2213 | start_io(h); |
2179 | } | 2214 | } |
2180 | 2215 | ||
2181 | static void cciss_softirq_done(struct request *rq) | ||
2182 | { | ||
2183 | CommandList_struct *cmd = rq->completion_data; | ||
2184 | ctlr_info_t *h = hba[cmd->ctlr]; | ||
2185 | unsigned long flags; | ||
2186 | u64bit temp64; | ||
2187 | int i, ddir; | ||
2188 | |||
2189 | if (cmd->Request.Type.Direction == XFER_READ) | ||
2190 | ddir = PCI_DMA_FROMDEVICE; | ||
2191 | else | ||
2192 | ddir = PCI_DMA_TODEVICE; | ||
2193 | |||
2194 | /* command did not need to be retried */ | ||
2195 | /* unmap the DMA mapping for all the scatter gather elements */ | ||
2196 | for(i=0; i<cmd->Header.SGList; i++) { | ||
2197 | temp64.val32.lower = cmd->SG[i].Addr.lower; | ||
2198 | temp64.val32.upper = cmd->SG[i].Addr.upper; | ||
2199 | pci_unmap_page(h->pdev, temp64.val, cmd->SG[i].Len, ddir); | ||
2200 | } | ||
2201 | |||
2202 | complete_buffers(rq->bio, rq->errors); | ||
2203 | |||
2204 | #ifdef CCISS_DEBUG | ||
2205 | printk("Done with %p\n", rq); | ||
2206 | #endif /* CCISS_DEBUG */ | ||
2207 | |||
2208 | spin_lock_irqsave(&h->lock, flags); | ||
2209 | end_that_request_last(rq, rq->errors); | ||
2210 | cmd_free(h, cmd,1); | ||
2211 | spin_unlock_irqrestore(&h->lock, flags); | ||
2212 | } | ||
2213 | |||
2214 | /* checks the status of the job and calls complete buffers to mark all | 2216 | /* checks the status of the job and calls complete buffers to mark all |
2215 | * buffers for the completed job. Note that this function does not need | 2217 | * buffers for the completed job. Note that this function does not need |
2216 | * to hold the hba/queue lock. | 2218 | * to hold the hba/queue lock. |
diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index bedb689b051f..dff1e67b1dd4 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c | |||
@@ -4301,7 +4301,7 @@ static int __init floppy_init(void) | |||
4301 | } | 4301 | } |
4302 | 4302 | ||
4303 | use_virtual_dma = can_use_virtual_dma & 1; | 4303 | use_virtual_dma = can_use_virtual_dma & 1; |
4304 | #if defined(CONFIG_PPC64) | 4304 | #if defined(CONFIG_PPC_MERGE) |
4305 | if (check_legacy_ioport(FDC1)) { | 4305 | if (check_legacy_ioport(FDC1)) { |
4306 | del_timer(&fd_timeout); | 4306 | del_timer(&fd_timeout); |
4307 | err = -ENODEV; | 4307 | err = -ENODEV; |
diff --git a/drivers/block/ub.c b/drivers/block/ub.c index f73446f580df..c688c25992e4 100644 --- a/drivers/block/ub.c +++ b/drivers/block/ub.c | |||
@@ -536,6 +536,9 @@ static void ub_cleanup(struct ub_dev *sc) | |||
536 | kfree(lun); | 536 | kfree(lun); |
537 | } | 537 | } |
538 | 538 | ||
539 | usb_set_intfdata(sc->intf, NULL); | ||
540 | usb_put_intf(sc->intf); | ||
541 | usb_put_dev(sc->dev); | ||
539 | kfree(sc); | 542 | kfree(sc); |
540 | } | 543 | } |
541 | 544 | ||
@@ -2221,7 +2224,12 @@ static int ub_probe(struct usb_interface *intf, | |||
2221 | // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; | 2224 | // sc->ifnum = intf->cur_altsetting->desc.bInterfaceNumber; |
2222 | usb_set_intfdata(intf, sc); | 2225 | usb_set_intfdata(intf, sc); |
2223 | usb_get_dev(sc->dev); | 2226 | usb_get_dev(sc->dev); |
2224 | // usb_get_intf(sc->intf); /* Do we need this? */ | 2227 | /* |
2228 | * Since we give the interface struct to the block level through | ||
2229 | * disk->driverfs_dev, we have to pin it. Otherwise, block_uevent | ||
2230 | * oopses on close after a disconnect (kernels 2.6.16 and up). | ||
2231 | */ | ||
2232 | usb_get_intf(sc->intf); | ||
2225 | 2233 | ||
2226 | snprintf(sc->name, 12, DRV_NAME "(%d.%d)", | 2234 | snprintf(sc->name, 12, DRV_NAME "(%d.%d)", |
2227 | sc->dev->bus->busnum, sc->dev->devnum); | 2235 | sc->dev->bus->busnum, sc->dev->devnum); |
@@ -2286,7 +2294,7 @@ static int ub_probe(struct usb_interface *intf, | |||
2286 | 2294 | ||
2287 | err_dev_desc: | 2295 | err_dev_desc: |
2288 | usb_set_intfdata(intf, NULL); | 2296 | usb_set_intfdata(intf, NULL); |
2289 | // usb_put_intf(sc->intf); | 2297 | usb_put_intf(sc->intf); |
2290 | usb_put_dev(sc->dev); | 2298 | usb_put_dev(sc->dev); |
2291 | kfree(sc); | 2299 | kfree(sc); |
2292 | err_core: | 2300 | err_core: |
@@ -2461,12 +2469,6 @@ static void ub_disconnect(struct usb_interface *intf) | |||
2461 | * and no URBs left in transit. | 2469 | * and no URBs left in transit. |
2462 | */ | 2470 | */ |
2463 | 2471 | ||
2464 | usb_set_intfdata(intf, NULL); | ||
2465 | // usb_put_intf(sc->intf); | ||
2466 | sc->intf = NULL; | ||
2467 | usb_put_dev(sc->dev); | ||
2468 | sc->dev = NULL; | ||
2469 | |||
2470 | ub_put(sc); | 2472 | ub_put(sc); |
2471 | } | 2473 | } |
2472 | 2474 | ||