Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp2022481ybh; Fri, 24 Jul 2020 02:23:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw0ELbevkbKe6opAQkjpYzqJufPVsBsmrQcApVNaF8MIA+QgkHlfsTKMqjbhyhs9HwkZlCo X-Received: by 2002:a05:6402:1bdd:: with SMTP id ch29mr8115196edb.134.1595582634242; Fri, 24 Jul 2020 02:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595582634; cv=none; d=google.com; s=arc-20160816; b=znJTZ08zG65x6jy9mMc9Kiv4eDu0KXk7qBI/idqT2vhQHbm46k8/NO8T/rKMNTMdE5 0oOVMo6f99J4vlT8jsgasnLejP5/TFja0XQHD9gQGqbvOzCqv//4u3zzdkqfXgGz153W qf1j8EvtN8NKxTT4RDIhU8wIpaMxwjxiJ7rfg6xoOlolk8QWEQFwrqmPdrZi4fdrukky 4uuV0LZeXsWgSGKyhlqkjm9qX8znOKjCP9qRfV4FcSgk4hMo3bXoneQY1TjjBOOdeEEB IhyY9U0lqFV9olitSNPJj9z2SPXPM8HQgG+QCm/tiZ+lbg1EKrMyLJ+ENzlE65xCoVOP ENKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=UCQgIDH18blhCrSH5b1SQMlBmyksN/2DUs5GSP9E0Fs=; b=AC6yvrRe8+8+MyGsaxHUPi0ALk9qDO63bvRzaCs6YQtzhUwC3AiXI51NLLP7DRhuL1 h7ZUuifjemn6zxIlPDeN3TCdeX+gZX+GEbgmZd6LvIwbV/TiOSgwkiejVgTujpqpJxBS oP71U0/5CxjQI/egMCnGG+nhg5en814X6vmsvgYUcKZadpYJJsBkmJKezxe2zdABBZJE CxaIvP3w4Gl1K7boWCzOdDBg+jhUQMOt6N+n8aO4WLo7w3TP9msAs3aMoF7MD5QQ4BSV yAnhVIHrjMsA0F0d4j25r6xNyLqsmkltIXENgfr47z3LNTxO4lIixLctoHLdKWiLWJhH fshQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ekBqfWhO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s14si254074ejq.387.2020.07.24.02.23.31; Fri, 24 Jul 2020 02:23:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=ekBqfWhO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726591AbgGXJWQ (ORCPT + 99 others); Fri, 24 Jul 2020 05:22:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726572AbgGXJWQ (ORCPT ); Fri, 24 Jul 2020 05:22:16 -0400 Received: from mail-lj1-x242.google.com (mail-lj1-x242.google.com [IPv6:2a00:1450:4864:20::242]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB6AFC0619D3 for ; Fri, 24 Jul 2020 02:22:15 -0700 (PDT) Received: by mail-lj1-x242.google.com with SMTP id f5so9257903ljj.10 for ; Fri, 24 Jul 2020 02:22:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=UCQgIDH18blhCrSH5b1SQMlBmyksN/2DUs5GSP9E0Fs=; b=ekBqfWhOs6f/OybbTE+hPMUjo1rK2jJgBZTMwF44ry2I3iDjmU6xazBuCfmaioC/Mh ysHDgfLtYSYDGTTdZlmc5h6Vx58skci0KuNkvpCLoWXkcB1GFQCh9SaAoflBQakN+rMn j5gKSITpAQLOfjjO6I/Rk0P2/PEBH6CZiyCE0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=UCQgIDH18blhCrSH5b1SQMlBmyksN/2DUs5GSP9E0Fs=; b=AmnVCiFPSz6ljkPWh5LECFoUlhfICF4WhkBhbe67x2QVVUUKqj3JbyDXtw9D/UaRVI 1VLt+nUWKE0vCSfgRtlrTxH/92DtMezNtjSwDczcCPGSuZSvAu98Cw/iR1LSIf8lkZje THj9T/WlNvMouS2wXBLxMxVfdoHmgECHVm5U/gU8OADWYcc55xn8YHRF/n3L0+moWSXF ZY+wL8xPAgUlBJtj50vIsT2wMsrSTaucCFGjFTS+v6Uy/WObOeRFDJHz0xDrNRf/F8aR tl9+tCMJq3pvKn0rFRKsGxr8QNyIPb5thLHDZSX6jF2b2geXurUYiqlA5wEiahITbZeZ FpDA== X-Gm-Message-State: AOAM531gq8Fxi4TP6f3w6pEC8ee8bIc3iyJm9oR0e5tZ86GQpebTD1wX /hTAkTHMf0oiBhF6AerA8qGabz+benmxkukzhBqbQw== X-Received: by 2002:a2e:b4ce:: with SMTP id r14mr4050255ljm.88.1595582534187; Fri, 24 Jul 2020 02:22:14 -0700 (PDT) MIME-Version: 1.0 References: <20200717090155.10383-1-rayagonda.kokatanur@broadcom.com> <20200717090155.10383-2-rayagonda.kokatanur@broadcom.com> <20200723201634.GC908@ninjato> In-Reply-To: <20200723201634.GC908@ninjato> From: Rayagonda Kokatanur Date: Fri, 24 Jul 2020 14:52:00 +0530 Message-ID: Subject: Re: [PATCH v2 1/2] i2c: add PEC error event To: Wolfram Sang Cc: linux-i2c , Linux Kernel Mailing List , Ray Jui , Scott Branden , BCM Kernel Feedback , Lori Hikichi , Robert Richter , Nishka Dasgupta , Andy Shevchenko , linux-arm Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 24, 2020 at 1:46 AM Wolfram Sang wrote: > > On Fri, Jul 17, 2020 at 02:31:54PM +0530, Rayagonda Kokatanur wrote: > > Add new event I2C_SLAVE_PEC_ERR to list of slave events. > > This event will be used by slave bus driver to indicate > > PEC error to slave client or backend driver. > > > > Signed-off-by: Rayagonda Kokatanur > > Definately needs documentation in Documentation/i2c/slave-interface.rst. Okay, I will update the doc. > > What is a backend supposed to do? Does 'value' have a meaning? According to SMBUS spec, during slave receive transfer, it is encouraged to issue NACK if the received PEC is not correct. Also PEC errors discovered above the data link layer may also be indicated with a NACK if the device is fast enough to discover and indicate the error when the NACK is due. If a device doesn't support issuing NACK and issuing NACK above the data link layer is not possible because the device is not fast then in that case we can send error code (I2C_SLAVE_PEC_ERR ) to the backend driver. Backend drivers which support PEC should check for this error code and take action such as discarding the data. Best regards, Rayagonda > > > --- > > include/linux/i2c.h | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/include/linux/i2c.h b/include/linux/i2c.h > > index b8b8963f8bb9..e04acd04eb48 100644 > > --- a/include/linux/i2c.h > > +++ b/include/linux/i2c.h > > @@ -370,6 +370,7 @@ enum i2c_slave_event { > > I2C_SLAVE_READ_PROCESSED, > > I2C_SLAVE_WRITE_RECEIVED, > > I2C_SLAVE_STOP, > > + I2C_SLAVE_PEC_ERR, > > }; > > > > int i2c_slave_register(struct i2c_client *client, i2c_slave_cb_t slave_cb); > > -- > > 2.17.1 > >