Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/arm/broadcom If doing a read-only (that is, no init...



details:   https://anonhg.NetBSD.org/src/rev/2a4a944d6b12
branches:  trunk
changeset: 335795:2a4a944d6b12
user:      jakllsch <jakllsch%NetBSD.org@localhost>
date:      Sat Jan 24 00:27:31 2015 +0000

description:
If doing a read-only (that is, no initial command write phase) transfer,
do not send a 0-byte write to the device before performing data phase.

diffstat:

 sys/arch/arm/broadcom/bcm2835_bsc.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 95ea34ae65db -r 2a4a944d6b12 sys/arch/arm/broadcom/bcm2835_bsc.c
--- a/sys/arch/arm/broadcom/bcm2835_bsc.c       Sat Jan 24 00:23:37 2015 +0000
+++ b/sys/arch/arm/broadcom/bcm2835_bsc.c       Sat Jan 24 00:27:31 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: bcm2835_bsc.c,v 1.4 2015/01/24 00:23:37 jakllsch Exp $ */
+/*     $NetBSD: bcm2835_bsc.c,v 1.5 2015/01/24 00:27:31 jakllsch Exp $ */
 
 /*
  * Copyright (c) 2012 Jonathan A. Kollasch
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.4 2015/01/24 00:23:37 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: bcm2835_bsc.c,v 1.5 2015/01/24 00:27:31 jakllsch Exp $");
 
 #include <sys/param.h>
 #include <sys/bus.h>
@@ -231,6 +231,9 @@
        c |= BSC_C_INTR | BSC_C_INTT | BSC_C_INTD;
 #endif
 
+       if (isread && cmdlen == 0)
+               goto only_read;
+
        buf = __UNCONST(cmdbuf);
        len = cmdlen;
 
@@ -301,6 +304,7 @@
        if (!isread)
                goto done;
 
+only_read:
        c |= BSC_C_READ;
 
        buf = databuf;



Home | Main Index | Thread Index | Old Index