Re: [PATCH 6/9] drm/i915/intel_i2c: return -ENXIO for device NAK

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

 



On Wed, 7 Mar 2012 20:41:03 +0800, Daniel Kurtz <djkurtz@xxxxxxxxxxxx> wrote:
> On Wed, Mar 7, 2012 at 8:12 PM, Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> wrote:
> > On Wed,  7 Mar 2012 19:50:47 +0800, Daniel Kurtz <djkurtz@xxxxxxxxxxxx> wrote:
> >> Return -ENXIO if a device NAKs a transaction.
> >>
> >> Note: We should return -ETIMEDOUT, too if the transaction times out,
> >> however, that error path is currently handled by the 'bit-bang fallback'.
> >>
> >> Signed-off-by: Daniel Kurtz <djkurtz@xxxxxxxxxxxx>
> >
> > Can you clarify what the rule is if an error is detected part-way
> > through a xfer?
> 
> A priceless comment from drivers/i2c/i2c-core::i2c_transfer...

Thanks, that is about as consistent as one expects with i2c. ;)
 
> This doesn't specify what to do if the transfer doesn't get an ACK
> during another phase of the transfer.
> However, it does say to send -ENXIO "if no ACK during address phase",
> which is a subset of the possible no-ACK conditions during a transfer.
>  Thus, I choose to return ENXIO in all no-ACK cases, to ensure we send
> it during the one case that is specified.

This (and a summary of the rest) deserves to be captured as a comment in
the code.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre
_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel

[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux