Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 78057C2D0DB for ; Fri, 31 Jan 2020 16:51:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 5585020663 for ; Fri, 31 Jan 2020 16:51:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5585020663 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id EC9696E9CF; Fri, 31 Jan 2020 16:51:19 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88C436E9D3 for ; Fri, 31 Jan 2020 16:51:19 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 31 Jan 2020 08:51:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,386,1574150400"; d="scan'208";a="310049305" Received: from irvmail001.ir.intel.com ([163.33.26.43]) by orsmga001.jf.intel.com with ESMTP; 31 Jan 2020 08:51:17 -0800 Received: from mwajdecz-mobl1.ger.corp.intel.com (mwajdecz-mobl1.ger.corp.intel.com [172.28.174.138]) by irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id 00VGpGVg029486; Fri, 31 Jan 2020 16:51:16 GMT To: intel-gfx@lists.freedesktop.org, "Chris Wilson" References: <20200131145834.77756-1-michal.wajdeczko@intel.com> <158048483501.2430.4544818151209295353@skylake-alporthouse-com> Date: Fri, 31 Jan 2020 17:51:16 +0100 MIME-Version: 1.0 From: "Michal Wajdeczko" Message-ID: In-Reply-To: <158048483501.2430.4544818151209295353@skylake-alporthouse-com> User-Agent: Opera Mail/1.0 (Win32) Subject: Re: [Intel-gfx] [PATCH] drm/i915/guc: Stop using mutex while sending CTB messages X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed"; DelSp="yes" Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" On Fri, 31 Jan 2020 16:33:55 +0100, Chris Wilson wrote: > Quoting Michal Wajdeczko (2020-01-31 14:58:34) >> While we are always using CT "send" buffer to send request messages >> to GuC, we usually don't ask GuC to use CT "receive" buffer to send >> back response messages, since almost all returned data can fit into >> reserved bits in status dword inside CT descriptor. However, relying >> on data modifications inside CT descriptor requires use of mutex to >> allow only single CT request in flight, until we read back that status >> dword from the CT descriptor. > > Q. do we need the same lock for ct_read() and ct_write()? No. And additionally I missed that ct_read() was already implicitly locked with gt->irq_lock by gen11_gt_irq_handler and with i915->irq_lock by guc_enable_communication() - need to fix that too ;( > > Could ct_read() use a lock-free ringbuffer, and then if I've read it > right, you wouldn't have any overlapping spinlock between the interrupt > handler and the rest (thus avoiding the interrupt-off). Not sure if can go lock-free with two callers, will look for gt->irq_lock _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/intel-gfx