Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2352051imm; Mon, 28 May 2018 06:33:52 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrpdkl8PblGMvUSzc6PQhWamRqdD9C6PEW+5UbUUb9KA+yVaOHRtXIsTVdYTRJisfAON50H X-Received: by 2002:a62:ab10:: with SMTP id p16-v6mr13400532pff.211.1527514432467; Mon, 28 May 2018 06:33:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527514432; cv=none; d=google.com; s=arc-20160816; b=hqeq/+ui8SlN9yvsFsVr2rHvJRyFxuHHIewlISNIRWbQECfSPDH8eKPs58pGk1G3qQ 2i2lar0Um0jR1bM2Vm+doVBAhBWVczf2FVBoHSAz/GilXhyR7vcgaAyfBFL4+2MQGmy6 ZBanM8RnQfPApckmatkx3otefuDfNRGNfOHUGsV9b+XcPif77u1qmpdByNV7HSrPbQcp 5A5iKh9YIDe4Fw5UfO6nCr2NG3OW7EvhjQc5FI8NaO+pKKQh0q2Bwh6fUxfWXpQ89ZCi sacoRyNqli8mBpnI4rknv9SN2QhEbx9QWmiWjZcNPtPT2b01WcIgTRjSJ5txF5YXCLiJ MHLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=O5Vte1ue3wQtbGoipmC2ceMIxZ0TNRYIBnA/ctH+Vlg=; b=nbfruDPx/o7zUVryHx4iDCTN62bvCARy8YWqkCAYXlqqlN25jMEgP9nU7L/vhcHW31 W0mId6MNRGHwxztkqlmZO9XwawrnXMYgq48w6cZwqqdB2/Y6yHYbLsH5skBZ7HqGOFnV GLrKKrEIdZLLzxG2n5SfQXZ3f9nXkJ42KvYbStWLYoDX+m4adVz7Q4/W6Gm18qakQu0J ZR64s3RfLCg1T62Ar64V5ESqCYJrcClWf0MLgtFQmf8FOXRW8dmNveuWywSS+ZsIt8jx 1fkBMn/E0tp3T0EMsDklAJKP74IBTUGRBdeqRIG9YSwAWWmzGiggikS5xce+CAVl8uFx HO5g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=lL7C6xyp; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c5-v6si30589310pfm.119.2018.05.28.06.33.36; Mon, 28 May 2018 06:33:52 -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; dkim=pass header.i=@kernel.org header.s=default header.b=lL7C6xyp; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S939128AbeE1Ncy (ORCPT + 99 others); Mon, 28 May 2018 09:32:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:36690 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1163049AbeE1KqY (ORCPT ); Mon, 28 May 2018 06:46:24 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C625520660; Mon, 28 May 2018 10:46:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1527504384; bh=oTkYiZI+WOqHyY+ATuvgs7GIrjMhCdlA6MQItzmElAY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lL7C6xypxXZuyK3nXvWnW+lBuFR4TJLqc4y6hYCzNyUwdXtSj5HIGwRSv7Tjk6VbH pQV/V9Pk8B6AXXA3/UldIY2FBv4aDwamqLb0rkrXdT+59bAaplgXNdO2jq8S5WsOD/ dgP6H5IUnFHLwBkrXOvN5gU2wUpE6lvwUQWeIc30= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Sebastian Ott , Martin Schwidefsky , Sasha Levin Subject: [PATCH 4.14 119/496] s390/cio: fix return code after missing interrupt Date: Mon, 28 May 2018 11:58:24 +0200 Message-Id: <20180528100324.942261024@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180528100319.498712256@linuxfoundation.org> References: <20180528100319.498712256@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Ott [ Upstream commit 770b55c995d171f026a9efb85e71e3b1ea47b93d ] When a timeout occurs for users of ccw_device_start_timeout we will stop the IO and call the drivers int handler with the irb pointer set to ERR_PTR(-ETIMEDOUT). Sometimes however we'd set the irb pointer to ERR_PTR(-EIO) which is not intended. Just set the correct value in all codepaths. Reported-by: Julian Wiedmann Signed-off-by: Sebastian Ott Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/device_fsm.c | 6 ++++-- drivers/s390/cio/io_sch.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) --- a/drivers/s390/cio/device_fsm.c +++ b/drivers/s390/cio/device_fsm.c @@ -796,6 +796,7 @@ ccw_device_online_timeout(struct ccw_dev ccw_device_set_timeout(cdev, 0); cdev->private->iretry = 255; + cdev->private->async_kill_io_rc = -ETIMEDOUT; ret = ccw_device_cancel_halt_clear(cdev); if (ret == -EBUSY) { ccw_device_set_timeout(cdev, 3*HZ); @@ -872,7 +873,7 @@ ccw_device_killing_irq(struct ccw_device /* OK, i/o is dead now. Call interrupt handler. */ if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, - ERR_PTR(-EIO)); + ERR_PTR(cdev->private->async_kill_io_rc)); } static void @@ -889,7 +890,7 @@ ccw_device_killing_timeout(struct ccw_de ccw_device_online_verify(cdev, 0); if (cdev->handler) cdev->handler(cdev, cdev->private->intparm, - ERR_PTR(-EIO)); + ERR_PTR(cdev->private->async_kill_io_rc)); } void ccw_device_kill_io(struct ccw_device *cdev) @@ -897,6 +898,7 @@ void ccw_device_kill_io(struct ccw_devic int ret; cdev->private->iretry = 255; + cdev->private->async_kill_io_rc = -EIO; ret = ccw_device_cancel_halt_clear(cdev); if (ret == -EBUSY) { ccw_device_set_timeout(cdev, 3*HZ); --- a/drivers/s390/cio/io_sch.h +++ b/drivers/s390/cio/io_sch.h @@ -157,6 +157,7 @@ struct ccw_device_private { unsigned long intparm; /* user interruption parameter */ struct qdio_irq *qdio_data; struct irb irb; /* device status */ + int async_kill_io_rc; struct senseid senseid; /* SenseID info */ struct pgid pgid[8]; /* path group IDs per chpid*/ struct ccw1 iccws[2]; /* ccws for SNID/SID/SPGID commands */