Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp5245943imm; Tue, 18 Sep 2018 06:39:27 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZFoc49gGBXrUl0F1nXn8aG8o9TwNQ+H8bKlkWn/g0HGFe7sOzKGn/HObXo7G4zle3jBGsW X-Received: by 2002:a17:902:768c:: with SMTP id m12-v6mr29686945pll.56.1537277967533; Tue, 18 Sep 2018 06:39:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537277967; cv=none; d=google.com; s=arc-20160816; b=DLU5fuwDjNXPEtRH0yCBRxImLRjf6jHlI52U4c4kjIXDoqV1dch6vAGBQ/gIv/FH7c Yp74WslJfLnBJPbf/Kn2tfL3shcX8Tk/B3n3QeZm7adLC6Lo7ynX5A5HIJZ5jN42HSDF BCIFfW6VGSWv+HXWYJmnQ0l1qCyeeAFGwmSLNkqkhaREucsszqouso55Sf4bRrL6S/ye Ksc+mmsTFOfUkUhz9q3jIEsYxRr+dn/IDwA2ArND0DRb0ev8Bi+ZlBFkwzqTBOD2nbg/ wkm7IbPpUmJlFZbKGcCiadU4wiQdsdh3n/4SQi4YWXLEeDfgg+yDUc37YawHBC4k9pw8 WNOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=/mPNY4cMyEnj4KrXpe3mIPfrwJPRY4owXT7IofIRFvc=; b=VyNdSv0FxHKer7lSD0J0YqMG4FnHnbKVKz5wDz7o2rmunQ0IFwC1QPnSQ/98LRI+kA HhNlvKmf7DwpNHNyCuiW+MkSp/Sg3i1cUvhGpy1JJ87KjU2k9tvZ07zAJpjhJzCaipu7 NsJMiS/wEpnEC7pjXWhWbAGRyuN1kXYw8XLuDrMVafuecXya6pz/zWOqI86dsVEZM2TP f0ppNIyloAMvgRC+sGt+Rrf0Mq7qU9cKphVN6H8EJjpg9yVOzQ7E65s/iOxQKVtFJm0Y OXf7Iekw0BBn/h+boA+a999UnnfTzQhiaAd7Dur7r+vBUF4/MWx3JCsWIuvjGKfpksVO 5Ntw== 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 12-v6si19515538plb.203.2018.09.18.06.39.11; Tue, 18 Sep 2018 06:39:27 -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 S1729684AbeIRTKB (ORCPT + 99 others); Tue, 18 Sep 2018 15:10:01 -0400 Received: from cust-95-128-94-82.breedbanddelft.nl ([95.128.94.82]:34104 "EHLO cust-95-128-94-82.breedbanddelft.nl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727207AbeIRTKB (ORCPT ); Tue, 18 Sep 2018 15:10:01 -0400 Received: by abra2.bitwizard.nl (Postfix, from userid 1000) id 1F2A413F7D7; Tue, 18 Sep 2018 15:37:21 +0200 (CEST) Date: Tue, 18 Sep 2018 15:37:21 +0200 From: Rogier Wolff To: Phil Elwell Cc: Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Alexander Graf , Stefan Wahren Subject: Re: [PATCH 1/2] sc16is7xx: Fix for multi-channel stall Message-ID: <20180918133720.GE4791@BitWizard.nl> References: <1536762716-30673-1-git-send-email-phil@raspberrypi.org> <1536762716-30673-2-git-send-email-phil@raspberrypi.org> <20180918130243.GA25253@kroah.com> <07ee2375-382c-154a-4c47-abb1a81b3351@raspberrypi.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <07ee2375-382c-154a-4c47-abb1a81b3351@raspberrypi.org> Organization: BitWizard B.V. User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 18, 2018 at 02:13:15PM +0100, Phil Elwell wrote: > I could add a limit on the number of iterations, but if the limit is ever hit, > leading to an early exit, the port is basically dead because it will never > receive another interrupt. Especially if you print something like: ": Too many iterations with work-to-do bailing out" while bailing out, then hanging just one driver/piece of hardware as opposed to the whole system when somehow the hardware never indicates "all work done" would be preferable. Under normal circumstances you never expect to hit that number of iterations. But if the card keeps hitting the driver with "more work to do" then you'd hang the system. Better try and recover, and provide debug info for the user who knows where to look. Best would be to ignore the driver for say a second and start handling interrupts again a while later. Should the system be overloaded with work, (and a slow CPU?) then you can recover and just make things slow down a bit without hanging the system. Getting edge-triggered interrupts right is VERY difficult. In general I'd advise against them. It looks like a nice solution, but in reality the chances for difficult-to-debug race conditions is enormous. In those race conditions the card will get "new work to do" and (re-)assert the interrupt line when the driver is already on the "no more work to do" path. Roger. -- ** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2600998 ** ** Delftechpark 26 2628 XH Delft, The Netherlands. KVK: 27239233 ** *-- BitWizard writes Linux device drivers for any device you may have! --* The plan was simple, like my brother-in-law Phil. But unlike Phil, this plan just might work.