Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3519917pxf; Mon, 15 Mar 2021 11:22:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzfrFhlPCH95PLEsi3WfV2X+FGPzqXNIloQQgFpuchCYGs2VVQy/OfhbwBimvf3GhZwF+1U X-Received: by 2002:a17:906:37db:: with SMTP id o27mr25628226ejc.60.1615832529548; Mon, 15 Mar 2021 11:22:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832529; cv=none; d=google.com; s=arc-20160816; b=CHlcS54hXCcpXSZ+sx0v/Yxv3zpeQWSqOY9ThUObW1/D5BMg2N87MvhcGtnaEc5LtH LLCDtRC37Kc2aluQyLJ+wzYm5QWVFMu21gy4gLdXI6Idb73BgLzmM/47Gy6C1+6eLbUU KOFkV5CQ0US0Dmqb4C9hj/6tUgdFKXMqSgxUi63KQqNjJ7HNo9tgS/4ufFLReDtQf3zG 4DPtHmp3KLfwc22DOrP8sYfY1tJc49dnXN7yQxqdoSlpMR5P8Cc3tKSHFAAiz/9X2ZLU 4Qae4e2xn7N+8rtHxt6DFqUWCbVkuBX1S4+Db1fGtgMXOVacwyeR1RjBnmThmfMibY5u MLvg== 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=SefzjjMC8RZZYtDpdVR7LeuI5dzfeWtzq3P/9nIQyaQGAiHZy67L9fFGb71qHY5Isi ILarN5nw5q+Xd8qV4/z7psb5kM5M5A9meMREtII8BG8BKDdSyq7WtdKDSYk4p5AJpE5j 7hquSa1UkkuiPoJ1posHmkUbWj0XfxvHusoKtzmqVriQxuZnll9F0se7W9+e9+Ch9bYg 4cGtKfMgspcbwUMb5J1fpMupTXtl0bXvqp2RMqWSENOlqN0ugxvmsj97xljopbw96zUp vhNPcmLx7zWsOQDLbVXDGcQ3BAY5KteSEWZ8yphBbR75/CdAJpy4qTd7NsgsjTtMWFvN xu6w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=cFWl8XWX; 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 gv29si2212771ejc.61.2021.03.15.11.21.46; Mon, 15 Mar 2021 11:22:09 -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=cFWl8XWX; 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 S232566AbhCOOTC (ORCPT + 99 others); Mon, 15 Mar 2021 10:19:02 -0400 Received: from mail.kernel.org ([198.145.29.99]:37582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232471AbhCON7v (ORCPT ); Mon, 15 Mar 2021 09:59:51 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id CC38464EF9; Mon, 15 Mar 2021 13:59:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816771; bh=wmSJzdMwCOzPUjx8SWQUQRJX27s79VJqdKjOsW4Yauo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cFWl8XWXDgLEcp8ku3QJUmOGkmzTGeVGMe3jn/bkubzjn1GPkqcEQTXiQp+vo7Gfo Em5r3i96nzH9yfGUteFiQvWkq3DmfV9X8racc6NxHRlS65jZ7+noZ1TeweVtU4ApW7 gW5z82GGnn5AcDZ8trhekwaS83JnSIBb0+nm44kM= 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.4 098/168] s390/dasd: fix hanging DASD driver unbind Date: Mon, 15 Mar 2021 14:55:30 +0100 Message-Id: <20210315135553.591815804@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135550.333963635@linuxfoundation.org> References: <20210315135550.333963635@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);