Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3521254pxf; Mon, 15 Mar 2021 11:24:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwCUK5JHm1G+qR8aLjMVAuV5LgZx1kh2DcDBZye74UubNRu48YqBZ6FMYGW+XK/ZfWsFdv2 X-Received: by 2002:a17:906:5597:: with SMTP id y23mr25512758ejp.165.1615832652533; Mon, 15 Mar 2021 11:24:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615832652; cv=none; d=google.com; s=arc-20160816; b=D3l2SD2zxfqOrz8xQaRHTweAeG3SuN9y2G1oOxzR5Y2UmxRDqF2GjpYHFBIlzGsueY v+5eaTlE3OdqFqx3iawm2jkIWURdAUK1hINgSqX8c8e3GeP5zMISYa2vPrFXNHPNTjR9 wYoWg4VosiMe699K9RnfTvquJOfCUi65dvphnt/H8euocZoJ0MkFnmR2VB95o1d0O7iK izsr7BjXKWXlnA7zIsvdjfYIyWhhZzyAw9JnZeUHao75LxmY4x+9Y9hf8ihcx4E1uzY3 xMAxByKu1amF+EZbpM6t/WzoQ9GzVRMZCBfteqoFTBgsn8hd7isWyAoybwz0zSk39p8k wUgw== 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=Kbm0Zey8MHTuy3lVyKERsHc3wycqbCPFbvpXs5Bz+4E=; b=G8hqx5R1+MEqw0juIwVPbt2Nw4gRM5Q3bNDg2VkwzX91J15HQOFtsdRRlnsxP8A0YP pGQTrrg/1JF5aGZ019AliHJ2TOrWAtU/+4La/6y/CAhpou6o8JYPqwI1OfNjGFpV8NJf 5jmnZJ0E93ldO3kiB3HWgYh1bS5YcW3gR+e9IbKQMOGP2xc5uVXf8MPQp16RabI8nNZ6 hqdthKOVD/hcA8p8W3zfG6vJj6J1Hl1H2x2d2XlBBhssXWQLKtOK+q9WGSIrkyjiGSua Qvhj+U8UqQlqcbQauA9rdEyEqxhqj4gC3h9XeVkdvV8NwVtM72ZKOxR+tNZdqPpXJdPL KypQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zoLD86b2; 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 gz11si11558637ejc.745.2021.03.15.11.23.50; Mon, 15 Mar 2021 11:24:12 -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=zoLD86b2; 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 S238615AbhCOOXb (ORCPT + 99 others); Mon, 15 Mar 2021 10:23:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:37476 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232875AbhCOOAE (ORCPT ); Mon, 15 Mar 2021 10:00:04 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 1DD3B61477; Mon, 15 Mar 2021 13:59:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816785; bh=ls/Kw0AxmQ04kBfbKoNboAsuPICaRMnN/G4moFqOlBY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zoLD86b2E55SjGp4pXwJhQw1vhFkiMZ5eynf/rDuRvDl0raakLorIsmjtxNo83c51 zQ4tGtA3DdoSzLcNU67j1pNJ0Bvv4vUT+sZdh6ysamEjQOHzWqPCwNLy+30dXYyaaX qHqVmY86WLW7yzmymMsbwxJG5J2Hg+snk1QZm/tQ= 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 4.19 066/120] s390/dasd: fix hanging DASD driver unbind Date: Mon, 15 Mar 2021 14:56:57 +0100 Message-Id: <20210315135722.132681825@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135720.002213995@linuxfoundation.org> References: <20210315135720.002213995@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 @@ -3426,8 +3426,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); @@ -3446,6 +3444,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);