Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp444970ybb; Fri, 10 Apr 2020 03:20:14 -0700 (PDT) X-Google-Smtp-Source: APiQypLmddio4Zpbmu63ACb2IHxEDlQOwAhpITdlU7CUDdfM13hB59SoJyGneAtTSUYde9hNS+iJ X-Received: by 2002:a37:cc7:: with SMTP id 190mr1162253qkm.44.1586514014768; Fri, 10 Apr 2020 03:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586514014; cv=none; d=google.com; s=arc-20160816; b=MiCSVb8hWbeXBltuPnuxfM29VBiFeDykMbx2czFhR5kJAR6Y2IAuMLgcIucQMOyj72 H/oMtK8BvvwQiJqW2xuYqK1bPKpRxIpXLP7K8r8anoU/b8VOEt/a7BIufg+iCqWUuIch TBzV4w27bJtB2tKGo3fNlnYSfrgTYQmgVyPFbI0zjWJ4gJkzzjE/eTlOgJOZoix8EXil iRHIfne72lTaH6D3iAzwdH271uvA5GykfWeta9rmJRoZdINbuzWA92d/TLlk3qwc0iTJ 2+6A4WC9162X52dHJqnkAND6L1hU8S3fJX8WvlZSVlWhz1XBsdC55H00pBXitJ5vPXnV 8jeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=85J/ceHgXM5nOGiJyEHWgB+3Iv0WcdOn6tYSjyCB+10=; b=lg1HEykSYU8MB/k+iaf9qUOTBvy4i+4cWgZiaqEWP19wYAuLQosFGtwd68OlZh9e7q F+DdHpXCUo08ocZi+2L3AqUSE3F808Kk06alzqCz5Ij9aeuIWxSw581W3E/fvhhBBttB N1d3IzUNyrPxYtgi73aUK0AtjR70yRWHLzySv9tINam16OlqFVWZ0djd186LYP+dAQX4 Nr34B0AC66lTVFLqzZp0ON5T05dJZQqypHOde1lhh+LGEfmqN9yKPn0FG5H94HvGILTi OOT6X8vGfpEqNLt5MPekCNZf6xIrDMMVju0kgbVlLi73pXDr74DVTseD2YvfrE9G80cT y0Ug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y2si843784qvl.169.2020.04.10.03.19.59; Fri, 10 Apr 2020 03:20:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726651AbgDJKTR (ORCPT + 99 others); Fri, 10 Apr 2020 06:19:17 -0400 Received: from wtarreau.pck.nerim.net ([62.212.114.60]:34484 "EHLO 1wt.eu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725955AbgDJKTR (ORCPT ); Fri, 10 Apr 2020 06:19:17 -0400 Received: (from willy@localhost) by pcw.home.local (8.15.2/8.15.2/Submit) id 03AAJ8WW014694; Fri, 10 Apr 2020 12:19:08 +0200 From: Willy Tarreau To: Denis Efremov Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Willy Tarreau Subject: [PATCH 25/23] floppy: make sure to reset all FDCs upon resume() Date: Fri, 10 Apr 2020 12:19:02 +0200 Message-Id: <20200410101904.14652-1-w@1wt.eu> X-Mailer: git-send-email 2.9.0 In-Reply-To: <20200331094054.24441-23-w@1wt.eu> References: <20200331094054.24441-23-w@1wt.eu> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In floppy_resume() we don't properly reinitialize all FDCs, instead we reinitialize the current FDC once per available FDC because value -1 is passed to user_reset_fdc(). Let's simply save the current drive and properly reinitialize each FDC. Signed-off-by: Willy Tarreau --- drivers/block/floppy.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c index 8da7921659f1..b102f55dfa5d 100644 --- a/drivers/block/floppy.c +++ b/drivers/block/floppy.c @@ -4545,11 +4545,13 @@ static void floppy_device_release(struct device *dev) static int floppy_resume(struct device *dev) { int fdc; + int saved_drive; + saved_drive = current_drive; for (fdc = 0; fdc < N_FDC; fdc++) if (fdc_state[fdc].address != -1) - user_reset_fdc(-1, FD_RESET_ALWAYS, false); - + user_reset_fdc(REVDRIVE(fdc, 0), FD_RESET_ALWAYS, false); + set_fdc(saved_drive); return 0; } -- 2.20.1