Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1774783ybl; Sat, 11 Jan 2020 02:33:46 -0800 (PST) X-Google-Smtp-Source: APXvYqzmbEMsA0UAKHxZZmgcighWn/QtkAkMJZSkJ0u/J6ebhOq+qkLOaLbTSwK9hdXHmN1lA6sV X-Received: by 2002:aca:5658:: with SMTP id k85mr5517133oib.153.1578738826468; Sat, 11 Jan 2020 02:33:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578738826; cv=none; d=google.com; s=arc-20160816; b=jXjt9diqWWofYwggCQRlNiD+o/e8r5Ihy/RPQ4vuH7JtTt2HezIGUl67OY6LNcYWxT P+4Dy1FL+7luW7yE+84pR9KYjlVcSsvycK/E98lu+p63BiCQ5huArxIhNfXpKioU3lDL gd1G5y2u/XtcLI4WSC+ZxjA5Ocjq77xWvDFI66Jx5KkgPSGK42M3D5mv+cymsFvKi0SB npdQ6nu71UewO61grxRYyeiNoW24FJw+s4a+wl4Wc/fwFuz7SPk6pb+1LwJ7qeI2eVSr Q8YZr1mggOD+MHqq1ct9SnPe/3xztf8QDA9eNbj/PbVIx2XuG+wG3e1cr78s6sADT3en GiTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=nNNuBJTASk7H2owrwlhQBGdL6ZdFD4KeHmWVX9Cbkj0=; b=zowP8EqGomX/hsErkGWj1TBzT3IzAeYuB06e57rNrnbvel2QxzOmJ1PaEmv5Zv5yUn U57tw9vYEx4LYpUtQ9kR4+gMOb3oYce8OxIi36V34DhH+W6g0YmixEP0S10EBhCLJXq6 NT1xph7dLWQwbdY5GnvMf5cGjxKZ9PeUpZ2bG/2u71T9MEoQp5aMhu+bIVqeMSEpe1Dn CvPndILaSygnsVAEe29M+imGhARHpOzbRjsS2nD+TymCYGGRlyM46g24bBBy3WwsIbPw y2Yg8gZ8cQT0m/a+w8kYTJ6zWrxhGcuTa2my27ycvYx74VSJol+K9QxP0NInRbRSL8Nl 96aQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=NqWNuU1V; 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 p26si3453069oto.240.2020.01.11.02.33.35; Sat, 11 Jan 2020 02:33:46 -0800 (PST) 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; dkim=pass header.i=@kernel.org header.s=default header.b=NqWNuU1V; 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 S1731550AbgAKKck (ORCPT + 99 others); Sat, 11 Jan 2020 05:32:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:46050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729368AbgAKKcj (ORCPT ); Sat, 11 Jan 2020 05:32:39 -0500 Received: from localhost (unknown [62.119.166.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D94B420678; Sat, 11 Jan 2020 10:32:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1578738759; bh=h+DilfU6kHt1krojOEu3ChpQZDWEHIBDgWHhAtRI0Zk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=NqWNuU1VfXrz8HKzWzMbWBoC+NpkAHctKYraldhD69C9wYc8WWUIkMS7wLNMhGwyi 8z7PhYtF8g9AN18rXC/5U+4jmMKvXNtyYEn18RnQ7d9qLIrPoPlggPMXGv9iAn7oLH CtsaMuNxVmQ3/3PUuVqjuA+03Um7Q7VAkOXSfX8U= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Julian Wiedmann , Alexandra Winter , "David S. Miller" , Sasha Levin Subject: [PATCH 5.4 132/165] s390/qeth: fix promiscuous mode after reset Date: Sat, 11 Jan 2020 10:50:51 +0100 Message-Id: <20200111094936.280389825@linuxfoundation.org> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200111094921.347491861@linuxfoundation.org> References: <20200111094921.347491861@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Julian Wiedmann [ Upstream commit 0f399305cd31e5c813086eaa264f7f47e205c10e ] When managing the promiscuous mode during an RX modeset, qeth caches the current HW state to avoid repeated programming of the same state on each modeset. But while tearing down a device, we forget to clear the cached state. So when the device is later set online again, the initial RX modeset doesn't program the promiscuous mode since we believe it is already enabled. Fix this by clearing the cached state in the tear-down path. Note that for the SBP variant of promiscuous mode, this accidentally works right now because we unconditionally restore the SBP role while re-initializing. Fixes: 4a71df50047f ("qeth: new qeth device driver") Signed-off-by: Julian Wiedmann Reviewed-by: Alexandra Winter Signed-off-by: David S. Miller Signed-off-by: Sasha Levin --- drivers/s390/net/qeth_l2_main.c | 1 + drivers/s390/net/qeth_l2_sys.c | 3 ++- drivers/s390/net/qeth_l3_main.c | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/s390/net/qeth_l2_main.c b/drivers/s390/net/qeth_l2_main.c index 4bccdce19b5a..8b7d911dccd8 100644 --- a/drivers/s390/net/qeth_l2_main.c +++ b/drivers/s390/net/qeth_l2_main.c @@ -295,6 +295,7 @@ static void qeth_l2_stop_card(struct qeth_card *card) flush_workqueue(card->event_wq); card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; + card->info.promisc_mode = 0; } static int qeth_l2_process_inbound_buffer(struct qeth_card *card, diff --git a/drivers/s390/net/qeth_l2_sys.c b/drivers/s390/net/qeth_l2_sys.c index e2bcb26105a3..fc7101ad84de 100644 --- a/drivers/s390/net/qeth_l2_sys.c +++ b/drivers/s390/net/qeth_l2_sys.c @@ -279,7 +279,8 @@ void qeth_l2_setup_bridgeport_attrs(struct qeth_card *card) return; mutex_lock(&card->sbp_lock); - if (card->options.sbp.role != QETH_SBP_ROLE_NONE) { + if (!card->options.sbp.reflect_promisc && + card->options.sbp.role != QETH_SBP_ROLE_NONE) { /* Conditional to avoid spurious error messages */ qeth_bridgeport_setrole(card, card->options.sbp.role); /* Let the callback function refresh the stored role value. */ diff --git a/drivers/s390/net/qeth_l3_main.c b/drivers/s390/net/qeth_l3_main.c index d7bfc7a0e4c0..32385327539b 100644 --- a/drivers/s390/net/qeth_l3_main.c +++ b/drivers/s390/net/qeth_l3_main.c @@ -1433,6 +1433,7 @@ static void qeth_l3_stop_card(struct qeth_card *card) } flush_workqueue(card->event_wq); + card->info.promisc_mode = 0; } static void qeth_l3_set_promisc_mode(struct qeth_card *card) -- 2.20.1