Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3529121pxf; Mon, 15 Mar 2021 11:34:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwqKPOzO0RszSBJl3PQHdKRJWsIkptwMFANPQxgKYHkcO9ovTxzXXE6tvHnbCFAp4/fGwjH X-Received: by 2002:a17:907:9808:: with SMTP id ji8mr25305693ejc.333.1615833299672; Mon, 15 Mar 2021 11:34:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833299; cv=none; d=google.com; s=arc-20160816; b=THqnjXixK6xAIkmECwSuBnAk/Z8qllw7/EFXrRkcQpDNY/lPopg+9MxZmZFTmLnbtl sb61qexLI16APfhRG7nBr2DsdW8TSZcf54p3v/pp1EPKDbmPIb53LeZzmEmFu4KeA9Z6 72RJO9/hcdocaVOJJkoDTw8WSeDSBYZ0Wu2p4fyFe4SA5EOBVnjmMEFsxpGsqAkocx0r 0yrTSVZqukAPiaD5Wv8XS5mK/Io6HllxlDRAeDN/h1dQMMk8DwnMdi5xiefcdSrjwyK2 /3VPLSoFBrkGRR5T8eX8gKF7ZZKNSvSDIwW4qR3MQLNFDDMqlnMdiBxUylnxWfRZ6h7R bPRg== 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=EH1LpUeElHCpOdj7UBe8ljQhmbSt4gAQx+prGaO9pZM=; b=r+nsY5M13FoPp//I+eQbv3u2DTUEARPMNB1UXojsjMmE9Fp/FCozhXKGpPsFfc7CQl oZO2jEzkls63XlkWrNoSy9fbQZfYzmdAcjyuGw6uOBaRiqS6P/0lqG3Mzz+YhmWvSETt qmX0quMuhYnpqeAiYG5aKkb66UK/yhobB40rY2TriTKXAFDJHaM/eHGPknmtQ8wet+JA bPTLsgQDqI7BN9rmk8k8HDi5HH9GW65HmGd8MYYFkYxcTaCu4v/PVTu2OTkLwiAoRk+k tIc9c6+ab1xIWAJaXfs3JytyjP2EEnZyE8a56oG1g7kA2mYZUeupKoZZxtrOiZ/PfQ0u BGcA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gC23MDig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx5si11507204edb.555.2021.03.15.11.34.37; Mon, 15 Mar 2021 11:34:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gC23MDig; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S240570AbhCOOrw (ORCPT + 99 others); Mon, 15 Mar 2021 10:47:52 -0400 Received: from mail.kernel.org ([198.145.29.99]:48918 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233644AbhCOOCP (ORCPT ); Mon, 15 Mar 2021 10:02:15 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 8FB3464F00; Mon, 15 Mar 2021 14:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816922; bh=wmSJzdMwCOzPUjx8SWQUQRJX27s79VJqdKjOsW4Yauo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gC23MDigiwfyI9vkVDBivU53u5iLF8eiUQ1cPkhTBBy+qnH3VUO+d3s48jGdf45lX 4EMFG+uUq0SE8yxa9gquDkUAYB6dhfBh+zhx2z27OvH2AWbNwwMjD0hCJgVg+D2VYc BT50YEUp/ngGJ/2YO99jCoYlGGsHHNTazRehLEw8= From: gregkh@linuxfoundation.org To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Stefan Haberland , Bjoern Walk , Jan Hoeppner , Jens Axboe Subject: [PATCH 5.10 189/290] s390/dasd: fix hanging DASD driver unbind Date: Mon, 15 Mar 2021 14:54:42 +0100 Message-Id: <20210315135548.305196173@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135541.921894249@linuxfoundation.org> References: <20210315135541.921894249@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Greg Kroah-Hartman From: Stefan Haberland commit 7d365bd0bff3c0310c39ebaffc9a8458e036d666 upstream. In case of an unbind of the DASD device driver the function dasd_generic_remove() is called which shuts down the device. Among others this functions removes the int_handler from the cdev. During shutdown the device cancels all outstanding IO requests and waits for completion of the clear request. Unfortunately the clear interrupt will never be received when there is no interrupt handler connected. Fix by moving the int_handler removal after the call to the state machine where no request or interrupt is outstanding. Cc: stable@vger.kernel.org Signed-off-by: Stefan Haberland Tested-by: Bjoern Walk Reviewed-by: Jan Hoeppner Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- drivers/s390/block/dasd.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) --- a/drivers/s390/block/dasd.c +++ b/drivers/s390/block/dasd.c @@ -3522,8 +3522,6 @@ void dasd_generic_remove(struct ccw_devi struct dasd_device *device; struct dasd_block *block; - cdev->handler = NULL; - device = dasd_device_from_cdev(cdev); if (IS_ERR(device)) { dasd_remove_sysfs_files(cdev); @@ -3542,6 +3540,7 @@ void dasd_generic_remove(struct ccw_devi * no quite down yet. */ dasd_set_target_state(device, DASD_STATE_NEW); + cdev->handler = NULL; /* dasd_delete_device destroys the device reference. */ block = device->block; dasd_delete_device(device);