Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp922493imm; Tue, 5 Jun 2018 06:36:55 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLJ07TBcxIrtnsTtTmkd0g3G3PlTJCPHRuWADjguJ2XxgzI/1rrALAKpujgSKGb/svzf5Y8 X-Received: by 2002:a63:7405:: with SMTP id p5-v6mr20667731pgc.289.1528205815555; Tue, 05 Jun 2018 06:36:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528205815; cv=none; d=google.com; s=arc-20160816; b=b24zJIF8k9GalusmhGOPgA1FXcZmsBeyvOeW7wzSUqigBu7EVTVoqp1FC/aXiJgOoN qE0TZTntb/E2Ko/F9hFA3YYaRJKOM8TnkV4pLqPN0DtLr/ONOoZCapsfIQrWIDHPdX75 NgEozagu/KAPsJ7B0Wupo8h6WgmB8PT3xtToqb3Aa0966kR5auc5uyDi6Gld93m1K9yn GSGhcZN5GjRs3Va0vRKsBm388YAELP1YKa6R74CTfL6twEAdaBrIl5NfXeqfVQ9G/6ZB jzyU42pwF2nhjEDU0GUyxkBSoRJ2VfbgKmi+KMuDgD2ARAM1GcQRXwZlTVYye9Vh9tI9 EnzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :from:references:cc:to:subject:reply-to:arc-authentication-results; bh=w2tIWKKIzElGoPShQG2ZcR2IVuj3z8fJpcrXF7g0m4g=; b=DynI4BEx+7XKbBMUl8WGAR6NId5jRxXAPF6W5IMzsI8Gs4xXVoIziP6A5ZkzuhS19L jHc9r/deqfBsrPbmaP/xv9akOLaa4FeUZSX3mZfnkx/ev0jOwZtd28UUP21qYZDwGydJ 6jYXxX7qxiVynoayNDNDU/ksHuEqYRixLA4qK+OZ6w6j6ZoJ4eM9qiOFKfHA3fW9HwnR Y2Wv2X8GOta2lPE7kZdhAur+VN+01xd8MlOdnZhvgHMKo90mB8ILiydAzdnaP5sBKGkz trXVpWLBfDgiAJslWuIB6ezsQtHQvo0kg5eXq6eK2rVm7qiI1ar6gXLJO/n3LBP8Cq9m kOeA== 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=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c18-v6si49302084plo.185.2018.06.05.06.36.41; Tue, 05 Jun 2018 06:36:55 -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=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752035AbeFENfG (ORCPT + 99 others); Tue, 5 Jun 2018 09:35:06 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:57548 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751822AbeFENfF (ORCPT ); Tue, 5 Jun 2018 09:35:05 -0400 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w55DYLJI124760 for ; Tue, 5 Jun 2018 09:35:05 -0400 Received: from e06smtp03.uk.ibm.com (e06smtp03.uk.ibm.com [195.75.94.99]) by mx0b-001b2d01.pphosted.com with ESMTP id 2jdu6bsqs5-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 05 Jun 2018 09:35:02 -0400 Received: from localhost by e06smtp03.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 5 Jun 2018 14:34:55 +0100 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp03.uk.ibm.com (192.168.101.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 5 Jun 2018 14:34:53 +0100 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w55DYqsd28573824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 5 Jun 2018 13:34:52 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B55B452047; Tue, 5 Jun 2018 13:24:32 +0100 (BST) Received: from [9.152.224.33] (unknown [9.152.224.33]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 6EDFF52043; Tue, 5 Jun 2018 13:24:32 +0100 (BST) Reply-To: pmorel@linux.ibm.com Subject: Re: [PATCH v2 01/10] vfio: ccw: Moving state change out of IRQ context To: Cornelia Huck , Pierre Morel Cc: pasic@linux.vnet.ibm.com, bjsdjshi@linux.vnet.ibm.com, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org 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> From: Pierre Morel Date: Tue, 5 Jun 2018 15:34:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 MIME-Version: 1.0 In-Reply-To: <20180604155231.42c139ac.cohuck@redhat.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-TM-AS-GCONF: 00 x-cbid: 18060513-0012-0000-0000-0000027B6119 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18060513-0013-0000-0000-000020AC6657 Message-Id: <5330d3e5-4098-e936-de57-5f4cb2d8f564@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-05_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=882 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1805220000 definitions=main-1806050157 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. -- Pierre Morel Linux/KVM/QEMU in Böblingen - Germany