Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp844660pxu; Fri, 11 Dec 2020 16:15:47 -0800 (PST) X-Google-Smtp-Source: ABdhPJwHMi2exHCTLAtXuCxr4xJnuq2hWZsez7MaSqfqgz2cE4JiKQTJM0/gBJuEVJf3kkShttso X-Received: by 2002:a50:a692:: with SMTP id e18mr14335900edc.233.1607732146797; Fri, 11 Dec 2020 16:15:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607732146; cv=none; d=google.com; s=arc-20160816; b=kCX5ijlinUddyZSne10XU01iPsv0lG3OdzbRvbFT7qFGsAZlgf1sVSHw4CkPygpgJm 8Wswy1xx2LX1OHoLHqTH2rnmNRESEFNSlM1/jw+3DIlKyfKaYbS+a8aHRQoPH/mq8Kgf W25CiWVEC8OY8I/7qsHdNNNkn9BSGpZSiFTnBvMSzH00DH55iDcw3tCiRiJdTyuQemPS HwZUayGUp9LCde4TfiQOIrMcBU61vZua729pPzBPQOsFrvnyojkbsD8kHuwTiqGMso17 doJRJeuYS2QfWqqYuMeqmkY7Ed+Fc8cWqE31Pt20uG5iv8+93yWpFF9ELGsD1WzwplJT /rvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=tmocuTlFkdrvz3dSgRAckP0PaP8a7z+1zm1gMKMoKF4=; b=RMqBK/lfQQGNTFeEoXPZ46dmZQh/rXK8qeMC5Y70HxMB5IQYlou3lFAhGRkRQn5Jae SF2LW1SC71m2UE533AtAFMiQuORFdCKO6hf7iDiI6vlrIu/g09aQiWpDLPwfyCPU5+4j mBOuoKsuOwYTf4LtE9jCK+7VRotPjgW2HxzfM+f/z3F2ucy7qDz0Bd+4jwfhsZ+ONqfx eOrOr7WeTYDS5oAh33uI+D0ygfgIFOLpi+vUvTqomPYXi7ZbRJiH0xo1b1JAi3+ZCbtq PaGzZItjZBIOWrq+jTK4y2A9NK3zK5GfgCn55+WpjVeQK/NCMRSBqEUi6HX84YJghLP8 nkRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=GcBDxMDo; 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 cz22si5798732edb.241.2020.12.11.16.15.24; Fri, 11 Dec 2020 16:15:46 -0800 (PST) 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=GcBDxMDo; 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 S2390981AbgLKBxC (ORCPT + 99 others); Thu, 10 Dec 2020 20:53:02 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390982AbgLKBws (ORCPT ); Thu, 10 Dec 2020 20:52:48 -0500 Received: from mail-vs1-xe41.google.com (mail-vs1-xe41.google.com [IPv6:2607:f8b0:4864:20::e41]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 54232C0613D6 for ; Thu, 10 Dec 2020 17:52:08 -0800 (PST) Received: by mail-vs1-xe41.google.com with SMTP id h6so3979841vsr.6 for ; Thu, 10 Dec 2020 17:52:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=tmocuTlFkdrvz3dSgRAckP0PaP8a7z+1zm1gMKMoKF4=; b=GcBDxMDo90j9A7h0fSdxICMBTnOcZBbZMW3UYjwASf9i+VeD3cu9Xe7aYOZhu3sa3s bZG1aSEw7WRdYQfbPOgVRXZ/h2De7AYllbhGxBEbRfuoObfkPYD+dxwofolcw324jfa0 8HD2185S9AE4Qme/uWqnEqEbt9sIA39nrHhI0= 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=tmocuTlFkdrvz3dSgRAckP0PaP8a7z+1zm1gMKMoKF4=; b=ub5LAIwncAU2Ztun2B1HNYYxOEN74jvrukRq6RJ5OUIvWbrFnNkJpwbGi5L8i8bbu3 PDE2xSv5bLr5mHmd2YRwbsRXBRuYVSChJWghOcuHIH2CUwzamaVQuVR0PSbxt7+3jLN/ ze/nH0nzZiNr80HBhL1Ihi+vfE6UETscdSNIoIYVQ9MADUZbKdNvVrpoWKsUmXZAnYPg 6VL0EoW54/8XOy5KD5JKRssXyTVZRFY5hioKR9mN4CCqkwaanYIY37PnmCwgAdsvVjSC uyq9gROLOjxM7hT9cruSK6pxEcxZ8qyQMrWMD0/Wilp690p8hGKWVDd1IQhQsuOVBC71 IDiw== X-Gm-Message-State: AOAM532yAjpm3OzzwOE2PpeeqRU5zvw3vTynU2oJeQ9PVX5V0Pb1poor L1ZatC/sYZ4H+D9X9vAIhq52VC/4cllU3Q== X-Received: by 2002:a67:e185:: with SMTP id e5mr11095978vsl.22.1607651527035; Thu, 10 Dec 2020 17:52:07 -0800 (PST) Received: from mail-vs1-f45.google.com (mail-vs1-f45.google.com. [209.85.217.45]) by smtp.gmail.com with ESMTPSA id n2sm664177uae.12.2020.12.10.17.52.06 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Dec 2020 17:52:06 -0800 (PST) Received: by mail-vs1-f45.google.com with SMTP id e15so2485783vsa.0 for ; Thu, 10 Dec 2020 17:52:06 -0800 (PST) X-Received: by 2002:a67:4242:: with SMTP id p63mr11018057vsa.34.1607651525656; Thu, 10 Dec 2020 17:52:05 -0800 (PST) MIME-Version: 1.0 References: <20201203074459.13078-1-rojay@codeaurora.org> <160764107797.1580929.14768824290834396298@swboyd.mtv.corp.google.com> <160764316821.1580929.18177257779550490986@swboyd.mtv.corp.google.com> <160764785500.1580929.4255309510717807485@swboyd.mtv.corp.google.com> <160764967649.1580929.3992720095789306793@swboyd.mtv.corp.google.com> <160765077856.1580929.643282739071441296@swboyd.mtv.corp.google.com> In-Reply-To: <160765077856.1580929.643282739071441296@swboyd.mtv.corp.google.com> From: Doug Anderson Date: Thu, 10 Dec 2020 17:51:53 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] spi: spi-geni-qcom: Fix NULL pointer access in geni_spi_isr To: Stephen Boyd Cc: Roja Rani Yarubandi , Mark Brown , Andy Gross , Bjorn Andersson , linux-arm-msm , linux-spi , LKML , Akash Asthana , msavaliy@qti.qualcomm.com Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Dec 10, 2020 at 5:39 PM Stephen Boyd wrote: > > Quoting Doug Anderson (2020-12-10 17:30:17) > > On Thu, Dec 10, 2020 at 5:21 PM Stephen Boyd wrote: > > > > > > Yeah and so if it comes way later because it timed out then what's the > > > point of calling synchronize_irq() again? To make the completion > > > variable set when it won't be tested again until it is reinitialized? > > > > Presumably the idea is to try to recover to a somewhat usable state > > again? We're not rebooting the machine so, even though this transfer > > failed, we will undoubtedly do another transfer later. If that > > "abort" interrupt comes way later while we're setting up the next > > transfer we'll really confuse ourselves. > > The interrupt handler just sets a completion variable. What does that > confuse? The interrupt handler sees a "DONE" interrupt. If we've made it far enough into setting up the next transfer that "cur_xfer" has been set then it might do more, no? > > I guess you could go the route of adding a synchronize_irq() at the > > start of the next transfer, but I'd rather add the overhead in the > > exceptional case (the timeout) than the normal case. In the normal > > case we don't need to worry about random IRQs from the past transfer > > suddenly showing up. > > > > How does adding synchronize_irq() at the end guarantee that the abort is > cleared out of the hardware though? It seems to assume that the abort is > pending at the GIC when it could still be running through the hardware > and not executed yet. It seems like a synchronize_irq() for that is > wishful thinking that the irq is merely pending even though it timed > out and possibly never ran. Maybe it's stuck in a write buffer in the > CPU? I guess I'm asserting that if a full second passed (because we timed out) and after that full second no interrupts are pending then the interrupt will never come. That seems a reasonable assumption to me. It seems hard to believe it'd be stuck in a write buffer for a full second? -Doug