Received: by 10.223.185.116 with SMTP id b49csp781007wrg; Fri, 23 Feb 2018 06:45:14 -0800 (PST) X-Google-Smtp-Source: AH8x225pKrFspdxMbE6rQB1dr4JGYxDzg02Kpk22esd2QdKkDQLI/kQ9tNfEqFyST+5G1w8FrIns X-Received: by 2002:a17:902:bc3:: with SMTP id 61-v6mr1914623plr.407.1519397113962; Fri, 23 Feb 2018 06:45:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519397113; cv=none; d=google.com; s=arc-20160816; b=xSDAQnTIHm3YXWeoJrS5fbCuXckFuGIzQbajbO1T2PxmoXgaT/7HzpWpRNkeC+MUof oLPsbV1hG4ASBsImvsggdtcFmc5JGXbvLBr8tS1NSbmleYUjnmUAOhmVDUlk2Nbe8SJ2 3Ej6ENG/+UZl2LatOEb85CGAS0YncSvtNxTfSgHcn0k5zGlLiy9mX/BBZFQuhyh/7u+v IupSoykq6XNHHblsDNHYaML9N7e8w7qKM8CgV+QAmrpQdsdsPv6cDey/rPMA5ndgWmc5 LZvcQ4QMpZjdVL/xYVRO/JtRzoUPf+joRnp2t7sMZ2D4wVQw1L2j5/NIOJN3sSj2XbCT c/tw== 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=5AP1TO3Z9mBDLsNXXPiVUJhmcF2y03d65VU8ldB33YM=; b=FSeJmZsvirgz6ZCVsk0LsoRuY1EW1VMqc1KHxZ5i7qsYE6DNksFXzw3KvXWJxT6tY9 ZOpdzgOMboS49HjC+firaM9w7Wcr5neLG5tI+hqctJXEnnQ6en2oIQ1bHQ0X0EupzMbZ t8CyiliZ+GIhtNOfpKOGwVjiMpPDjQCgegdONa8ivt4Km/nd8HxcmZBaI0pg3yaujhL4 rKRHBghZ7pBoXSKhbEDUSJ14Pq1JvxZTBHuOk8RAlo0JDAExup5jZpYFtCZ941lGWQXV GcSCGbiYaV2033TAx/nLzBC46+tp6KvPHwWeCcBiFaJHfjbLG+TVbAHM4or305vOCWPQ aLhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2017-10-26 header.b=jv0Cjes0; 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=NONE dis=NONE) header.from=oracle.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q2si1590992pgc.727.2018.02.23.06.44.59; Fri, 23 Feb 2018 06:45:13 -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=@oracle.com header.s=corp-2017-10-26 header.b=jv0Cjes0; 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=NONE dis=NONE) header.from=oracle.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751497AbeBWOoW (ORCPT + 99 others); Fri, 23 Feb 2018 09:44:22 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:39630 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751332AbeBWOoU (ORCPT ); Fri, 23 Feb 2018 09:44:20 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w1NEg9Zk033284; Fri, 23 Feb 2018 14:44:08 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : to : cc : references : from : message-id : date : mime-version : in-reply-to : content-type : content-transfer-encoding; s=corp-2017-10-26; bh=5AP1TO3Z9mBDLsNXXPiVUJhmcF2y03d65VU8ldB33YM=; b=jv0Cjes0SMofa7NxEwvsx0Ex4GBzWU3oCbmUEFbd+kogYrPXenyRhh/1+QnmwjkothvT 8Bs4sVyCqYZC7xXBvxBEDol4K0KCvy+q0zm2ex2I0MywlU98xnsH9wZBUD/f+xT2Ne09 xX02d4KEV7wRZZO5TpPKW6GyvQA+KMqEajPaATcAajGL/FBiw8Ch/N7vGQy8G+zHwdWC A6XISZrYS8nAXgGo9gT3n0M2V/UPHIsEVJVe2Est3Sd7CPb4+sqg5AD5uDo2dDVLRhCv oprZ2ze04Ph09l2emqp3IQhiJzE8fUKAmtasHdGbY6rh/eio63Bqkml6Ei0oOiDt3pB9 ag== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2gamj2g789-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 23 Feb 2018 14:44:08 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id w1NEi7or025856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 23 Feb 2018 14:44:07 GMT Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id w1NEi5Ce007817; Fri, 23 Feb 2018 14:44:05 GMT Received: from dhcp-burlington7-2nd-B-east-10-152-55-162.usdhcp.oraclecorp.com (/10.152.32.65) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 23 Feb 2018 06:44:05 -0800 Subject: Re: [PATCH 4/9] drm/xen-front: Implement Xen event channel handling To: Oleksandr Andrushchenko , 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> From: Boris Ostrovsky Message-ID: <7d8ab151-e90d-baef-93b6-8ca1c7e42908@oracle.com> Date: Fri, 23 Feb 2018 09:44:43 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: <5145287f-40b0-c8e2-1b37-36d7e8cac908@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-Language: en-US X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=8812 signatures=668677 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=998 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1711220000 definitions=main-1802230184 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(). -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