Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp940286imm; Tue, 5 Jun 2018 06:53:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIEh9iq1AbYH3Lkf85eXzJmjnDBfIY0wmjJqGUaxnu3EqdkWC2PKnAm6usUVdSWIKAGlsdB X-Received: by 2002:a65:43cb:: with SMTP id n11-v6mr20678797pgp.234.1528206813643; Tue, 05 Jun 2018 06:53:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528206813; cv=none; d=google.com; s=arc-20160816; b=XwBwNcIZmaO+LEoSrGWiLRXpYun8KmJHDgH3o01gBB0RVr8wiaIri4nCxTZMUZOEUj JZavB1u9FCobB/DW+eTtsfWH1u6KxPZpBZOe1PigtQ9vktwonWhRNZlrXvnnD22c/tUQ AGlGCEjjvy2lk0CY2lzeteUl6cVmpPBGTOLuvr1SGXNt/P+RiBn8flQY8BCjWCsVDwqA mgLmo1l8GKSi6F7sD7Mb08a8xmW4Ir4aSid57AT8RSFZM95xdytnsqWtUgFCO6SYNus9 0HQk2s/jV7QirUEoWP6hcWQJY1KtusGkSwT01XqpeIlVfnOqJk85+L3RKeWWa3oUvG2G uvkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:arc-authentication-results; bh=ltmYFQ+tpQuccSU5x6rBcYNyO+uE+VAXat/DmXTm2I8=; b=F9FJeTUp+nIAiIF1Zw5zbDgCivu3UpcHNp+rPCpQ1Qdw5QPcS3Po2ux2hq/G7JktKg SGTtSrhUl2Gv3k3/TzeZVRwd+nAkWnQx8ZxjEitXRAc6UAJ6go7YOZiMAIuncBgjLlpy QjkEYS+OpTvQFgGGxmOTW+7AMiB4+NePFsdKLoGWnLCcILIo4Utmj4UTf3zz1LQhOFPq DQ7NmWmHTLOlLnmSBOGnoclaNgnNFcd8kKEybX0SY/VoaBtHteZRRhOHomPk4ZbCDqkS Lh3tFYah3dOAoZMuIo0z2SeX4LF1f/7aGFjzlTpRBE5EgZRue7dkXtu1QFCDlSKgb2GG 14tw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r2-v6si38394741pgq.157.2018.06.05.06.53.10; Tue, 05 Jun 2018 06:53:33 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751911AbeFENwg (ORCPT + 99 others); Tue, 5 Jun 2018 09:52:36 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:36078 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751745AbeFENwf (ORCPT ); Tue, 5 Jun 2018 09:52:35 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com [10.11.54.5]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id A4C1E40122B5; Tue, 5 Jun 2018 13:52:34 +0000 (UTC) Received: from gondolin (dhcp-192-222.str.redhat.com [10.33.192.222]) by smtp.corp.redhat.com (Postfix) with ESMTP id 948E16352A; Tue, 5 Jun 2018 13:52:33 +0000 (UTC) Date: Tue, 5 Jun 2018 15:52:31 +0200 From: Cornelia Huck To: Pierre Morel Cc: Pierre Morel , pasic@linux.vnet.ibm.com, bjsdjshi@linux.vnet.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org Subject: Re: [PATCH v2 01/10] vfio: ccw: Moving state change out of IRQ context Message-ID: <20180605155231.7d4d3f96.cohuck@redhat.com> In-Reply-To: <5330d3e5-4098-e936-de57-5f4cb2d8f564@linux.ibm.com> References: <1527243678-3140-1-git-send-email-pmorel@linux.vnet.ibm.com> <1527243678-3140-2-git-send-email-pmorel@linux.vnet.ibm.com> <20180604155231.42c139ac.cohuck@redhat.com> <5330d3e5-4098-e936-de57-5f4cb2d8f564@linux.ibm.com> Organization: Red Hat GmbH MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 05 Jun 2018 13:52:34 +0000 (UTC) X-Greylist: inspected by milter-greylist-4.5.16 (mx1.redhat.com [10.11.55.5]); Tue, 05 Jun 2018 13:52:34 +0000 (UTC) for IP:'10.11.54.5' DOMAIN:'int-mx05.intmail.prod.int.rdu2.redhat.com' HELO:'smtp.corp.redhat.com' FROM:'cohuck@redhat.com' RCPT:'' Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 5 Jun 2018 15:34:52 +0200 Pierre Morel wrote: > On 04/06/2018 15:52, Cornelia Huck wrote: > > On Fri, 25 May 2018 12:21:09 +0200 > > Pierre Morel wrote: > > > >> Let's move the state change from the IRQ routine to the > >> workqueue callback. > >> > >> Signed-off-by: Pierre Morel > >> --- > >> drivers/s390/cio/vfio_ccw_drv.c | 20 +++++++------------- > >> drivers/s390/cio/vfio_ccw_fsm.c | 14 ++++++++------ > >> 2 files changed, 15 insertions(+), 19 deletions(-) > > This causes a change in behaviour for devices in the notoper state. > > > > Now: > > - vfio_ccw_sch_irq is called > > This should not be done if the subchannel is not operational. > > > - via the state machine, disabling the subchannel is (re-)triggered > > I removed the fsm_disabled_irq() callback from VFIO_CCW_STATE_NOT_OPER > because the subchannel is not even initialized at that moment. > We have no reference to the subchannel. > > In the previous driver NOT_OPER and STANDBY were quite the same. > Now NOT_OPER means "we can not operate on this sub channel" > because we do not have it in a correct state (no ISC, no mediated device, > the probe is not finiched) > > Now STANDBY means we have the device ready but is disabled. > In this case the software infrastructure is ready and if an interrupt comes > (what should not happen) we will disable the subchannel again. > > > > > With your patch: > > - the work function is queued in any case; eventually, it will change > > the device's state to idle (unless we don't have an mdev at that > > point in time) > > - completion is signaled > > > > I'm not sure that's what we want. > > > > Yes it is queued in any case but the IRQ is really treated only if the > subchannel is in the right state (STANDBY, BUSY, IDLE and QUIESCING). > > In the NOT_OPER state we do not have the mdev not the driver initialized. But all of this is only true after the whole series has been applied, isn't it? Is there any way to do the changes without breaking things inbetween? What would also be very helpful is a sketch of the state machine after your rework is done. Otherwise, this leaves me a bit unsure about the intended semantics if I just look at the individual patches.