Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp715364ybt; Fri, 26 Jun 2020 09:47:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP/Ja+laVfPNwYicXeXEEDBmSLQi+KUpYQl3+7Krd/Ex+jmAGkxtyssATUktRe+VGxEiLe X-Received: by 2002:aa7:d4c5:: with SMTP id t5mr4083881edr.357.1593190071370; Fri, 26 Jun 2020 09:47:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1593190071; cv=none; d=google.com; s=arc-20160816; b=kTVQ6G6JUkWG/IwjNXLxCZHrVAIiHQVOiFj8MBgyG2Zey8tGkCc/2bcPAEbEclxENW avDxQS+TcRjT3v5/Hh6OEvIWQus4KT8n/P65AJDbuhZaDWeLRzu0OFqDTH6xg/9mmeK1 6p8+x0+2F3D8nIYZwy8CmTxH2pH77z+U2n/Tq7tjfRGYt+38IhQdO/tQc4o2I4IbvaO9 APOWuXsjQv06ZcMsK0/dWNui1Y2ACv7heGh9E0mNSHtEturbOSFytY2WMSo21ayN0X9e dQPq29gIKsAk7y0L8C/BxTiAY/dZ4lJrocKaHQWRpWAmBN24Gi5uU1lY8d+W3LVO8iLf XCoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=0S3+/lb8kTzTF7FG+GaZo7TfixBDNtLBveukGJJz1OA=; b=lmgknrFCfeEC6jlTo3ImNNmIwlQIuUDTIfceQSE3xBDhYX5OT2toC+Hmf7HjofHPnz dqqGIh2ofQF4ahvVe0UK3FrJ8hN81HJ5v80hoE8YSftfnlOuxBSELxDLDyBRJX61TrZ0 wrCG/q9HHYRo6Xq+DczYEMpQDOowIYhTdBTmHgmX0ZahGz3jm4BmLejCR34K0bJQHV4h TbYN7Oviljpl8R0CC5A3b3rTNrIg0+mICfexb08EKq3p4cWstgcTV6Kdo43B8flOPpjT TUJvtl8kZJ/D9U1AEVgXeyALOY0axaajCiENihUZiQwBcUqbFcblFD4nN/UwHn2YEpVf PfFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=pxn6Zawd; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id bu5si9943660edb.553.2020.06.26.09.47.29; Fri, 26 Jun 2020 09:47:51 -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=@linaro.org header.s=google header.b=pxn6Zawd; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728882AbgFZPSE (ORCPT + 99 others); Fri, 26 Jun 2020 11:18:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726657AbgFZPSD (ORCPT ); Fri, 26 Jun 2020 11:18:03 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0F1CFC03E97A for ; Fri, 26 Jun 2020 08:18:03 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id z63so9054534qkb.8 for ; Fri, 26 Jun 2020 08:18:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=0S3+/lb8kTzTF7FG+GaZo7TfixBDNtLBveukGJJz1OA=; b=pxn6ZawdwN+2yWmx04djJWqqXdCzmPwgL9uoMrdcjCFQHtH0kzj7+OCDwo0NOmsffI 9MOHjqXADtuM6Eonqp4mO8OVha8dQsqVFHr/fsbKSPzfb4VeCRa4Y/AvLZD/8V0uU5i/ rv7kDng9weKxmLnpPFfwzd+LfObFbsB8K1spR8cRZCUarMngFTeSX5Ld3FXEvhPHGkUk LU2sSRqEKa84G2P38oJ3kPczTjj+h65ZLaeQKCHPmv2RIhcv8wLQ4cFpausDgh4rvWK3 Xu76inpSAyo5OgQIz5cRPF4yA2kxbxvNbAD9bugtRDyE8P2IpIUbA7E40aEAZewiExcE yOzg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=0S3+/lb8kTzTF7FG+GaZo7TfixBDNtLBveukGJJz1OA=; b=g8j9HO15oyfDw7dDUU+KiUTmZgJ8svvunMlzMBAUfwjfZBH9B10O7PXYiHWxj5hBep pAxW+xGI8NZ5ABOcp/627dUuQZb2/ytCvfYT81hvxVMSCWPYjQ/71TmkHg4KVvRT+f1M A3J7tQjrOu03+taukhTrek9zmmEvP02lohk0x5GesDfm9Hacw3ooPzwKnbvLSdcS+JgB ySLnQ1iol8n3BkawdJqW939ZAG9fOnd7UMnck6i5dFmunY3Wyh/mzW4iJACrtLfVh5zq yr7SC8+IK8QQLND5LK7QbHWSYuGKsxHFxoJ7e6VNpFPoY4m2OjVOZ4iK0uSS8hycVsfL 8X1g== X-Gm-Message-State: AOAM530i2N8SrpM0zQKQpAQNIoSpQER2SOYICRrAD6FZzc04bfCK+r5V hXVUK5a9+5vnGW0p1U4Ne2DPMA== X-Received: by 2002:a37:7683:: with SMTP id r125mr1013064qkc.39.1593184682285; Fri, 26 Jun 2020 08:18:02 -0700 (PDT) Received: from localhost (rfs.netwinder.org. [206.248.184.2]) by smtp.gmail.com with ESMTPSA id 79sm173640qkd.134.2020.06.26.08.18.01 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jun 2020 08:18:01 -0700 (PDT) Date: Fri, 26 Jun 2020 11:18:00 -0400 From: Ralph Siemsen To: Serge Semin Cc: Pavel Machek , Serge Semin , Greg Kroah-Hartman , linux-kernel@vger.kernel.org, stable@vger.kernel.org, Georgy Vlasov , Ramil Zaripov , Alexey Malahov , Thomas Bogendoerfer , Arnd Bergmann , Andy Shevchenko , Feng Tang , Rob Herring , linux-mips@vger.kernel.org, devicetree@vger.kernel.org, Mark Brown , Sasha Levin Subject: Re: [PATCH 4.19 182/267] spi: dw: Return any value retrieved from the dma_transfer callback Message-ID: <20200626151800.GA22242@maple.netwinder.org> References: <20200619141648.840376470@linuxfoundation.org> <20200619141657.498868116@linuxfoundation.org> <20200619210719.GB12233@amd> <20200622205121.4xuki7guyj6u5yul@mobilestation> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200622205121.4xuki7guyj6u5yul@mobilestation> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Serge, Pavel, Greg, On Mon, Jun 22, 2020 at 11:51:21PM +0300, Serge Semin wrote: >Hello Pavel > >On Fri, Jun 19, 2020 at 11:07:19PM +0200, Pavel Machek wrote: > >> Mainline patch simply changes return value, but code is different in >> v4.19, and poll_transfer will now be avoided when dws->dma_mapped. Is >> that a problem? > >Actually no.) In that old 4.19 context it's even better to return straight away >no matter what value is returned by the dma_transfer() callback. This patch changes the return dma_transfer return value from 0 to 1, however it was only done in spi-dw-mid.c func mid_spi_dma_transfer(). There is an identical function in spi-dw-mmio.c that needs the same treatment, otherwise access to the SPI device becomes erratic and even causes kernel to hang. Guess how I found this ;-) So the following patch is needed as well, at least in 4.9 and 4.19, I did not check/test other versions. Mainline does not need this, since the code seems to have been refactored to avoid the duplication. Regards, -Ralph diff --git a/drivers/spi/spi-dw-mmio.c b/drivers/spi/spi-dw-mmio.c index c563c2815093..99641c485288 100644 --- a/drivers/spi/spi-dw-mmio.c +++ b/drivers/spi/spi-dw-mmio.c @@ -358,7 +358,7 @@ static int mmio_spi_dma_transfer(struct dw_spi *dws, struct spi_transfer *xfer) dma_async_issue_pending(dws->txchan); } - return 0; + return 1; } static void mmio_spi_dma_stop(struct dw_spi *dws) -- 2.17.1