Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp1635344pxu; Thu, 8 Oct 2020 17:27:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJaaDjvNjy4UCL2W8d6D2BTK/EsIj6kjBR4KX+MARAo322YtzrZHBemaSPd0xuN+Ko+AsL X-Received: by 2002:aa7:d992:: with SMTP id u18mr11754142eds.284.1602203220664; Thu, 08 Oct 2020 17:27:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602203220; cv=none; d=google.com; s=arc-20160816; b=Y820CIWRigjJDmnrGtKmpDkc/FbgeDJnU44BjbN9nHAQRg+pTevwI4HoVhB/TCdkKo XiI0sdCS/giQRMJeewxmP0DnIXTdVB3C5PB6i8xBgOerrcDvqDk5+AMVXgPw7HV2XbWi yPXYPS1GXLc/NNKT2vXRAASrAi0usbwC2eLun64BdRSSfvs8m5yODuCqHIWi+TCLoz7N RJkADKtT48yAhylrLoWk3zeldeH03vNYOXB1NCqsmjRlKxENm6eoblv0Ukx7S99zMgQo ndPleVB0wSuT8u9alirNiB7sAz2WPK6dQUcxlvJVpZITfD+GkVAAluEgMeQGXSykaFcV OQBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=TclpIUFbPJmx7jd4wjkCDiKLMdsvfFtLGqEMlN1qODE=; b=R+ww36jmYthTdwd8am/ghISWfBhc1Cfrfn8WoxKdGaj+TFzePFk62T6vB26NCcPvzU oauLgWfYFM3Zud0X3QaWsw7dKbKJrdKElFBWDpbumyNECQ1vIvHtA1IepVEK09gO6eM1 d7CQea79XK1ziOLsbn5vt4tZiRHiHO0MkCDxxnUTpYXMUwaAqudBf1eF5ptz9zlPDntL 6v+3+lHH8hb7ntmPw/GbR0XhK34gK4mJ0S+Z5qvllo7GI6rZwfxN/VnSVf6CfIIj4LOR xu5PoLLEmQy3F485c+Cz4/6Qyq9g23bKul0w3OmUfxoW6XM92sJnZ8X6Dx4rrU12rAAy pPxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=aSTriDnh; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h11si4975778edt.462.2020.10.08.17.26.37; Thu, 08 Oct 2020 17:27:00 -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=@chromium.org header.s=google header.b=aSTriDnh; 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=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730675AbgJHWw5 (ORCPT + 99 others); Thu, 8 Oct 2020 18:52:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49968 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727556AbgJHWw4 (ORCPT ); Thu, 8 Oct 2020 18:52:56 -0400 Received: from mail-pl1-x644.google.com (mail-pl1-x644.google.com [IPv6:2607:f8b0:4864:20::644]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B2B4C0613D2 for ; Thu, 8 Oct 2020 15:52:55 -0700 (PDT) Received: by mail-pl1-x644.google.com with SMTP id w21so742517plq.3 for ; Thu, 08 Oct 2020 15:52:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TclpIUFbPJmx7jd4wjkCDiKLMdsvfFtLGqEMlN1qODE=; b=aSTriDnhy8WA2yhH1dmnwySm3U/eCcx4a5wVHYjjC7SKI08hjSIIhtvsvG138hvdG6 xNQ5YxzWAEtvW378mP2NIngwUBa73yAfzZQz2JtrrJCrgwR0p4czWoe7lvyaIqBrar64 MeMoo7pflUE6NEPaH1DktP1+4jhU6DEd6dVmE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=TclpIUFbPJmx7jd4wjkCDiKLMdsvfFtLGqEMlN1qODE=; b=UePvJQ+addS8usP46719v5xMwV5bVaJw1DQR6k19CweNh5i8eVZP85k6CICeNQxnqX anYLrmgVdtbezQPpx17dRv74rNhrgNbtCFs540T8X0SJQdNH0v+OptSVhHxOWq1mjO3Y ZdKceP8DN0MxW9corQLz54sqoBOKm0f1vhJPv+8NnhNas3NmmZ4eBvxNN82Fjy+oz57B 1Mo/xJ+3bmUPJp453SzCy0Od9CpvgFuQHrVpmFRZDi8uzsj5TNskZMnGtgDmtRvtSWkC ExAn0dny8y1MqzmNO5sIm1gGPacAGuiyVG/nTMyd16jvOip7mWJiZ8/8+u4gBhxWjjx+ nY7w== X-Gm-Message-State: AOAM533oYwkv1xAhaTCvr2asMwpT8wzN6gLgut9aNyu7uhZTBiRcOO4V yvzJrHM7IXdfBjVeTaXqOyKM8g== X-Received: by 2002:a17:902:14f:b029:d2:562d:e84 with SMTP id 73-20020a170902014fb02900d2562d0e84mr9468217plb.64.1602197574849; Thu, 08 Oct 2020 15:52:54 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:42b0:34ff:fe3d:58e6]) by smtp.gmail.com with ESMTPSA id jx17sm8386369pjb.10.2020.10.08.15.52.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Oct 2020 15:52:54 -0700 (PDT) From: Douglas Anderson To: Bjorn Andersson , Wolfram Sang , Akash Asthana Cc: linux-arm-msm@vger.kernel.org, Stephen Boyd , linux-i2c@vger.kernel.org, Douglas Anderson , Andy Gross , Girish Mahadevan , Karthikeyan Ramasubramanian , Mukesh Kumar Savaliya , linux-kernel@vger.kernel.org Subject: [PATCH 0/3] i2c: i2c-qcom-geni: More properly fix the DMA race Date: Thu, 8 Oct 2020 15:52:32 -0700 Message-Id: <20201008225235.2035820-1-dianders@chromium.org> X-Mailer: git-send-email 2.28.0.1011.ga647a8990f-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Previously I landed commit 02b9aec59243 ("i2c: i2c-qcom-geni: Fix DMA transfer race") to fix a race we were seeing. While that most definitely fixed the race we were seeing, it looks like it causes problems in the TX path, which we didn't stress test until we started trying to update firmware on devices. Let's revert that patch and try another way: fix the original problem by disabling the interrupts that aren't relevant to DMA transfers. Now we can stress both TX and RX cases and see no problems. I also can't find any place to put an msleep() that causes problems anymore. Since this problem only affects i2c, I'm hoping for an Ack from Bjorn and then all these patches can go through the i2c tree. However, if maintainers want to work a different way out to land that's OK too. NOTE: the 3rd patch in the series could certianly be squashed with patch #1 or I could re-order / rejigger. To me it seemed like a good idea to first fix the probelm (and make the two functions as much of an inverse as possible) and later try to clean things up. Yell if you want something different. Douglas Anderson (3): soc: qcom: geni: More properly switch to DMA mode Revert "i2c: i2c-qcom-geni: Fix DMA transfer race" soc: qcom: geni: Optimize select fifo/dma mode drivers/i2c/busses/i2c-qcom-geni.c | 6 ++-- drivers/soc/qcom/qcom-geni-se.c | 47 ++++++++++++++++++++---------- 2 files changed, 34 insertions(+), 19 deletions(-) -- 2.28.0.1011.ga647a8990f-goog