Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3312014pxf; Mon, 15 Mar 2021 06:56:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzjIWmpZ4P89wTAWoCZ41dzn0VWY54+fp8wd9ok5PBjBhE/9g+5u3iLh2dXNnoNbNa7thWN X-Received: by 2002:a17:907:7249:: with SMTP id ds9mr24189374ejc.9.1615816616226; Mon, 15 Mar 2021 06:56:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615816616; cv=none; d=google.com; s=arc-20160816; b=wUeofBFwD4uN5aOa1gjTVrn2tTWvV48l1H40u7Nh79gkxQ25hPJ08ad5/vEpN0ULrL owGcj7LvSBtRM3xv6odjyvgCT2dmOeGTmxa2rJha/wapVQ+x2ibJF3bPMwHgJoKw3yF1 BTpOYReM3B4Ab5/wpEiWqvLMvxxppw1TdLV/rx3zw/WDGmq81b+4/YxmmLXUM+bO/ONl hK+WziTfoDPj17w/6XoPtsIpjQsl1T1OXVVg+NDc9ECfwfhwlA5snVakXtoBimpP97Xf J+h+KMoPrhXa7ws964c+ktkb2JNGjAwDyJyFfsI9piLM6c/JDopthfPoxWbdzBhQ0Dt8 H04A== 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=OoXcdVcE5QhmFT7zdooCiAgB27ieTy7ENPdk7dhPDNY=; b=hSiDL1pUiJfgNNWnBnfnM6jjfIMQq1PurhbV3WtvGqFM6tVi/sCO4D+l7C/UJkSAvM U8Eu3n+t09QXXJ3DBB1ErGjzbnpcIwp7ayzAuaq7rNi1ul+CRGGfEEBCgDie9SdpS44g og6yQZg2IyIwCYug8kRMqnHBcmml4j9nKZhT3XS6WoD9co8Puad6CL3ePZSqTPmhetsz nbQ8D5dwbyIjodrPU8Y2Lp1Uqy7nBcKjwaSb2wPJw131HErulWVhuITfE6hsQYSNMwF6 Qc1n/PmlfWeDH0rmauoGFdpPNAhz5UlqpEYf+JhnbC9eju/Et9OlLmuppGYai5ldGRiS U1Aw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lkmREle+; 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 l12si11125495ejn.151.2021.03.15.06.56.33; Mon, 15 Mar 2021 06:56:56 -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=lkmREle+; 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 S231737AbhCONzg (ORCPT + 99 others); Mon, 15 Mar 2021 09:55:36 -0400 Received: from mail.kernel.org ([198.145.29.99]:56470 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230438AbhCONxk (ORCPT ); Mon, 15 Mar 2021 09:53:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 53BE964F09; Mon, 15 Mar 2021 13:53:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816420; bh=T8deVsoflrBrjDVkIa3NOKgs6WFSLpGXqZYchHTwFmY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=lkmREle+itj3JeoG78cqZmUcaQHVLYqNIFkrz2G+eWq5n+rZY5aMKu2MNDN1tKbQy /92ZVdKza/8QZwBHROo2YldFk80sIelaooXiUG3ksJb8VoeBw0B8Uf9FJ25qK9jZ/k YEE801a2kUdqPsxnLOARM7q6ka/quoxzqsDC4E7Q= 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.9 28/78] s390/dasd: fix hanging DASD driver unbind Date: Mon, 15 Mar 2021 14:51:51 +0100 Message-Id: <20210315135212.991503020@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135212.060847074@linuxfoundation.org> References: <20210315135212.060847074@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 @@ -3399,8 +3399,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); @@ -3419,6 +3417,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);