All of lore.kernel.org
 help / color / mirror / Atom feed
From: whereami@gmail.com (David Sharp)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] read()ing an i2c node results in errno=ENOSYS
Date: Sun, 18 Sep 2005 04:25:12 +0000	[thread overview]
Message-ID: <b4e191e70509171923a7a0b59@mail.gmail.com> (raw)
In-Reply-To: <b4e191e7050915035768c521ef@mail.gmail.com>

> > > my amateur reading of the
> > > kernel source supports that this should work. However, a read call
> > > results in errno=ENOSYS (Function not implemented), although on one
> > > run, i actually got EPERM, and another time resulted in SEGV.
> >
> > ENOSYS is expected. You are trying to do raw I2C transfers while the bus
> > driver (i2c-viapro) and underlying chip only offer SMBus transfers (that
> > is, a subset of I2C.) It fails.
> >
> > I'm more concerned about EPERM and SEGV, which obviously shouldn't
> > happen. Hard to say why this happens without the actual code though.
> 
> well, the SEGV i couldn't repeat, and disappeared during the time it
> took to compile gdb to try to debug it. Actually, the EPERM may have
> happened more than once, but i can't reproduce it any more. It may
> have something to do with the module loading and unloading i was doing
> in vain attempts to get it to work. I'll definitely let you know if i
> get them again, and can get more info. I suspect they may have been
> caused by bus glitches, however. Shady programming on the
> microcontrollers, maybe. We are busy now implementing some proper
> SMBus on the microcontrollers anyway.

We've now implemented simple SMBus on our microcontrollers, and it is
mostly working. block writes work perfectly, but we are having a small
problem with block reads on the PC side. It seems from the register
dumps in the kernel logs that the first byte is going to the DAT0
register instead of into the BLK, so in userspace, it appears like the
first byte is lost. (DAT1 remains 00, though). As far as we can tell,
the data on the bus is correct, but our oscilloscope is nice and old,
making it impossible to see the whole transaction.

The EPERMs reappeared as we were working, but disappeared when we
started doing things correctly on the bus. They were probably actually
a Good Thing, better than getting garbage or something more fatal, so
I don't think you should worry about it.

  parent reply	other threads:[~2005-09-18  4:25 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-15 12:58 [lm-sensors] read()ing an i2c node results in errno=ENOSYS David Sharp
2005-09-16 20:56 ` Jean Delvare
2005-09-17 10:42 ` David Sharp
2005-09-18  4:25 ` David Sharp [this message]
2005-09-18  9:22 ` Jean Delvare
2005-09-18 23:34 ` Mark M. Hoffman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b4e191e70509171923a7a0b59@mail.gmail.com \
    --to=whereami@gmail.com \
    --cc=lm-sensors@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.