Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412810rwa; Tue, 23 Aug 2022 04:29:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR7W2Y71mxXBPkAtWU7vVvpGxKtZQPdpsO9p+CFSoT6ccxnkS0x8p/hVPjHLHQTCpVmZI34W X-Received: by 2002:a17:902:be16:b0:170:8ebf:204c with SMTP id r22-20020a170902be1600b001708ebf204cmr24656924pls.47.1661254144044; Tue, 23 Aug 2022 04:29:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254144; cv=none; d=google.com; s=arc-20160816; b=q7zZJWhYRZs3TjgIippKeF+z80st4cpAh0FcL9lOX/ujnT3w7lgdXAUb/x43Uz6SfU rEr6PMll9BEOmNA+cYPrjBzCVFIvBmUWuPr9kEdUKaLIwAFTmTbnjOqwFYTIlRRFYzKI tJCFVZPVkbMzUe9cxOCTw7m2VGGA0YrL2RBXnEkL4gPXTJnMteU9itwPzk/ywWm665oP n8Mu/8qUvQS5YOJHypnYlwzJVJsoKVC+1llGheJGR3DFsV4Is7VY1O8GOpcWwwQs133L YSGSTfpWP/WhbIYLpSuvMfURfecJWs5TwAloGWPUXB6iEzsX2OTCiDG48H1KaV4KZwMe qPSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=xJPzfkRqL/ctJqRf/fdq2RW8YxxGEFnnK/TH1vQrQik=; b=FbZphCTR9wI8xVsyozhsWMSy9FoxrkyjG9R7tD1BoYREXmE58c6S/jJuplQ6b+0+LP GDHyv8wdRyCMvs3uCTOXafiq0TilntaOXDdBoqkfBu0HnYGOHt4iN234EAXHIXHRyxwJ TmiB0cJDa22NniX+8BpIfma/ppL4DvbPxV0lnRrwRP7Cv1bvOAMCt6xLaFy6pn7sSdyK XX7eh3olrbzf2yyx168+fQAGGsupHDIRDrZ0zvjxCstOrNa902HR5LB9pjlRwsk2Nwyu yO62d2AIHASDFZtsRiCGBO+c/kmOzoC8zKjA298Xg+o/Duw8+Nswr9Q8WiftK2H+q3PW nLmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qi88/mNY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 198-20020a6300cf000000b0042a88f7b969si8888565pga.812.2022.08.23.04.28.53; Tue, 23 Aug 2022 04:29:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="qi88/mNY"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242111AbiHWJz1 (ORCPT + 99 others); Tue, 23 Aug 2022 05:55:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41876 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242379AbiHWJx5 (ORCPT ); Tue, 23 Aug 2022 05:53:57 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C8939F740; Tue, 23 Aug 2022 01:46:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 4A36B6155F; Tue, 23 Aug 2022 08:46:10 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3FA32C433C1; Tue, 23 Aug 2022 08:46:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244369; bh=TaPJ4kc6OvyZg5v07Qk2Re/qWXyqol4GpwkVdT9s3g8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qi88/mNYd76D474uq1KgZeyk1TdomcRnL2p+rnvl1oTzRWEtft2gdckcU8zunspl5 PUWMmDNzejdFtrjqn/l6zeBOvpGBTUqcNJKnvX8Zimu+AUClwtu/1IE790OcYH4gZ1 +a9GeknrZ+hz6cIvXIcVu/sdETuA0qK6nQ0/jVJE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Eric Farman , Matthew Rosato , Alex Williamson , Sasha Levin Subject: [PATCH 4.14 126/229] vfio/ccw: Do not change FSM state in subchannel event Date: Tue, 23 Aug 2022 10:24:47 +0200 Message-Id: <20220823080058.227731798@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Eric Farman [ Upstream commit cffcc109fd682075dee79bade3d60a07152a8fd1 ] The routine vfio_ccw_sch_event() is tasked with handling subchannel events, specifically machine checks, on behalf of vfio-ccw. It correctly calls cio_update_schib(), and if that fails (meaning the subchannel is gone) it makes an FSM event call to mark the subchannel Not Operational. If that worked, however, then it decides that if the FSM state was already Not Operational (implying the subchannel just came back), then it should simply change the FSM to partially- or fully-open. Remove this trickery, since a subchannel returning will require more probing than simply "oh all is well again" to ensure it works correctly. Fixes: bbe37e4cb8970 ("vfio: ccw: introduce a finite state machine") Signed-off-by: Eric Farman Reviewed-by: Matthew Rosato Link: https://lore.kernel.org/r/20220707135737.720765-4-farman@linux.ibm.com Signed-off-by: Alex Williamson Signed-off-by: Sasha Levin --- drivers/s390/cio/vfio_ccw_drv.c | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/drivers/s390/cio/vfio_ccw_drv.c b/drivers/s390/cio/vfio_ccw_drv.c index 6cd41086f23e..4b5cdbdcd843 100644 --- a/drivers/s390/cio/vfio_ccw_drv.c +++ b/drivers/s390/cio/vfio_ccw_drv.c @@ -193,19 +193,11 @@ static int vfio_ccw_sch_event(struct subchannel *sch, int process) if (work_pending(&sch->todo_work)) goto out_unlock; - if (cio_update_schib(sch)) { - vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); - rc = 0; - goto out_unlock; - } - - private = dev_get_drvdata(&sch->dev); - if (private->state == VFIO_CCW_STATE_NOT_OPER) { - private->state = private->mdev ? VFIO_CCW_STATE_IDLE : - VFIO_CCW_STATE_STANDBY; - } rc = 0; + if (cio_update_schib(sch)) + vfio_ccw_fsm_event(private, VFIO_CCW_EVENT_NOT_OPER); + out_unlock: spin_unlock_irqrestore(sch->lock, flags); -- 2.35.1