Received: by 2002:ac0:a874:0:0:0:0:0 with SMTP id c49csp270741ima; Fri, 15 Mar 2019 02:27:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqz1qzfWnassr8mZvgGbFD/tsmQJ/+0phyaiE2zYZv6Z2bitAxFKlkESt8KMgbvZCFk6EaKM X-Received: by 2002:a17:902:28e6:: with SMTP id f93mr3209178plb.264.1552642024432; Fri, 15 Mar 2019 02:27:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1552642024; cv=none; d=google.com; s=arc-20160816; b=p8hdPKGJpGgMxV70WTuhFJvRBYSkuBw0xsjK6VTNfytfqOY6/f7MAmCQ02bv+9hN7I A+w8XMQVnSLLjqUOeT9Tq+QuLmPU0UE+i/4OAdjTOoMVWfLertE9RC8oGrs1j4UNz9L/ auuUxAvRGcmLmuND4jSp4bndTQiHMZsaN8C+SZgvP5Y4SymZKR0BShLAb+iBVz6GRk9l 4GoDPxLXuaRD3O10ahOgjUKtTAOSmHa95zHUyL43wxpxoN4y1HdAskFZit/J5SC2BlWV 8BEX3RqhMhb9VAb+zX97D2ZtCRarKpQX4wpts9H0grleawhKzEfqNTUy+uiiXOWP6PpG qajA== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=rQdZ5gMTmgRW87sui8cTVUjQfnuSBZPL/HI2lxsWwHc=; b=EeCUplMU+Gr9Eky42P6PYRi0XtPtMTSxsOV9hjly8n3iFjWBUcv+ASJznBz/JnT5Pw Ehac6aA2IpaZuJfhSPuuXHHeJEqHEGBwDd8APkBStsqwIldWIV48dbpWrQI0TaSyA+cY evrocaHrcFAXa5osNSUkok14AX56Y3I0NDZyCtPL4frv1Ff2R/z/v0cgHlCyYyZTDKBa m/dhYosGvLiJZr/TWJKWIrbQWh1jETIP8JQlh8Z0IFXUGGMWjHtAyUx7HTW6wJ8nSMUC jZg3UkKWLUPcFwEe9uliWRjU3ppRq2b7/Miblf50Qg2Do8t5CsVnrenk8Pf1/BPZXpY6 QSmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ozLNfJmD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si1346021pgr.191.2019.03.15.02.26.48; Fri, 15 Mar 2019 02:27:04 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ozLNfJmD; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728721AbfCOJX6 (ORCPT + 99 others); Fri, 15 Mar 2019 05:23:58 -0400 Received: from mail-lf1-f67.google.com ([209.85.167.67]:46582 "EHLO mail-lf1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbfCOJX5 (ORCPT ); Fri, 15 Mar 2019 05:23:57 -0400 Received: by mail-lf1-f67.google.com with SMTP id a132so4898580lfa.13; Fri, 15 Mar 2019 02:23:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rQdZ5gMTmgRW87sui8cTVUjQfnuSBZPL/HI2lxsWwHc=; b=ozLNfJmDpEH0Dou4wey1btd4QCwR/4QLznqqOpNqaRzvpT6iicgiZhCoEXIbtgcCrR j4mYYV85HXZU4EHsTo/GBdxZhkLpXDVjTRNS8F2/i7QK+9SWWC+ucbP4rogFyR5deeYw sPRmJA8W9mv9xrnkH1et27C16pBSTCRXjSWdHQM7/TAytObRYJ+EVLPF8DrVElZHr/sI CCe+hOns9g7q573Hzp8HFUzLpHsfq7I7CPlWOXUI/8X3RhCnwMFRwzAtkYGtKAMVYsdc vv7mpAdno46XzjE8fE5THO6/UZHeWLxaWFHmjjr16DGXUK4tXRr0LLkq/mc4UER+5I+i Ak4Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=rQdZ5gMTmgRW87sui8cTVUjQfnuSBZPL/HI2lxsWwHc=; b=e/AHefI74hpHAOTx5XxkRpodFh2BV4Nqwm5U0xNtQK9ne826mDW0N1QVu9reKVaCCo OK4OxA0mBm3sf8UkaVTPOKVYrjNVEgKiS5ChjbJrQyh4M969A8/rsNFHPyuBW3x5DP91 39hXkbG1o44Bqllqz3JWvzVzmYS8sXGRqAoaAXRZ50Ujp6Y50XDjjP1NJ81yg9IgbCgq LpM4ETh6Ku8kZdfwv+a04yYxuk48ytfRlwIScULoBpk2+Qd+WSuJlFm4girj4E2OiEvo tUXnX7hNUNabBnP5rTaYQxCIYCBx0zNuIjaJdliYoKVIawchGoDiG/m0fwt2lB9Fd+3P +MrQ== X-Gm-Message-State: APjAAAUTKYNV2a7yTOqNTCyZHuefiMlVBe3T/Fwut39PNZpgHo1PJKCL btJp6ko/edq1TqS+p0Q6b8o= X-Received: by 2002:a19:f51a:: with SMTP id j26mr1512860lfb.5.1552641835147; Fri, 15 Mar 2019 02:23:55 -0700 (PDT) Received: from a2k-HP-ProDesk-600-G2-SFF.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id j1sm327493lfk.26.2019.03.15.02.23.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Mar 2019 02:23:54 -0700 (PDT) From: Oleksandr Andrushchenko To: xen-devel@lists.xenproject.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com, jgross@suse.com, boris.ostrovsky@oracle.com Cc: andr2000@gmail.com, Volodymyr_Babchuk@epam.com, Oleksandr Andrushchenko Subject: [Xen-devel][PATCH] Input: xen-kbdfront - signal the backend that we disconnect Date: Fri, 15 Mar 2019 11:23:48 +0200 Message-Id: <20190315092348.32613-1-andr2000@gmail.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Oleksandr Andrushchenko While disconnecting from the backend we clean up shared resources (event channel, ring buffer), but never let the backend know about that. This may lead to inconsistent backend state and/or shared resources use. Fix this by explicitly letting the backend know that frontend has destroyed shared resources by changing its Xen bus state accordingly. Signed-off-by: Oleksandr Andrushchenko --- drivers/input/misc/xen-kbdfront.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/misc/xen-kbdfront.c b/drivers/input/misc/xen-kbdfront.c index 24bc5c5d876f..ecb6e719e0e2 100644 --- a/drivers/input/misc/xen-kbdfront.c +++ b/drivers/input/misc/xen-kbdfront.c @@ -488,6 +488,8 @@ static int xenkbd_connect_backend(struct xenbus_device *dev, static void xenkbd_disconnect_backend(struct xenkbd_info *info) { + xenbus_switch_state(info->xbdev, XenbusStateClosing); + if (info->irq >= 0) unbind_from_irqhandler(info->irq, info); info->irq = -1; -- 2.21.0