From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5F997C433E4 for ; Fri, 24 Jul 2020 09:22:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3B36C2063A for ; Fri, 24 Jul 2020 09:22:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ekBqfWhO" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728337AbgGXJWQ (ORCPT ); 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-Google-Smtp-Source: ABdhPJzoTOEerXlAc1lbArZdrW2edXix0eTm6dVqnq+ZUP5496Rfg7Jcvusy8EFJ5uGp02r4AF90kF1NdFDZ91Z6PE8= 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 > > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0EB35C433DF for ; Fri, 24 Jul 2020 09:29:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id CF7622063A for ; Fri, 24 Jul 2020 09:29:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="SURm/ssY"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=broadcom.com header.i=@broadcom.com header.b="ekBqfWhO" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CF7622063A Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=broadcom.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ygrZK6freXS7P0qLMh1O8WQkN0EyyTEutHKdO4lGVrU=; b=SURm/ssYn4ni97YOGf2iUgKXP Eu+KF2ACDEzovM4mQd+f+WIkWwRb++ubsngaQU4RQrvoLANtBiuvxN588cJ6ypa9jGbYx6mF2MasX bZ8Og3U7b1YcAMdTHBi4cdajWl8WN0N3n+/LnLM49yYAJlUInw7tLPZcYy8DW7kzH0VvhotEzrrbi H5BWUdnziOQlvevU0TjVr/eSLqzPbGrrSsrV7IIUKorglS+5hQLMNcxQlbuJ1v4F2scxho6Q0/T1L D/dgBmGcIRJ2TL1JUKUFjsSLE/+w5Yi0swo1byRtRpD/OG2r4ls4Wi2PzXSK8ZLvzTHlw+NDyJmlN MrC2ce+LQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jytzU-0004Ub-32; Fri, 24 Jul 2020 09:27:44 +0000 Received: from mail-lj1-x244.google.com ([2a00:1450:4864:20::244]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jytuG-00027Q-58 for linux-arm-kernel@lists.infradead.org; Fri, 24 Jul 2020 09:22:27 +0000 Received: by mail-lj1-x244.google.com with SMTP id q7so9293109ljm.1 for ; Fri, 24 Jul 2020 02:22:16 -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=P/XNBMQUU9QCL4COwafg/9VvCW3ZN9fYj/YtCZvP4m9v0p+oHd8J548gnsQCSoPOs1 PL4VTrqBfphvigqbkWdFZH1Ij3lmcIm/lU0HX+hfGzGMz6oUT4YuMmrilDi4HQ1VYFAG 4OEUIUNERd42EHe44CvEZqF0C2mM64K4QWLEY9sKIKTQFe6Ve605hcjCnNDHb+03PDDq dr/HKK31e0+UmJcG35PvulQBPpGdGHPF8+B87jamDzEUNpwVQklj4wjeVAABUg4FlCWH KJOHGTJgC5V+r7dV90SSkgDVshGhSKNIgW44Gi3Zauk9sFeyK8kCZ720YuZc9QLtucLF E93A== X-Gm-Message-State: AOAM532X2w+rn26SZFj+8lwim446lJcksdI5tsZmp077zXvg4CcZfKgo K/WDwkpkTaTEdbv2OUIDmXKoq9HRP/bzV9uthe6Zuw== X-Google-Smtp-Source: ABdhPJzoTOEerXlAc1lbArZdrW2edXix0eTm6dVqnq+ZUP5496Rfg7Jcvusy8EFJ5uGp02r4AF90kF1NdFDZ91Z6PE8= 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200724_052220_880410_EECA0811 X-CRM114-Status: GOOD ( 22.02 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Lori Hikichi , Scott Branden , Ray Jui , Linux Kernel Mailing List , Robert Richter , BCM Kernel Feedback , linux-i2c , Nishka Dasgupta , Andy Shevchenko , linux-arm Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel