Received: by 10.223.185.116 with SMTP id b49csp787113wrg; Fri, 23 Feb 2018 06:51:05 -0800 (PST) X-Google-Smtp-Source: AH8x224PB+VUEC8VQGqQOBJDbWEtWTcdKDBFxHktDmtU5HvFObYGbOIQqzJFJ8s8OyeEQc2tnWIl X-Received: by 10.98.105.9 with SMTP id e9mr2029183pfc.226.1519397465606; Fri, 23 Feb 2018 06:51:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519397465; cv=none; d=google.com; s=arc-20160816; b=nxpo+oof1IHllgOwBsuWF0iMC7R5m4j5Z0ftjt964XhrbawYyCSPfRa9DP3w73PltH x0xNYwB5z2oB6joElAW0uQauut6FQlYHEalyNbswpBbgUHEAbJFJs54w4jwOZ7mHggVL rXeygI4sTt04VGkF/sa5K/aBlaCeL5mTnSwEsMiWch/EncIW4/F3fMlLhP7nt+4cqOSS hMvC9puUJUyeIbBY72erpvHe1SxVOeBY1m3rshEUhGCqMZfnUcNGNqnGNHjVxaVD5pG4 Pj36nkCgMJgnlNKWkFqtUWTOE45aKMVn+hbLR4yTCusr8mz1iDNC6f89DJJgWweFLUdc 5mNA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=G4EG+GrJ0o/dZAikwzwQj2iJmHntHyjXrqBE3mMBdGA=; b=gdVExA46p7K18c7t4uv5jGoep6o/fBENZkdkjv3r8fpjCgRJAYIxBnMQOwJz21Okqn od8J5z7oLHd0GTPvp3DOK+vlETgME/pQadh1AI69Vh/Fi5RVv9uXpEIAfSc1kGJq4Wds 0Ky3qL1L44sUqBz/MGHXOxzvBgkSe5ACHD5TGsxnXZnEoHNRyNal94KjegdcB6m9eemd LFaKDxpFsU5loVDBrOBh19u1jfPcm3MlD/kugaIF4/xIs9CLF2iUajM+J2ocAD+cOMT8 80UwV3uV6IeokalwgVE1Z17+ZFhGZzVAv4VoIbdJ3+i3WqHW6+BuJwspUzJ0wHcOckjE U7sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c88yT6dj; 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 o61-v6si1873418pld.692.2018.02.23.06.50.50; Fri, 23 Feb 2018 06:51:05 -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=@gmail.com header.s=20161025 header.b=c88yT6dj; 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 S1751623AbeBWOtv (ORCPT + 99 others); Fri, 23 Feb 2018 09:49:51 -0500 Received: from mail-lf0-f45.google.com ([209.85.215.45]:40943 "EHLO mail-lf0-f45.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751406AbeBWOtt (ORCPT ); Fri, 23 Feb 2018 09:49:49 -0500 Received: by mail-lf0-f45.google.com with SMTP id 37so12703552lfs.7 for ; Fri, 23 Feb 2018 06:49:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=G4EG+GrJ0o/dZAikwzwQj2iJmHntHyjXrqBE3mMBdGA=; b=c88yT6dj+Jr8KJqzch/cHTfRmCWuhHZlslXgYyotlW2FG0UnUAPoPpLr2we+KnQaJI YH1cfhxNBOYZi/qyigR4vSYIymQmNxZSr9tr874vRl+/+qMDi5YtLIBbs73+RE5/nCaG 3VDcAzT5AuCsAx09MKqz6Zp/4gdK0VkOGSWuotoE5b4JsLkyiuemldLSGLQY43bowIoA WmuNUZ89LmrH7WI4upzqWoWwfBs7iWGxreoxr59Gs3mCznz0Neq8gopTHXdU8+PNA16n GpgB47ckcpogZCRzNkyoLs19WulN1HoOVhWN0upbKuZ4nbjAtR9+nDgZj3o1p82VruBc PMZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=G4EG+GrJ0o/dZAikwzwQj2iJmHntHyjXrqBE3mMBdGA=; b=qgOSl5OKlfitAprjUqGHEqO3cO1TUBM0aEthx3CjbjCiA0A94Yl2rCSz97+ACLVX1O mT5GkItc5cJuSKcieWRbSyysFI3DXth6ngeksYbVknIy2uvdtiZ1e8Z5OER0jf+cZJC4 OF2BCUcd03AfLUhC7DkXLXu7Dj58D8ArmlEV7gmzgqMdKq/QQpUjmTvBB78dqo+bV0RS RqqltNGseHp514CAqHqOm4n1JCwQUiMg7eSNhjWSWGJ2x5QQz2YCbRmZseMU+5reevQQ iC1FGh3XmawakhAJw+rrDkJO+Ld/g0wTH/tBslU2noUli5WSQ2vyZc4JU/ti3gMM2k5x 5Kwg== X-Gm-Message-State: APf1xPDffx6uqnDgHo7VJpdt2urdwPUHLMbKWrxITtjTUA13U3wsCGmr GMVxILNiCi/YOO56xIvywrk= X-Received: by 10.46.42.67 with SMTP id q64mr1588335ljq.133.1519397388369; Fri, 23 Feb 2018 06:49:48 -0800 (PST) Received: from [10.17.182.9] (ll-53.209.223.85.sovam.net.ua. [85.223.209.53]) by smtp.gmail.com with ESMTPSA id s5sm257964lfb.78.2018.02.23.06.49.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 23 Feb 2018 06:49:47 -0800 (PST) Subject: Re: [PATCH 4/9] drm/xen-front: Implement Xen event channel handling To: Boris Ostrovsky , xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, airlied@linux.ie, daniel.vetter@intel.com, seanpaul@chromium.org, gustavo@padovan.org, jgross@suse.com, konrad.wilk@oracle.com Cc: Oleksandr Andrushchenko References: <1519200222-20623-1-git-send-email-andr2000@gmail.com> <1519200222-20623-5-git-send-email-andr2000@gmail.com> <395cdaef-db7e-139c-bbf1-28cb33f41f58@oracle.com> <5145287f-40b0-c8e2-1b37-36d7e8cac908@gmail.com> <7d8ab151-e90d-baef-93b6-8ca1c7e42908@oracle.com> From: Oleksandr Andrushchenko Message-ID: <63c64a2f-211e-2f62-21e7-289f0cc69df0@gmail.com> Date: Fri, 23 Feb 2018 16:49:46 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <7d8ab151-e90d-baef-93b6-8ca1c7e42908@oracle.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 02/23/2018 04:44 PM, Boris Ostrovsky wrote: > On 02/23/2018 02:00 AM, Oleksandr Andrushchenko wrote: >> On 02/23/2018 01:50 AM, Boris Ostrovsky wrote: >>> On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote: >>>> + >>>> +static irqreturn_t evtchnl_interrupt_ctrl(int irq, void *dev_id) >>>> +{ >>>> + struct xen_drm_front_evtchnl *evtchnl = dev_id; >>>> + struct xen_drm_front_info *front_info = evtchnl->front_info; >>>> + struct xendispl_resp *resp; >>>> + RING_IDX i, rp; >>>> + unsigned long flags; >>>> + >>>> + spin_lock_irqsave(&front_info->io_lock, flags); >>>> + >>>> + if (unlikely(evtchnl->state != EVTCHNL_STATE_CONNECTED)) >>>> + goto out; >>> Do you need to check the state under lock? (in other routines too). >> not really, will move out of the lock in interrupt handlers >> other places (I assume you refer to be_stream_do_io) > > I was mostly referring to evtchnl_interrupt_evt(). ah, then we are on the same page: I will move the check in interrupt handlers > -boris > > >> it is set under lock as a part of atomic operation, e.g. >> we get a new request pointer from the ring and reset completion >> So, those places still seem to be ok