change log for rtems (2010-06-24)
rtems-vc at rtems.org
rtems-vc at rtems.org
Thu Jun 24 08:15:41 UTC 2010
*sh*:
2010-06-24 Arnout Vandecappelle <arnout at mind.be>
PR 1586/misc
* libchip/i2c/spi-sd-card.h, libchip/i2c/spi-sd-card.c: Add retries to
SD card accesses.
M 1.528 c/src/ChangeLog
M 1.7 c/src/libchip/i2c/spi-sd-card.h
M 1.23 c/src/libchip/i2c/spi-sd-card.c
diff -u rtems/c/src/ChangeLog:1.527 rtems/c/src/ChangeLog:1.528
--- rtems/c/src/ChangeLog:1.527 Tue Jun 22 06:36:13 2010
+++ rtems/c/src/ChangeLog Thu Jun 24 02:54:14 2010
@@ -1,3 +1,9 @@
+2010-06-24 Arnout Vandecappelle <arnout at mind.be>
+
+ PR 1586/misc
+ * libchip/i2c/spi-sd-card.h, libchip/i2c/spi-sd-card.c: Add retries to
+ SD card accesses.
+
2010-06-22 Arnout Vandecappelle <arnout at mind.be>
PR 1580/misc
diff -u rtems/c/src/libchip/i2c/spi-sd-card.h:1.6 rtems/c/src/libchip/i2c/spi-sd-card.h:1.7
--- rtems/c/src/libchip/i2c/spi-sd-card.h:1.6 Tue Jun 22 03:37:26 2010
+++ rtems/c/src/libchip/i2c/spi-sd-card.h Thu Jun 24 02:54:15 2010
@@ -69,6 +69,7 @@
bool busy;
bool verbose;
bool schedule_if_busy;
+ uint32_t retries;
} sd_card_driver_entry;
extern sd_card_driver_entry sd_card_driver_table [];
diff -u rtems/c/src/libchip/i2c/spi-sd-card.c:1.22 rtems/c/src/libchip/i2c/spi-sd-card.c:1.23
--- rtems/c/src/libchip/i2c/spi-sd-card.c:1.22 Tue Jun 22 06:36:14 2010
+++ rtems/c/src/libchip/i2c/spi-sd-card.c Thu Jun 24 02:54:15 2010
@@ -1236,15 +1236,26 @@
rtems_device_minor_number minor = rtems_disk_get_minor_number( dd);
sd_card_driver_entry *e = &sd_card_driver_table [minor];
rtems_blkdev_request *r = (rtems_blkdev_request *) arg;
+ int (*f)( sd_card_driver_entry *, rtems_blkdev_request *);
+ uint32_t retries = e->retries;
+ int result;
+
switch (r->req) {
case RTEMS_BLKDEV_REQ_READ:
- return sd_card_disk_block_read( e, r);
+ f = sd_card_disk_block_read;
+ break;
case RTEMS_BLKDEV_REQ_WRITE:
- return sd_card_disk_block_write( e, r);
+ f = sd_card_disk_block_write;
+ break;
default:
errno = EINVAL;
return -1;
}
+ do {
+ result = f( e, r);
+ } while (retries-- > 0 && result != 0);
+ return result;
+
} else if (req == RTEMS_BLKIO_CAPABILITIES) {
*(uint32_t *) arg = RTEMS_BLKDEV_CAP_MULTISECTOR_CONT;
return 0;
@@ -1265,9 +1276,12 @@
for (minor = 0; minor < sd_card_driver_table_size; ++minor) {
sd_card_driver_entry *e = &sd_card_driver_table [minor];
dev_t dev = rtems_filesystem_make_dev_t( major, minor);
+ uint32_t retries = e->retries;
/* Initialize SD Card */
- sc = sd_card_init( e);
+ do {
+ sc = sd_card_init( e);
+ } while (retries-- > 0 && sc != RTEMS_SUCCESSFUL);
RTEMS_CHECK_SC( sc, "Initialize SD Card");
/* Create disk device */
--
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/20100624/7769b106/attachment.html>
More information about the vc
mailing list