Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp1864762ybn; Thu, 26 Sep 2019 03:25:10 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIuE4zgxd6OfBVgMYfUdkFvPtOShxkFXPIjSNcWZiWSHTBmzfhbgNZY07FUvtATWDeBLDo X-Received: by 2002:a17:906:7798:: with SMTP id s24mr2360532ejm.211.1569493510837; Thu, 26 Sep 2019 03:25:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569493510; cv=none; d=google.com; s=arc-20160816; b=XQrm1UfC4p6p0a39bP5PlXAaolef5gsgAPm97LZCaKgFt0LLowy97oPDi3VmEwmeLh FSn46HJKfWTC66DF7DTdWogO5AsDnPyS6HDjHTdR8FKBGZUXkSwSTBMAwrsYIt7pOQDN fQPrCJG+dOFsF5jOV2to9Ml/JaNRv56jIeV6bw/QrmGphq98XKC6KbAOSYzP4j6BGDku f5bUB2ni6wmaBYltH0VKj7YV99FvgO0sPpQGgBJYvYKz4GLdj9I1J7k1y9CEPw6wEevI kOB/j80Lhi4H/lch1ab5gZjzwl7UqiO2Hw/dh+f397Sp41Qf1zyUFOsyXW3UC9h9Z+Az hKGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=jOxmQIZ9/nLS57z58IjKt3I6bKDLebiKnN6qX7jkqHc=; b=WBTi0+mSM89HFQDE1FOX+U2JLEwSMYeV/CyRDvH5S+MHZP2tSTd2/wcf/YtxDj19PP nJxhpIHq2BnFIUbsbFHK6gNjOFBSTYPqF5lmHAHDaTrcB/lRPIDNly34zpH9syxLZHTa De3Det0NtzbKkZW6+q+fqjBn4FakdyURRd9ffK7cXX2uTOdT6yyeIBj3Qsj4oioyyHK4 +MZB3QXlo/a7lYIy9TWLHpzkS5v0AnCyVVurlm11sf8fI8uZFiYn1K9g84tzy9S7X3Zu XbVlWBsZbalObXSh1tNHYUpH6OPICMwmoPCgToFpFrB9+kPHBj3BEcx1lTlJZaeK/cms g6RA== ARC-Authentication-Results: i=1; mx.google.com; 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 d19si750707ejr.163.2019.09.26.03.24.47; Thu, 26 Sep 2019 03:25:10 -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; 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 S1726803AbfIZGxB (ORCPT + 99 others); Thu, 26 Sep 2019 02:53:01 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:45602 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725823AbfIZGxB (ORCPT ); Thu, 26 Sep 2019 02:53:01 -0400 Received: by mail-ot1-f66.google.com with SMTP id 41so1029087oti.12; Wed, 25 Sep 2019 23:53:00 -0700 (PDT) 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=jOxmQIZ9/nLS57z58IjKt3I6bKDLebiKnN6qX7jkqHc=; b=NHyTmteGd1pOma+rnrJpF4x23lgF7T0pp/aa2zj8i3xsvy5L1IPaaRLn8LJBKjB6sl IGTMyCeeWuSx+dMQIudqy+i+4QH/H1+C6/WvplP+LFs5r2ETOXr07dDtW3/l8iGjpcAJ H0YsIg7yBRTVdV1C8uS+xRCrIgyyB7ch9u14k0BDg54RUGwevs5RU2f7jReLX8/HkCx2 slO/Ymk15jdW+sXTgm+nE1HZWgZEVip2mN8oFt9+ZUZjlCq7tmpXam8yEBAwqhgLP+Wd odkl0cHgWfkQAzOb3otwxWxzDw/om1XypJpTzdc6lJRMxtKAvOGDW0oe6xDr8JxJJe2K jyzw== X-Gm-Message-State: APjAAAXndRJRP1Teyy6v10LNIMN9KrIqhze43H2DD2kMgqOscgqzbDW7 736tSxe2ImWILTjB6rkh9Hj5TS9OxQSnH7jvdFg= X-Received: by 2002:a9d:5a06:: with SMTP id v6mr1471154oth.250.1569480780295; Wed, 25 Sep 2019 23:53:00 -0700 (PDT) MIME-Version: 1.0 References: <20190924110547.14770-1-lukma@denx.de> <20190924110547.14770-2-lukma@denx.de> In-Reply-To: <20190924110547.14770-2-lukma@denx.de> From: Geert Uytterhoeven Date: Thu, 26 Sep 2019 08:52:48 +0200 Message-ID: Subject: Re: [PATCH 1/2] spi: Add call to spi_slave_abort() function when spidev driver is released To: Lukasz Majewski Cc: Mark Brown , linux-spi , Linux Kernel Mailing List , Krzysztof Kozlowski 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 Hi Lukasz, On Thu, Sep 26, 2019 at 3:33 AM Lukasz Majewski wrote: > This change is necessary for spidev devices (e.g. /dev/spidev3.0) working > in the slave mode (like NXP's dspi driver for Vybrid SoC). > > When SPI HW works in this mode - the master is responsible for providing > CS and CLK signals. However, when some fault happens - like for example > distortion on SPI lines - the SPI Linux driver needs a chance to recover > from this abnormal situation and prepare itself for next (correct) > transmission. > > This change doesn't pose any threat on drivers working in master mode as > spi_slave_abort() function checks if SPI slave mode is supported. > > Signed-off-by: Lukasz Majewski Thanks for your patch! Yesterday I saw this appear on spi/for-next, but I couldn't find the email in my mbox. Today it has arrived. Looks like gmail had some troubles ("Delivered after 138401 seconds", ugh). > --- a/drivers/spi/spidev.c > +++ b/drivers/spi/spidev.c > @@ -627,6 +627,7 @@ static int spidev_release(struct inode *inode, struct file *filp) > if (dofree) > kfree(spidev); > } > + spi_slave_abort(spidev->spi); Looks good to me. Just wondering if this should be done for the last user only, i.e. in the "if" block above, like resetting speed_hz? > mutex_unlock(&device_list_lock); > > return 0; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds