change log for rtems (2010-05-17)
rtems-vc at rtems.org
rtems-vc at rtems.org
Tue May 18 03:10:48 UTC 2010
*ccj*:
010-05-18 Chris Johns <chrisj at rtems.org>
* libchip/i2c/spi-sd-card.c, libchip/ide/ata.c: PR
1448/filesystem.
M 1.513 c/src/ChangeLog
M 1.16 c/src/libchip/i2c/spi-sd-card.c
M 1.38 c/src/libchip/ide/ata.c
diff -u rtems/c/src/ChangeLog:1.512 rtems/c/src/ChangeLog:1.513
--- rtems/c/src/ChangeLog:1.512 Tue May 11 10:05:17 2010
+++ rtems/c/src/ChangeLog Mon May 17 21:12:39 2010
@@ -1,3 +1,8 @@
+2010-05-18 Chris Johns <chrisj at rtems.org>
+
+ * libchip/i2c/spi-sd-card.c, libchip/ide/ata.c: PR
+ 1448/filesystem.
+
2010-05-11 Ralf Corsépius <ralf.corsepius at rtems.org>
* aclocal/bsp-alias.m4: Change quoting to work-round
diff -u rtems/c/src/libchip/i2c/spi-sd-card.c:1.15 rtems/c/src/libchip/i2c/spi-sd-card.c:1.16
--- rtems/c/src/libchip/i2c/spi-sd-card.c:1.15 Tue Jan 19 03:10:03 2010
+++ rtems/c/src/libchip/i2c/spi-sd-card.c Mon May 17 21:12:38 2010
@@ -1134,7 +1134,7 @@
errno = EINVAL;
return -1;
}
- } else if (req == RTEMS_BLKDEV_CAPABILITIES) {
+ } else if (req == RTEMS_BLKIO_CAPABILITIES) {
*(uint32_t *) arg = RTEMS_BLKDEV_CAP_MULTISECTOR_CONT;
return 0;
} else {
diff -u rtems/c/src/libchip/ide/ata.c:1.37 rtems/c/src/libchip/ide/ata.c:1.38
--- rtems/c/src/libchip/ide/ata.c:1.37 Thu Apr 8 11:36:13 2010
+++ rtems/c/src/libchip/ide/ata.c Mon May 17 21:12:39 2010
@@ -1019,7 +1019,7 @@
status = ata_non_data_request(device, cmd, argp);
break;
- case RTEMS_BLKDEV_CAPABILITIES:
+ case RTEMS_BLKIO_CAPABILITIES:
*((uint32_t*) argp) = RTEMS_BLKDEV_CAP_MULTISECTOR_CONT;
status = RTEMS_SUCCESSFUL;
break;
*ccj*:
2010-05-18 Chris Johns <chrisj at rtems.org>
* libblock/src/diskdevs.c, libblock/include/rtems/blkdev.h,
libblock/src/bdbuf.c: PR 1448/filesystem.
* libblock/include/rtems/blkdev.h, libblock/src/bdbuf.c: PR
1514/filesystem.
M 1.2295 cpukit/ChangeLog
M 1.21 cpukit/libblock/include/rtems/blkdev.h
M 1.52 cpukit/libblock/src/bdbuf.c
M 1.26 cpukit/libblock/src/diskdevs.c
diff -u rtems/cpukit/ChangeLog:1.2294 rtems/cpukit/ChangeLog:1.2295
--- rtems/cpukit/ChangeLog:1.2294 Mon May 17 03:08:30 2010
+++ rtems/cpukit/ChangeLog Mon May 17 21:14:05 2010
@@ -1,3 +1,11 @@
+2010-05-18 Chris Johns <chrisj at rtems.org>
+
+ * libblock/src/diskdevs.c, libblock/include/rtems/blkdev.h,
+ libblock/src/bdbuf.c: PR 1448/filesystem.
+
+ * libblock/include/rtems/blkdev.h, libblock/src/bdbuf.c: PR
+ 1514/filesystem.
+
2010-05-17 Oleg Kravtsov <Oleg.Kravtsov at oktetlabs.ru>
PR 1449/cpukit
diff -u rtems/cpukit/libblock/include/rtems/blkdev.h:1.20 rtems/cpukit/libblock/include/rtems/blkdev.h:1.21
--- rtems/cpukit/libblock/include/rtems/blkdev.h:1.20 Tue Jan 19 03:10:03 2010
+++ rtems/cpukit/libblock/include/rtems/blkdev.h Mon May 17 21:14:05 2010
@@ -42,23 +42,18 @@
/**
* Block device request type.
+ *
+ * @warning The sync request is an IO one and only used from the cache. Use the
+ * Block IO when operating at the device level. We need a sync request
+ * to avoid requests looping for ever.
*/
typedef enum rtems_blkdev_request_op {
RTEMS_BLKDEV_REQ_READ, /**< Read the requested blocks of data. */
RTEMS_BLKDEV_REQ_WRITE, /**< Write the requested blocks of data. */
- RTEMS_BLKDEV_CAPABILITIES /**< Return the driver capabilities set. */
+ RTEMS_BLKDEV_REQ_SYNC /**< Sync any data with the media. */
} rtems_blkdev_request_op;
/**
- * Only consecutive multi-sector buffer requests are supported.
- *
- * This option means the cache will only supply multiple buffers that are
- * inorder so the ATA multi-sector command for example can be used. This is a
- * hack to work around the current ATA driver.
- */
-#define RTEMS_BLKDEV_CAP_MULTISECTOR_CONT (1 << 0)
-
-/**
* @brief Block device request done callback function type.
*
* The first parameter @a arg must be the argument provided by the block device
@@ -147,7 +142,7 @@
/**
* The start block in a request.
*
- * Only valid if the driver has returned the @ref RTEMS_BLKDEV_CAPABILITIES of
+ * Only valid if the driver has returned the @ref RTEMS_BLKIO_CAPABILITIES of
* @ref RTEMS_BLKDEV_CAP_MULTISECTOR_CONT.
*/
#define RTEMS_BLKDEV_START_BLOCK(req) (req->bufs[0].block)
@@ -165,10 +160,26 @@
#define RTEMS_BLKIO_GETSIZE _IOR('B', 5, rtems_blkdev_bnum)
#define RTEMS_BLKIO_SYNCDEV _IO('B', 6)
#define RTEMS_BLKIO_DELETED _IO('B', 7)
+#define RTEMS_BLKIO_CAPABILITIES _IO('B', 8)
/** @} */
/**
+ * Only consecutive multi-sector buffer requests are supported.
+ *
+ * This option means the cache will only supply multiple buffers that are
+ * inorder so the ATA multi-sector command for example can be used. This is a
+ * hack to work around the current ATA driver.
+ */
+#define RTEMS_BLKDEV_CAP_MULTISECTOR_CONT (1 << 0)
+
+/**
+ * The driver will accept a sync call. A sync call is made to a driver
+ * after a bdbuf cache sync has finished.
+ */
+#define RTEMS_BLKDEV_CAP_SYNC (1 << 1)
+
+/**
* The device driver interface conventions suppose that a driver may contain an
* initialize, open, close, read, write and IO control entry points. These
* primitives (except initialize) can be implemented in a generic fashion based
diff -u rtems/cpukit/libblock/src/bdbuf.c:1.51 rtems/cpukit/libblock/src/bdbuf.c:1.52
--- rtems/cpukit/libblock/src/bdbuf.c:1.51 Thu Apr 29 06:34:59 2010
+++ rtems/cpukit/libblock/src/bdbuf.c Mon May 17 21:14:05 2010
@@ -60,6 +60,7 @@
{
rtems_chain_control bds; /**< The transfer list of BDs. */
dev_t dev; /**< The device the transfer is for. */
+ bool syncing; /**< The data is a sync'ing. */
rtems_blkdev_request* write_req; /**< The write request array. */
uint32_t bufs_per_bd; /**< Number of buffers per bd. */
} rtems_bdbuf_swapout_transfer;
@@ -74,7 +75,7 @@
* idle. */
rtems_id id; /**< The id of the task so we can wake
* it. */
- volatile bool enabled; /**< The worked is enabled. */
+ volatile bool enabled; /**< The worker is enabled. */
rtems_bdbuf_swapout_transfer transfer; /**< The transfer data for this
* thread. */
} rtems_bdbuf_swapout_worker;
@@ -1319,9 +1320,9 @@
if (bdbuf_cache.initialised)
{
rtems_bdbuf_restore_preemption (prev_mode);
-
return RTEMS_RESOURCE_IN_USE;
}
+
memset(&bdbuf_cache, 0, sizeof(bdbuf_cache));
bdbuf_cache.initialised = true;
rtems_bdbuf_restore_preemption (prev_mode);
@@ -2042,7 +2043,7 @@
#define bdbuf_alloc(size) __builtin_alloca (size)
req = bdbuf_alloc (sizeof (rtems_blkdev_request) +
- sizeof ( rtems_blkdev_sg_buffer) *
+ sizeof (rtems_blkdev_sg_buffer) *
(bdbuf_config.max_read_ahead_blocks + 1));
if (rtems_bdbuf_tracer)
@@ -2260,7 +2261,7 @@
/**
* Swapout transfer to the driver. The driver will break this I/O into groups
* of consecutive write requests is multiple consecutive buffers are required
- * by the driver.
+ * by the driver. The cache is not locked.
*
* @param transfer The transfer transaction.
*/
@@ -2373,7 +2374,20 @@
}
if (dd != &null_disk)
+ {
+ /*
+ * If sync'ing and the deivce is capability of handling a sync IO control
+ * call perform the call.
+ */
+ if (transfer->syncing &&
+ (dd->phys_dev->capabilities & RTEMS_BLKDEV_CAP_SYNC))
+ {
+ /* int result = */ dd->ioctl (dd->phys_dev, RTEMS_BLKDEV_REQ_SYNC, NULL);
+ /* How should the error be handled ? */
+ }
+
rtems_disk_release (dd);
+ }
}
}
@@ -2401,20 +2415,31 @@
if (!rtems_chain_is_empty (chain))
{
rtems_chain_node* node = rtems_chain_head (chain);
+ bool sync_all;
+
node = node->next;
+ /*
+ * A sync active with no valid dev means sync all.
+ */
+ if (sync_active && (*dev == BDBUF_INVALID_DEV))
+ sync_all = true;
+ else
+ sync_all = false;
+
while (!rtems_chain_is_tail (chain, node))
{
rtems_bdbuf_buffer* bd = (rtems_bdbuf_buffer*) node;
/*
* Check if the buffer's hold timer has reached 0. If a sync is active
- * or someone waits for a buffer force all the timers to 0.
+ * or someone waits for a buffer written force all the timers to 0.
*
* @note Lots of sync requests will skew this timer. It should be based
* on TOD to be accurate. Does it matter ?
*/
- if (sync_active || rtems_bdbuf_has_buffer_waiters ())
+ if (sync_all || (sync_active && (*dev == bd->dev))
+ || rtems_bdbuf_has_buffer_waiters ())
bd->hold_timer = 0;
if (bd->hold_timer)
@@ -2515,11 +2540,11 @@
/*
* If a sync is active do not use a worker because the current code does not
* cleaning up after. We need to know the buffers have been written when
- * syncing to the release sync lock and currently worker threads do not
- * return to here. We do not know the worker is the last in a sequence of
- * sync writes until after we have it running so we do not know to tell it to
- * release the lock. The simplest solution is to get the main swap out task
- * perform all sync operations.
+ * syncing to release sync lock and currently worker threads do not return to
+ * here. We do not know the worker is the last in a sequence of sync writes
+ * until after we have it running so we do not know to tell it to release the
+ * lock. The simplest solution is to get the main swap out task perform all
+ * sync operations.
*/
if (bdbuf_cache.sync_active)
worker = NULL;
@@ -2533,7 +2558,8 @@
rtems_chain_initialize_empty (&transfer->bds);
transfer->dev = BDBUF_INVALID_DEV;
-
+ transfer->syncing = bdbuf_cache.sync_active;
+
/*
* When the sync is for a device limit the sync to that device. If the sync
* is for a buffer handle process the devices in the order on the sync
@@ -2541,7 +2567,7 @@
*/
if (bdbuf_cache.sync_active)
transfer->dev = bdbuf_cache.sync_device;
-
+
/*
* If we have any buffers in the sync queue move them to the modified
* list. The first sync buffer will select the device we use.
@@ -2753,6 +2779,7 @@
transfer.write_req = rtems_bdbuf_swapout_writereq_alloc ();
rtems_chain_initialize_empty (&transfer.bds);
transfer.dev = BDBUF_INVALID_DEV;
+ transfer.syncing = false;
/*
* Localise the period.
diff -u rtems/cpukit/libblock/src/diskdevs.c:1.25 rtems/cpukit/libblock/src/diskdevs.c:1.26
--- rtems/cpukit/libblock/src/diskdevs.c:1.25 Mon May 17 03:08:30 2010
+++ rtems/cpukit/libblock/src/diskdevs.c Mon May 17 21:14:05 2010
@@ -259,7 +259,7 @@
dd->ioctl = handler;
dd->driver_data = driver_data;
- if ((*handler)(dd, RTEMS_BLKDEV_CAPABILITIES, &dd->capabilities) < 0) {
+ if ((*handler)(dd, RTEMS_BLKIO_CAPABILITIES, &dd->capabilities) < 0) {
dd->capabilities = 0;
}
--
Generated by Deluxe Loginfo [http://www.codewiz.org/projects/index.html#loginfo] 2.122 by Bernardo Innocenti <bernie at develer.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/vc/attachments/20100517/59716b2a/attachment-0001.html>
More information about the vc
mailing list