Received: by 10.192.165.148 with SMTP id m20csp769814imm; Fri, 27 Apr 2018 07:15:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoO2yen5FY4tzoeVeyI5wwLJal1u4tZb9OvqonUvukmOXHvALJxUY9EQuGSvwrBt4PvSLXp X-Received: by 2002:a17:902:9042:: with SMTP id w2-v6mr2468207plz.34.1524838529371; Fri, 27 Apr 2018 07:15:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524838529; cv=none; d=google.com; s=arc-20160816; b=XjgKMT6kK7GbGJO3bjTDtv6rKrwQ8fvvI3kLm7DkWST2uiJhCkPNmWve9bFhxAjSA3 4pvmDRu7CVZTOS724zpTkaPbBxqgjgJCrMsdIWWY4rxEcFwggoR70eGZT2b0jJWm37Zi iydB0M9wfEmU0PuHXpMpnaHCF983/mX4pBcP/W8MBO9ebEq0RPwUtQv2KvuJGK6AsupV Hi6ReVoZlJJMCDjAvnyiT7ZlO8Ck8HvnxxCChqKDZXWIiQoaOXemqdEY6RbcTMbIpz0Y 6+x90XnC8P0v+nYLXfE+bjg+0mAJD2vLGpjTPVKqZSkDCB5M8vNfHh/cypZZ5SIeaUaF i2ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=ju5+gPW9d6+nFdr8SJZowVzTAVeF16B9a+z2+B8Cb7Q=; b=qYWBDkJk2i5Tg9gTdr986HpRquaAk39eoV72e45tT+uvQOj67G/SIfFtGLibqDG6hx Xievn0owj4ZOVyx/aaQ1fNJ6IKREzcazht0wmMS7qBGZodA/TaAd+6B4lsqMZ6cFrJeC Vy8M2xRZAdCTv2q93QXApx4GH8eAwsbBUY+5uzHbGoRS2ep/pbna5XXP7RJT74qxlIKc AcWQssnbPgOzFvDznczaplL8XiFC4dcueUqhF8e7J7dK64kqX1QSCMS+erh1MZbvDek2 2dd0XgpWwsMJAElDMpgwxbjOgz5UV00A0qlp56K1h/kbcisersPP38GXHs6cq/1lAmZF CLtA== 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 a87si1358011pfl.165.2018.04.27.07.15.15; Fri, 27 Apr 2018 07:15:29 -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 S935314AbeD0ONT (ORCPT + 99 others); Fri, 27 Apr 2018 10:13:19 -0400 Received: from mail.kernel.org ([198.145.29.99]:57566 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935277AbeD0ONP (ORCPT ); Fri, 27 Apr 2018 10:13:15 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (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 38E97218D9; Fri, 27 Apr 2018 14:13:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38E97218D9 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sebastian Ott , Peter Oberparleiter , Martin Schwidefsky Subject: [PATCH 4.16 76/81] s390/cio: update chpid descriptor after resource accessibility event Date: Fri, 27 Apr 2018 15:59:18 +0200 Message-Id: <20180427135747.661800713@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135743.216853156@linuxfoundation.org> References: <20180427135743.216853156@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.16-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sebastian Ott commit af2e460ade0b0180d0f3812ca4f4f59cc9597f3e upstream. Channel path descriptors have been seen as something stable (as long as the chpid is configured). Recent tests have shown that the descriptor can also be altered when the link state of a channel path changes. Thus it is necessary to update the descriptor during handling of resource accessibility events. Cc: Signed-off-by: Sebastian Ott Reviewed-by: Peter Oberparleiter Signed-off-by: Martin Schwidefsky Signed-off-by: Greg Kroah-Hartman --- drivers/s390/cio/chsc.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) --- a/drivers/s390/cio/chsc.c +++ b/drivers/s390/cio/chsc.c @@ -452,6 +452,7 @@ static void chsc_process_sei_link_incide static void chsc_process_sei_res_acc(struct chsc_sei_nt0_area *sei_area) { + struct channel_path *chp; struct chp_link link; struct chp_id chpid; int status; @@ -464,10 +465,17 @@ static void chsc_process_sei_res_acc(str chpid.id = sei_area->rsid; /* allocate a new channel path structure, if needed */ status = chp_get_status(chpid); - if (status < 0) - chp_new(chpid); - else if (!status) + if (!status) return; + + if (status < 0) { + chp_new(chpid); + } else { + chp = chpid_to_chp(chpid); + mutex_lock(&chp->lock); + chp_update_desc(chp); + mutex_unlock(&chp->lock); + } memset(&link, 0, sizeof(struct chp_link)); link.chpid = chpid; if ((sei_area->vf & 0xc0) != 0) {