Received: by 10.192.165.148 with SMTP id m20csp320850imm; Wed, 2 May 2018 00:26:34 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqdQu7BgsLoYOTYf/WW0fvM1GAx1m7ICN7qLBGcQF6ZTGkK/k25evoo8an5udDBxpgDmIq/ X-Received: by 2002:a65:4dc7:: with SMTP id q7-v6mr5479648pgt.48.1525245994396; Wed, 02 May 2018 00:26:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525245994; cv=none; d=google.com; s=arc-20160816; b=fwnQ1DDrf7YK0ELeVqrO+MIP7abFADrg1sBolaxwT6EmiMgD0VAOEK5haEa5TZOP7k DlOz+Ov2OgI22zjMQTQz73DsVsMUMmnMT7/CYV0NcGj2jCiwuGQU8sloUstatzD7Yazj B91a2UskvLZWh5akiSqyZNYv2OZD6s0ATOqL621zkZDcdyz3+x6MdHdxyjllDPCqKmQ8 EbbjoAFzuEzh5MIF9RREEXSAwS4pRHt0waXYckOlOaacloQG05Nl9WUd0RSDPX+Omcgl fQKYXlmhkPEemd+rLZiVsyMrOv0mnlz3kTw8K6ZcueHlADyEGrNJDqJX4LYqnDhyDI22 uomQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=GESVQuDNbzffGREKTB7Ajkl7ooIqzAphHTyO4ilDXMU=; b=vpFenQHzx6vC0NYV4gToO1yguHbSCIhbKr7svD6LywWBtvPlk/5XNOG5s6ByCBs+it u85/6JWeJ15/p0xykvKq0jv8osDwSkjBhlHjn87lqD50r0BT5tNs7gWQrHZVD6ndogcN 9wEzIm08JEhH1HUmAOL7GvvduoCzlsWomMdUaq5f1N7NjMEU2FHnBcbkEHFAb7GkzieD KzIIIqSdh5wurjsCqNCZIY6KdByt+Y2MFAJkDA1i/XJ32D1rTJCb4ebfbD75+rO2Pwav zM/c2kTP+fA066mETZgdSkSx3+qCECO6HGaPnyPRii5N7B8JpDwvXwGJ+2HZBR5/XAGT xUyA== 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 89si11064896pfs.362.2018.05.02.00.26.20; Wed, 02 May 2018 00:26:34 -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 S1751100AbeEBH0K (ORCPT + 99 others); Wed, 2 May 2018 03:26:10 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:34602 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750930AbeEBH0J (ORCPT ); Wed, 2 May 2018 03:26:09 -0400 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w427Pmm7038137 for ; Wed, 2 May 2018 03:26:08 -0400 Received: from e38.co.us.ibm.com (e38.co.us.ibm.com [32.97.110.159]) by mx0a-001b2d01.pphosted.com with ESMTP id 2hq84c9xe6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 02 May 2018 03:26:08 -0400 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 2 May 2018 01:26:07 -0600 Received: from b03cxnp08027.gho.boulder.ibm.com (9.17.130.19) by e38.co.us.ibm.com (192.168.1.138) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 2 May 2018 01:26:05 -0600 Received: from b03ledav002.gho.boulder.ibm.com (b03ledav002.gho.boulder.ibm.com [9.17.130.233]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w427Q3SS8651160; Wed, 2 May 2018 00:26:03 -0700 Received: from b03ledav002.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 90A3413603A; Wed, 2 May 2018 01:26:03 -0600 (MDT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by b03ledav002.gho.boulder.ibm.com (Postfix) with ESMTP id 04B29136040; Wed, 2 May 2018 01:26:01 -0600 (MDT) From: Dong Jia Shi To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org, kvm@vger.kernel.org Cc: cohuck@redhat.com, borntraeger@de.ibm.com, bjsdjshi@linux.ibm.com, pasic@linux.ibm.com, pmorel@linux.ibm.com, Dong Jia Shi Subject: [PATCH 1/1] vfio: ccw: fix error return in vfio_ccw_sch_event Date: Wed, 2 May 2018 09:25:59 +0200 X-Mailer: git-send-email 2.13.5 X-TM-AS-GCONF: 00 x-cbid: 18050207-0028-0000-0000-00000988D7DE X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008959; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000258; SDB=6.01026304; UDB=6.00524157; IPR=6.00805535; MB=3.00020891; MTD=3.00000008; XFM=3.00000015; UTC=2018-05-02 07:26:06 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18050207-0029-0000-0000-00003A9EDB03 Message-Id: <20180502072559.50691-1-bjsdjshi@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-05-02_03:,, 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 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1805020074 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If device has not been registered, or there is a pending work, we should reschedule a sch_event call again. Signed-off-by: Dong Jia Shi --- drivers/s390/cio/vfio_ccw_drv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c index ea6a2d0b2894..770fa9cfc310 100644 --- a/drivers/s390/cio/vfio_ccw_drv.c +++ b/drivers/s390/cio/vfio_ccw_drv.c @@ -177,6 +177,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) { struct vfio_ccw_private *private = dev_get_drvdata(&sch->dev); unsigned long flags; + int rc = -EAGAIN; spin_lock_irqsave(sch->lock, flags); if (!device_is_registered(&sch->dev)) @@ -187,6 +188,7 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) if (cio_update_schib(sch)) { vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); + rc = 0; goto out_unlock; } @@ -195,11 +197,12 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) private->state = private->mdev ? VFIO_CCW_STATE_IDLE : VFIO_CCW_STATE_STANDBY; } + rc = 0; out_unlock: spin_unlock_irqrestore(sch->lock, flags); - return 0; + return rc; } static struct css_device_id vfio_ccw_sch_ids[] = { -- 2.13.5