Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp3526538pxf; Mon, 15 Mar 2021 11:31:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6RG2KcEHaLgssgCTYIUPqvHogwrboRkmtO/XWf4nn2552YjWAuEK+2sZgnoc8Qcnw8+u6 X-Received: by 2002:a17:906:1d4e:: with SMTP id o14mr24258391ejh.549.1615833089590; Mon, 15 Mar 2021 11:31:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615833089; cv=none; d=google.com; s=arc-20160816; b=VJk7q5MloT0TaSXza60tdj2b3yXmYE7TaKQpERnxAGECbeoJFkz4B6ldNCWeYtr23g 4uav1aADaDfTa1e7U4byPAwy+nuTznMp80AGz7OUJ/zfOCIG4Vjfg2je2t8F0N5DWIfZ QkEiIraeJwJaJHWvK/I2X4EldCAnnljFU6XpFyMgrZh1ENY1IZAd/uo9ED28G5DU48oK m8iTRnDAxKrfkd2PsPzGx+k5sxoYtP+Iw54yUL80p4ee90nS0bqz5DoVitdn2lN8ZxlB 36aCSkdzdtP+06dhsbEO/qlViX2QBiq/6hvLWVD4Bj+hkR+PgDvFL1/cbvv6t7X3i7Gf L61g== 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=f+MMe20slvWPnhcfDWg7v4fxv9+0sDfXpw7fZIPcQ6E=; b=Y9z6VDJodZkaLVmxAOUBJCtV9BVzge2A1uLZESPCgnzlUOUcyjwopCcc0v99CuDjSi bD1zk+7D/AxLTGr5Q6kwUYK9/66iOGwTeR+lfezLwOWb0BOnBVjGrDSrqQXjI7y1BWfd z9xQ9alK54OUdVKJkUeD9iE0s87mBovqhJL062PmOBG1G7ynXBUZ+3LBIHHhl0HAY1m7 uNRSPGWwuAtRm2tQrgWC9+08TOR0eQpR01B40Ji1JfjQ6GqPW9SPl+N/6mYViPi4wEL0 Xa8GmTYEwfi69p5RoaDTvgl54HhCgpSmMCaxQA41/3xIty11vNZC1AWs6vhzoo+7OyQw GIzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=S8vmjVOq; 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 bq17si2354414ejb.391.2021.03.15.11.31.07; Mon, 15 Mar 2021 11:31:29 -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=S8vmjVOq; 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 S236224AbhCOOey (ORCPT + 99 others); Mon, 15 Mar 2021 10:34:54 -0400 Received: from mail.kernel.org ([198.145.29.99]:35446 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233445AbhCOOBl (ORCPT ); Mon, 15 Mar 2021 10:01:41 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id C894A64F09; Mon, 15 Mar 2021 14:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1615816887; bh=HwfoUwkM2PB78oIFD8naBa9xBGhLyz0OPLO278WVyXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=S8vmjVOqNQQcnZh+NsSJCH0CoN7iV5t9UJsRF9Di4gkurDLKHTEF/SA+NjlZpCCdQ vu9+tpy81Dr4jebW1c+ci7EOahvPk2zyT5qwkNyUj5XfqxK6yxPIUzP3ZorkObjzVn moc4mJqoV/fu4vcdMc3wopCc2hCW3iF06gTY4NIQ= 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.11 183/306] s390/dasd: fix hanging DASD driver unbind Date: Mon, 15 Mar 2021 14:54:06 +0100 Message-Id: <20210315135513.805070287@linuxfoundation.org> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210315135507.611436477@linuxfoundation.org> References: <20210315135507.611436477@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 @@ -3503,8 +3503,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); @@ -3523,6 +3521,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);