Received: by 2002:a05:7412:31a9:b0:e2:908c:2ebd with SMTP id et41csp4023388rdb; Thu, 14 Sep 2023 09:28:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEm1BDcIoQ7XFrqESnypZN3CG10DouTzHIkYWpyyS2JXJwHXcswd/3R/BCcj/HYpXTe4QhU X-Received: by 2002:a17:903:1c5:b0:1c1:fbec:bc3f with SMTP id e5-20020a17090301c500b001c1fbecbc3fmr6683677plh.5.1694708893505; Thu, 14 Sep 2023 09:28:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1694708893; cv=none; d=google.com; s=arc-20160816; b=vMgzngcVWuRhF66sqhPiA/PgbMTl++MZDoGP6yF78F4WwSADkXkI4L8E6mflxKCXCc Mr1dRqHTX+hayZQ/+LkHkW2zhQw24xXKrxK1d9qyyDFqiLcuoKHU4gCqCXpPlV5sJRTQ fd54EJcbYp9IDB5jSi5mxiLUbHJsZ6H3sKyTCOtbkN2KvYi0IE/1E5jXrgvbE5BmmUz4 CLpwzweTykF2v0SUUecg403gsFdi5GwVLScQ7U4kcAFG5r2sEvIEqZBV068oF7E7ZJ7U 6IW6LAt/zjgkNq9QclHs8wmNjoVexA9obhtFBlph8WXvJWU4xnabMnmp35dHdgqBrJkF ZWHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Ah2DuFSUG0amNgLBGsgpWVtI7auE8M0+YpJtbXeoFX8=; fh=B+J1MS5o3/6jIdmS+pCzvhJxENgTNeLh0z+ACx6CbFw=; b=sA4IwQ2h1YC+0oAAYku679JBU/QuAsF1a1RYRwoP5SNm97jQ++X4yF7se+meRmetpf zs3zer3RqI1Ov8sACWOSPYEKngUIXPOBNDxeYbYIsaYtM92hYep081w/WUaqOS70XVAh WnaQgTUgGtXZiJFKuXmvWaixNFQtmOvLFKNcZCUfjxCcYrKY+k7umL5vQuLb85zxmwqm byLnKKMWaiqzQ6qEWJQ25a6OpmoTyAb7qpkvXYh5VIbJXGxsdjwEKgdGim2sGWhO9zi+ BVz4P78RdNFcxeCWt/2EDmBBtgy+czmpfkWNi1nMekdgBuRda4eXGFytrrzfUCOMuJfS 245g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id kg4-20020a170903060400b001c1e1fe16c7si1842851plb.236.2023.09.14.09.28.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Sep 2023 09:28:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 83BFB801BC92; Wed, 13 Sep 2023 23:33:49 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235215AbjINGdu (ORCPT + 99 others); Thu, 14 Sep 2023 02:33:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232856AbjINGdt (ORCPT ); Thu, 14 Sep 2023 02:33:49 -0400 Received: from www262.sakura.ne.jp (www262.sakura.ne.jp [202.181.97.72]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A44C1BB for ; Wed, 13 Sep 2023 23:33:45 -0700 (PDT) Received: from fsav113.sakura.ne.jp (fsav113.sakura.ne.jp [27.133.134.240]) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTP id 38E6Xhrr082763; Thu, 14 Sep 2023 15:33:43 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Received: from www262.sakura.ne.jp (202.181.97.72) by fsav113.sakura.ne.jp (F-Secure/fsigk_smtp/550/fsav113.sakura.ne.jp); Thu, 14 Sep 2023 15:33:43 +0900 (JST) X-Virus-Status: clean(F-Secure/fsigk_smtp/550/fsav113.sakura.ne.jp) Received: from [192.168.1.6] (M106072142033.v4.enabler.ne.jp [106.72.142.33]) (authenticated bits=0) by www262.sakura.ne.jp (8.15.2/8.15.2) with ESMTPSA id 38E6XhTd082760 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NO); Thu, 14 Sep 2023 15:33:43 +0900 (JST) (envelope-from penguin-kernel@I-love.SAKURA.ne.jp) Message-ID: <167ee2ad-6a7e-876c-f5c9-f0a227070a78@I-love.SAKURA.ne.jp> Date: Thu, 14 Sep 2023 15:33:41 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.15.0 Subject: Re: drm/vkms: deadlock between dev->event_lock and timer Content-Language: en-US To: Maira Canal , Arthur Grillo Cc: Rodrigo Siqueira , Melissa Wen , Haneen Mohammed , Daniel Vetter , David Airlie , DRI , syzkaller@googlegroups.com, LKML , Hillf Danton , Sanan Hasanov , Thomas Gleixner , Linus Torvalds References: <20230913110709.6684-1-hdanton@sina.com> <99d99007-8385-31df-a659-665bf50193bc@I-love.SAKURA.ne.jp> <87pm2lzsqi.ffs@tglx> From: Tetsuo Handa In-Reply-To: <87pm2lzsqi.ffs@tglx> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Sep 2023 23:33:49 -0700 (PDT) On 2023/09/14 6:08, Thomas Gleixner wrote: > Maybe the VKMS people need to understand locking in the first place. The > first thing I saw in this code is: > > static enum hrtimer_restart vkms_vblank_simulate(struct hrtimer *timer) > { > ... > mutex_unlock(&output->enabled_lock); > > What? > > Unlocking a mutex in the context of a hrtimer callback is simply > violating all mutex locking rules. > > How has this code ever survived lock debugging without triggering a big > fat warning? Commit a0e6a017ab56936c ("drm/vkms: Fix race-condition between the hrtimer and the atomic commit") in 6.6-rc1 replaced spinlock with mutex. So we haven't tested with the lock debugging yet... MaĆ­ra and Arthur, mutex_unlock() from interrupt context is not permitted. Please revert that patch immediately. I guess that a semaphore (down()/up()) could be used instead of a mutex.