Received: by 10.213.65.68 with SMTP id h4csp45662imn; Mon, 12 Mar 2018 06:16:26 -0700 (PDT) X-Google-Smtp-Source: AG47ELvXdpmY6I9WB0BqIcfjNDxq79LSajdHdpVjUvfpv21XAiJ/GhWWbc7zZFkme/90LDBXUSuB X-Received: by 2002:a17:902:4001:: with SMTP id b1-v6mr7985054pld.28.1520860586121; Mon, 12 Mar 2018 06:16:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1520860586; cv=none; d=google.com; s=arc-20160816; b=WjU+ptMSPRnycBNaQu+9nsrG8/Sql85fJg3W/Ujl6dBv3P2gQJlktrkFZ50W83afJm z+6gbDeXG0kDjGkO3oKFWBzNH+kZNtD/06gqvBdkttChEwK7VNtsA98iqbqtJJiW4Lnq 3GKtH0SV60w3dB6DKVdoV6ccBrSleX3dyzYnYov9usd0aMMCtyEtf61vkcL6qqroOmtZ DgHSe0VHPF9VXjscBmwJ6TPMMmGPDI6wC2ctJukgcekWExHnTuvNloQ7JZ8Wo0DjEcKg tLk+XBKhtAps2bYs8g5KgMvdLle/TYh8mJ09E1Wc/B4UJeFwPxtAxkaLKUV87DwryLW+ pW3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dmarc-filter:dkim-signature :dkim-signature:arc-authentication-results; bh=VuT3BYHjOKAvTzOYa85fVzF2CEv/Vxg5Y28BfDnbngI=; b=PP0tdtyXDoLkc3HmhEmbaIKGGaKq5a+TTXSKShhbQ4r5vuDuwAstc2obLOeop8frKp cjcJW8k5ESJ9u5YR5sCfsXdo6UX/0y/YhUUJSG5wCeLCcbzaPjkdbSWiJaIUWEKhNMRE AVKDhVok6Lne34v+remL4apZg6JumNDvmBD2bJfW06x6GynK8lZZqKoa65QVpCudck1F IVyepmeLJbR6TOwT46drk4RLd0VxZ7sbPvNcoFsKqfvCyTI+Pt9TnvE4JchhmeCtmlFK kvlE/CN8oOO10+TGkUyXy7r1vVPSSW84vFcS3lg2/qFt2wUTo7KvG7vmEpeVfms1EPYm VzAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=OoN8zk0D; dkim=pass header.i=@codeaurora.org header.s=default header.b=OoN8zk0D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si5897712pff.120.2018.03.12.06.16.11; Mon, 12 Mar 2018 06:16:26 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=OoN8zk0D; dkim=pass header.i=@codeaurora.org header.s=default header.b=OoN8zk0D; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751285AbeCLNPQ (ORCPT + 99 others); Mon, 12 Mar 2018 09:15:16 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:41392 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751180AbeCLNPO (ORCPT ); Mon, 12 Mar 2018 09:15:14 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id DB1AC6070A; Mon, 12 Mar 2018 13:15:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520860513; bh=YxDr1/ecdXc61+xM9MNRJIhD1Y5VeNA7q9iS6A+Z6r0=; h=From:To:Cc:Subject:Date:From; b=OoN8zk0DnkdGB+GtkabQm23AlUW1jFM4XutUj0HmAb69VJThcdj4kuDc/k6cERywp 0dZzPgRmL6eq9MN2YKOmO/jeB4PRtqBCUj1PVRnj5a+/OSu2VeSlRdMLV951pw9ra3 tkwW2Z7/fpD+GznzjwbjbS5imrJNFotbrcE0idf4= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from absahu-linux.qualcomm.com (blr-c-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.19.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: absahu@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 8F68A603AF; Mon, 12 Mar 2018 13:15:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1520860513; bh=YxDr1/ecdXc61+xM9MNRJIhD1Y5VeNA7q9iS6A+Z6r0=; h=From:To:Cc:Subject:Date:From; b=OoN8zk0DnkdGB+GtkabQm23AlUW1jFM4XutUj0HmAb69VJThcdj4kuDc/k6cERywp 0dZzPgRmL6eq9MN2YKOmO/jeB4PRtqBCUj1PVRnj5a+/OSu2VeSlRdMLV951pw9ra3 tkwW2Z7/fpD+GznzjwbjbS5imrJNFotbrcE0idf4= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 8F68A603AF Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=absahu@codeaurora.org From: Abhishek Sahu To: Andy Gross , Wolfram Sang Cc: David Brown , Sricharan R , Austin Christ , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Abhishek Sahu Subject: [PATCH v2 00/13] Major code reorganization to make all i2c transfers working Date: Mon, 12 Mar 2018 18:44:49 +0530 Message-Id: <1520860502-14886-1-git-send-email-absahu@codeaurora.org> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * v2: 1. Address review comments in v1 2. Changed the license to SPDX 3. Changed commit messages for some of the patch having more detail 4. Removed event-based completion and changed transfer completion detection logic in interrupt handler 5. Removed dma_threshold and blk_mode_threshold from global structure 6. Improved determine mode logic for QUP v2 transfers 7. Fixed function comments 8. Fixed auto build test WARNING ‘idx' may be used uninitialized in this function 9. Renamed tx/rx_buf to tx/rx_cnt * v1: The current driver is failing in following test case 1. Handling of failure cases is not working in long run for BAM mode. It generates error message “bam-dma-engine 7884000.dma: Cannot free busy channel” sometimes. 2. Following I2C transfers are failing a. Single transfer with multiple read messages b. Single transfer with multiple read/write message with maximum allowed length per message (65K) in BAM mode c. Single transfer with write greater than 32 bytes in QUP v1 and write greater than 64 bytes in QUP v2 for non-DMA mode. 3. No handling is present for Block/FIFO interrupts. Any non-error interrupts are being treated as the transfer completion and then polling is being done for available/free bytes in FIFO. To fix all these issues, major code changes are required. This patch series fixes all the above issues and makes the driver interrupt based instead of polling based. After these changes, all the mentioned test cases are working properly. The code changes have been tested for QUP v1 (IPQ8064) and QUP v2 (IPQ8074) with sample application written over i2c-dev. Abhishek Sahu (13): i2c: qup: fix copyrights and update to SPDX identifier i2c: qup: fixed releasing dma without flush operation completion i2c: qup: minor code reorganization for use_dma i2c: qup: remove redundant variables for BAM SG count i2c: qup: schedule EOT and FLUSH tags at the end of transfer i2c: qup: fix the transfer length for BAM RX EOT FLUSH tags i2c: qup: proper error handling for i2c error in BAM mode i2c: qup: use the complete transfer length to choose DMA mode i2c: qup: change completion timeout according to transfer length i2c: qup: fix buffer overflow for multiple msg of maximum xfer len i2c: qup: send NACK for last read sub transfers i2c: qup: reorganization of driver code to remove polling for qup v1 i2c: qup: reorganization of driver code to remove polling for qup v2 drivers/i2c/busses/i2c-qup.c | 1507 ++++++++++++++++++++++++------------------ 1 file changed, 880 insertions(+), 627 deletions(-) -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation