From: Albert H. <he...@us...> - 2008-09-13 19:43:16
|
Update of /cvsroot/gc-linux/linux/drivers/block In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv13650/drivers/block Modified Files: Kconfig Makefile gcn-aram.c rvl-stsd.c Log Message: Merged 2.6.25. Queued small fixes for: - starlet-es - starlet-ipc - starlet-stm - rvl-stsd - rvl-sthcd - gcn-ai Index: gcn-aram.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/gcn-aram.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- gcn-aram.c 27 Mar 2008 22:35:28 -0000 1.17 +++ gcn-aram.c 13 Sep 2008 19:42:53 -0000 1.18 @@ -177,10 +177,7 @@ spin_unlock_irqrestore(&drvdata->io_lock, flags); if (req) { - if (!end_that_request_first(req, 1, req->current_nr_sectors)) { - add_disk_randomness(req->rq_disk); - end_that_request_last(req, 1); - } + __blk_end_request(req, 0, req->current_nr_sectors << 9); dma_unmap_single(drvdata->dev, drvdata->dma_addr, drvdata->dma_len, rq_dir_to_dma_dir(req)); Index: Makefile =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Makefile,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- Makefile 4 Apr 2008 19:30:40 -0000 1.19 +++ Makefile 13 Sep 2008 19:42:53 -0000 1.20 @@ -18,9 +18,8 @@ obj-$(CONFIG_GAMECUBE_SD) += gcn-sd.o obj-$(CONFIG_WII_MEM2) += rvl-mem2.o obj-$(CONFIG_WII_SD) += rvl-stsd.o -obj-$(CONFIG_BLK_DEV_RAM) += rd.o +obj-$(CONFIG_BLK_DEV_RAM) += brd.o obj-$(CONFIG_BLK_DEV_LOOP) += loop.o -obj-$(CONFIG_BLK_DEV_PS2) += ps2esdi.o obj-$(CONFIG_BLK_DEV_XD) += xd.o obj-$(CONFIG_BLK_CPQ_DA) += cpqarray.o obj-$(CONFIG_BLK_CPQ_CISS_DA) += cciss.o Index: rvl-stsd.c =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/rvl-stsd.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- rvl-stsd.c 2 Jul 2008 20:42:11 -0000 1.3 +++ rvl-stsd.c 13 Sep 2008 19:42:53 -0000 1.4 @@ -22,6 +22,7 @@ #define DEBUG #define DBG(fmt, arg...) pr_debug(fmt, ##arg) +//#define DBG(fmt, arg...) drv_printk(KERN_ERR, fmt, ##arg) #include <linux/blkdev.h> #include <linux/delay.h> @@ -181,7 +182,7 @@ struct stsd_transfer *xfer; struct task_struct *io_thread; -// struct mutex io_mutex; + struct mutex io_mutex; int fd; struct device *dev; @@ -798,12 +799,16 @@ int error; /* we do 8, 16 and 32 bits reads */ - if (size > stsd_small_buf_size) - return -EINVAL; + if (size > stsd_small_buf_size) { + error = -EINVAL; + goto done; + } local_buf = stsd_small_buf_get(); - if (!local_buf) - return -ENOMEM; + if (!local_buf) { + error = -ENOMEM; + goto done; + } error = starlet_ioctl(host->fd, request, NULL, 0, local_buf, size); @@ -812,6 +817,9 @@ stsd_small_buf_put(local_buf); +done: + if (error) + DBG("%s: error=%d (%08x)\n", __func__, error, error); return error; } @@ -822,12 +830,16 @@ int error; /* we do 8, 16 and 32 bits writes */ - if (size > stsd_small_buf_size) - return -EINVAL; + if (size > stsd_small_buf_size) { + error = -EINVAL; + goto done; + } local_buf = stsd_small_buf_get(); - if (!local_buf) - return -ENOMEM; + if (!local_buf) { + error = -ENOMEM; + goto done; + } memcpy(local_buf, buf, size); error = starlet_ioctl(host->fd, request, @@ -835,6 +847,9 @@ stsd_small_buf_put(local_buf); +done: + if (error) + DBG("%s: error=%d (%08x)\n", __func__, error, error); return error; } @@ -844,7 +859,6 @@ * */ -#if 0 static int stsd_get_status(struct stsd_host *host, u32 *status) { int error; @@ -856,7 +870,6 @@ return error; } -#endif #if 0 static int stsd_get_ocr(struct stsd_host *host) @@ -1046,8 +1059,26 @@ static int stsd_welcome_card(struct stsd_host *host) { - int error; + u32 status; int i; + int error; + + mutex_lock(&host->io_mutex); + + /* + * Re-open the sdio device if things look wrong. + */ + error = stsd_get_status(host, &status); + if (error == STARLET_EINVAL) { + starlet_close(host->fd); + host->fd = starlet_open(stsd_dev_sdio_slot0, 0); + if (host->fd < 0) { + drv_printk(KERN_ERR, "unable to re-open %s\n", + stsd_dev_sdio_slot0); + error = -ENODEV; + goto err_bad_card; + } + } /* reset the card, maybe several times before giving up */ for (i = 0; i < 3; i++) { @@ -1056,7 +1087,7 @@ break; } if (error) - goto out; + goto err_bad_card; #if 0 /* read Operating Conditions Register */ @@ -1085,6 +1116,8 @@ if (error) goto err_bad_card; + mutex_unlock(&host->io_mutex); + error = stsd_set_clock(host, host->card.csd.max_dtr); /* FIXME check if card supports 4 bit bus width */ @@ -1104,6 +1137,7 @@ goto out; err_bad_card: + mutex_unlock(&host->io_mutex); stsd_card_set_bad(host); out: return error; @@ -1235,7 +1269,7 @@ current->flags |= PF_NOFREEZE|PF_MEMALLOC; -// mutex_lock(&host->io_mutex); + mutex_lock(&host->io_mutex); for(;;) { req = NULL; set_current_state(TASK_INTERRUPTIBLE); @@ -1250,9 +1284,9 @@ set_current_state(TASK_RUNNING); break; } -// mutex_unlock(&host->io_mutex); + mutex_unlock(&host->io_mutex); schedule(); -// mutex_lock(&host->io_mutex); + mutex_lock(&host->io_mutex); continue; } set_current_state(TASK_INTERRUPTIBLE); @@ -1262,7 +1296,7 @@ end_queued_request(req, uptodate); spin_unlock_irqrestore(&host->queue_lock, flags); } -// mutex_unlock(&host->io_mutex); + mutex_unlock(&host->io_mutex); return 0; } @@ -1356,6 +1390,8 @@ /* REVISIT use the starlet provided iotcl to check the status */ + mutex_lock(&host->io_mutex); + /* check if the serial number of the card changed */ last_serial = host->card.cid.serial; error = stsd_deselect_card(host); @@ -1364,6 +1400,9 @@ if (!error) error = stsd_select_card(host); } + + mutex_unlock(&host->io_mutex); + if (!error && last_serial == host->card.cid.serial && last_serial) { clear_bit(__STSD_MEDIA_CHANGED, &host->flags); } else { @@ -1487,6 +1526,8 @@ struct request_queue *queue; int error; + mutex_init(&host->io_mutex); + /* queue */ error = -ENOMEM; spin_lock_init(&host->queue_lock); @@ -1538,7 +1579,6 @@ { int result = 0; -// mutex_init(&host->io_mutex); host->io_thread = kthread_run(stsd_io_thread, host, "ksdio"); if (IS_ERR(host->io_thread)) { drv_printk(KERN_ERR, "error creating io thread\n"); @@ -1567,7 +1607,8 @@ host->fd = starlet_open(stsd_dev_sdio_slot0, 0); if (host->fd < 0) { - drv_printk(KERN_ERR, "unable to open starlet sd device\n"); + drv_printk(KERN_ERR, "unable to open %s\n", + stsd_dev_sdio_slot0); return -ENODEV; } Index: Kconfig =================================================================== RCS file: /cvsroot/gc-linux/linux/drivers/block/Kconfig,v retrieving revision 1.32 retrieving revision 1.33 diff -u -d -r1.32 -r1.33 --- Kconfig 4 Apr 2008 19:30:40 -0000 1.32 +++ Kconfig 13 Sep 2008 19:42:53 -0000 1.33 @@ -44,16 +44,6 @@ If you have a SWIM-3 (Super Woz Integrated Machine 3; from Apple) floppy controller, say Y here. Most commonly found in PowerMacs. -config BLK_DEV_PS2 - tristate "PS/2 ESDI hard disk support" - depends on MCA && MCA_LEGACY && BROKEN - help - Say Y here if you have a PS/2 machine with a MCA bus and an ESDI - hard disk. - - To compile this driver as a module, choose M here: the - module will be called ps2esdi. - config AMIGA_Z2RAM tristate "Amiga Zorro II ramdisk support" depends on ZORRO @@ -194,6 +184,17 @@ "MicroSolutions backpack protocol", "DataStor Commuter protocol" etc.). +config GDROM + tristate "SEGA Dreamcast GD-ROM drive" + depends on SH_DREAMCAST + help + A standard SEGA Dreamcast comes with a modified CD ROM drive called a + "GD-ROM" by SEGA to signify it is capable of reading special disks + with up to 1 GB of data. This drive will also read standard CD ROM + disks. Select this option to access any disks in your GD ROM drive. + Most users will want to say "Y" here. + You can also build this as a module which will be called gdrom.ko + source "drivers/block/paride/Kconfig" config BLK_CPQ_DA @@ -400,7 +401,7 @@ If unsure, say N. config BLK_DEV_RAM - tristate "RAM disk support" + tristate "RAM block device support" ---help--- Saying Y here will allow you to use a portion of your RAM memory as a block device, so that you can make file systems on it, read and @@ -435,15 +436,15 @@ The default value is 4096 kilobytes. Only change this if you know what you are doing. -config BLK_DEV_RAM_BLOCKSIZE - int "Default RAM disk block size (bytes)" +config BLK_DEV_XIP + bool "Support XIP filesystems on RAM block device" depends on BLK_DEV_RAM - default "1024" + default n help - The default value is 1024 bytes. PAGE_SIZE is a much more - efficient choice however. The default is kept to ensure initrd - setups function - apparently needed by the rd_load_image routine - that supposes the filesystem in the image uses a 1024 blocksize. + Support XIP filesystems (such as ext2 with XIP support on) on + top of block ram device. This will slightly enlarge the kernel, and + will prevent RAM block device backing store memory from being + allocated from highmem (only a problem for highmem systems). config CDROM_PKTCDVD tristate "Packet writing on CD/DVD media" @@ -518,6 +519,7 @@ tristate "Virtio block driver (EXPERIMENTAL)" depends on EXPERIMENTAL && VIRTIO ---help--- - This is the virtual block driver for lguest. Say Y or M. + This is the virtual block driver for virtio. It can be used with + lguest or QEMU based VMMs (like KVM or Xen). Say Y or M. endif # BLK_DEV |