Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3094634rwb; Mon, 15 Aug 2022 18:00:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR69EMxY+DPS2oWMkGq2nKv84kmnz7kEijxUqX/pEyVOqQf/QPjioDy5l1l+JM6VLceaHupe X-Received: by 2002:a05:6402:4382:b0:43d:6fce:3f1b with SMTP id o2-20020a056402438200b0043d6fce3f1bmr16989414edc.361.1660611610270; Mon, 15 Aug 2022 18:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611610; cv=none; d=google.com; s=arc-20160816; b=LImZmy/WdybHC4aG3K6YT2At2d0lqbViEWXQyrKn04f8rSglp1wQbUNv4GKr45kbsY mym+Q6YNTgOqOurPq/cWh9jJ5L0RYeEhc8beMo/yK30jfTIOnK3jX6Gw2a0V6qSxEm7v TJe2l1N0MX8KrwxdU3Vzg0fUSn98mGdUgIPh7w6mZXdAlLFshPq7yQQf/gXX7oV51sge /1rDJBq/IvhKZYFVoyuRVK3v+YZ4ad6gMuc2NaNPGPJWZ3dcLxj47wEeL6633DWBZ8aj ClthHTGOab9di49nS20eOUWrN31A4sZx4htrAj93Dte4RmxspFooxQL91DU5DJc0yHIA Z+Zg== 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=bqZZj5owJ9KiUBWyRByxZEoPE89XPcumkLUOulWsqGk=; b=uKwtER/v3nSoDCRvKCSqMTt32QJwGWNqxakwtiEGzWV7p0TVQG6I7tNtXO6CLgqQ7A ATMFzK0Mzz+4sDp+RPFMJKpYzzuKQ26BWjM+0WlX5GbGZR3MIQy18HpsxnHweezSG1s3 Mnm1juZYWDvWrKzHZiKwPW3sudXtyvdMsRylPSmto5GyCYSxcnHTAMDKIa0JLCn+iCFM 88aSGQNsNdS6CkCfMrTKc4+1NdU98w6qRn4LYlBKMKAiytNiOBuDx1pQRVCgfhs6lwmq QrqJaEgmtI1gZpMo8CjBfv5e3PQnsBjkYcvjQoQhNu+u/XzmEgR2sylUp3uG9HYFRbA/ DVfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=msK4nbt2; 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 d42-20020a056402402a00b00443cce19cb8si2909758eda.466.2022.08.15.17.59.38; Mon, 15 Aug 2022 18:00:10 -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=msK4nbt2; 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 S232933AbiHPAuK (ORCPT + 99 others); Mon, 15 Aug 2022 20:50:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56470 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347484AbiHPAp5 (ORCPT ); Mon, 15 Aug 2022 20:45: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 D997CE5; Mon, 15 Aug 2022 13:41:48 -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 75E036122B; Mon, 15 Aug 2022 20:41:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 64C0CC433D6; Mon, 15 Aug 2022 20:41:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596107; bh=md8+GWYFPKGVi2/kX05FH0NsAZLOJVJM6bdiWhxwVXU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=msK4nbt2NNezL5ZZjgVFVkfsAnNxIFMgqOzhTWBkfn40Pdr3wxgI0btYeK9B9L4Eb nmLa2nYx9THrgLulL4Awl6pbgbHViBpT7UhCTt3lIl5RJjUMXp+k8oY6Jvs+AMp7ij GNa1pKJe01XEpbxk1s5UttcNy0awDcFIm0wcCb7A= 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 5.19 0940/1157] vfio/ccw: Do not change FSM state in subchannel event Date: Mon, 15 Aug 2022 20:04:56 +0200 Message-Id: <20220815180517.126538019@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 179eb614fa5b..279ad2161f17 100644 --- a/drivers/s390/cio/vfio_ccw_drv.c +++ b/drivers/s390/cio/vfio_ccw_drv.c @@ -301,19 +301,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