From mboxrd@z Thu Jan 1 00:00:00 1970 From: Joerg Roedel Subject: Re: [RFC] iommu: arm-smmu: stall support Date: Wed, 27 Sep 2017 14:15:40 +0200 Message-ID: <20170927121540.GL8398@8bytes.org> References: <20170914194444.32551-1-robdclark@gmail.com> <20170919123038.GF8398@8bytes.org> <20170922090204.GJ8398@8bytes.org> <32e3ab2c-a996-c805-2a0d-a2e85deb3a50@arm.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org Errors-To: iommu-bounces-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org To: Rob Clark Cc: linux-arm-msm , Will Deacon , Linux Kernel Mailing List , "iommu-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org" , "linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org" List-Id: linux-arm-msm@vger.kernel.org Hi Rob, Jean, On Fri, Sep 22, 2017 at 02:42:44PM -0400, Rob Clark wrote: > I'm in favour if splitting the reporting *somehow*.. the two > approaches that seemed sane are: > > 1) call fault handler from irq and having separate domain->resume() > called by the driver, potentially from a wq > 2) or having two fault callbacks, first called before wq and then > based on returned value, optionally 2nd callback called from wq > > The first seemed less intrusive to me, but I'm flexible. How about adding a flag to the fault-handler call-back that tells us whether it wants to sleep or not. If it wants, we call it from a wq, if not we call call it directly like we do today in the report_iommu_fault() function. In any case we call iommu_ops->resume() when set on completion of the fault-handler either from the workqueue or report_iommu_fault itself. Regards, Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 From: joro@8bytes.org (Joerg Roedel) Date: Wed, 27 Sep 2017 14:15:40 +0200 Subject: [RFC] iommu: arm-smmu: stall support In-Reply-To: References: <20170914194444.32551-1-robdclark@gmail.com> <20170919123038.GF8398@8bytes.org> <20170922090204.GJ8398@8bytes.org> <32e3ab2c-a996-c805-2a0d-a2e85deb3a50@arm.com> Message-ID: <20170927121540.GL8398@8bytes.org> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Hi Rob, Jean, On Fri, Sep 22, 2017 at 02:42:44PM -0400, Rob Clark wrote: > I'm in favour if splitting the reporting *somehow*.. the two > approaches that seemed sane are: > > 1) call fault handler from irq and having separate domain->resume() > called by the driver, potentially from a wq > 2) or having two fault callbacks, first called before wq and then > based on returned value, optionally 2nd callback called from wq > > The first seemed less intrusive to me, but I'm flexible. How about adding a flag to the fault-handler call-back that tells us whether it wants to sleep or not. If it wants, we call it from a wq, if not we call call it directly like we do today in the report_iommu_fault() function. In any case we call iommu_ops->resume() when set on completion of the fault-handler either from the workqueue or report_iommu_fault itself. Regards, Joerg From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752847AbdI0MPr (ORCPT ); Wed, 27 Sep 2017 08:15:47 -0400 Received: from 8bytes.org ([81.169.241.247]:41746 "EHLO theia.8bytes.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750854AbdI0MPo (ORCPT ); Wed, 27 Sep 2017 08:15:44 -0400 Date: Wed, 27 Sep 2017 14:15:40 +0200 From: Joerg Roedel To: Rob Clark Cc: Jean-Philippe Brucker , linux-arm-msm , Will Deacon , Linux Kernel Mailing List , "iommu@lists.linux-foundation.org" , "linux-arm-kernel@lists.infradead.org" Subject: Re: [RFC] iommu: arm-smmu: stall support Message-ID: <20170927121540.GL8398@8bytes.org> References: <20170914194444.32551-1-robdclark@gmail.com> <20170919123038.GF8398@8bytes.org> <20170922090204.GJ8398@8bytes.org> <32e3ab2c-a996-c805-2a0d-a2e85deb3a50@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rob, Jean, On Fri, Sep 22, 2017 at 02:42:44PM -0400, Rob Clark wrote: > I'm in favour if splitting the reporting *somehow*.. the two > approaches that seemed sane are: > > 1) call fault handler from irq and having separate domain->resume() > called by the driver, potentially from a wq > 2) or having two fault callbacks, first called before wq and then > based on returned value, optionally 2nd callback called from wq > > The first seemed less intrusive to me, but I'm flexible. How about adding a flag to the fault-handler call-back that tells us whether it wants to sleep or not. If it wants, we call it from a wq, if not we call call it directly like we do today in the report_iommu_fault() function. In any case we call iommu_ops->resume() when set on completion of the fault-handler either from the workqueue or report_iommu_fault itself. Regards, Joerg