Received: by 2002:ab2:6857:0:b0:1ef:ffd0:ce49 with SMTP id l23csp1763689lqp; Sat, 23 Mar 2024 07:53:08 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWDG+CQeoHNIMxZv1sS7mPGXfWnMd7BKqNHRR1gYkKjWc4yKIjz5s8JMQAmG9Gmczofwz2bPWrWRllO+ySFdG0FkWCeWaNxkLs6Omy9yQ== X-Google-Smtp-Source: AGHT+IF/yW85/LdYigMU0nyKc6xRPb5HUxNhBNzORRBvMQHbvOGMu2O28aQrfkzVMdV9hYvb44Vs X-Received: by 2002:a17:903:245:b0:1e0:9c35:e059 with SMTP id j5-20020a170903024500b001e09c35e059mr2784202plh.20.1711205588358; Sat, 23 Mar 2024 07:53:08 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711205588; cv=pass; d=google.com; s=arc-20160816; b=nVclCQ3ZmKaL5Ow6xVp/NauyrsCH/AoATG9lXRE6wLhqKSz5Fw/5viHxG5G2+c1ghE rPGXQhMDzotNC9P7GDxQbZSC5AVy9Q6WxNi84GgApkwd0ToOaAU6MYw5ELScgbmPFQIO ptInUz4gnaoKBBMR5ysREapc2hfz33192oMaBh7J3XJh0vgLhjb0nOwnAs5ApuCBn4V+ ui8PeqSVaccLbIs8qySVybRAwbUnADvAvj8jYQwtx5AahsBPSDcmp2LVdMCz8zy1Tq5y zW558HDiFslvG7CO8lOTWnGrsQUIFwgaqAF07FnVTlEWLa5pOIZzSUMQQx1FgueBamZM fpQw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PQy0LgbNRS2IUlbgbrbirFDizWSucGasGxIZDrnu8QQ=; fh=K7ZScOtYru6nXuTl7tS0WrYomoMNAG8/V5PrF2336k8=; b=wqjh3Be6RSZoXG1jZ23SJQaOhVPpYN6jUCKpY718SJUWa6zrK4YO19p1kyR6rgCRmh kkfy5XEOYDxHqu7LzuuBOrYob7upg19ZiUfN9WAyBRCvSy/UWNjjCOv7y7KlWXLpNxd0 DJJHU93nr/3qXfovCTaSBwZWup/cut5bzoe99T4x2AhfEKmgbQOtAZQnhJGrfud6jOe2 Y6JFNdhreHedOcSUvC2ju+iFVMIBYI3ssbi2b5UnSe/ID0xOEEd3SG5/vFGZChm0LDJT m1J9xQge/uqvhONo3LgqJQIIZxyj+g90GzxyuymSrxluDhsmsu32xecrNYPRQhAG0p7Q rZNw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=lOMuTTG6; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-112384-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112384-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id s14-20020a170902b18e00b001e0a1e6195asi1644242plr.498.2024.03.23.07.53.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 07:53:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-112384-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20230601.gappssmtp.com header.s=20230601 header.b=lOMuTTG6; arc=pass (i=1 spf=pass spfdomain=cmpxchg.org dkim=pass dkdomain=cmpxchg-org.20230601.gappssmtp.com dmarc=pass fromdomain=cmpxchg.org); spf=pass (google.com: domain of linux-kernel+bounces-112384-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-112384-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 0BA072820A3 for ; Sat, 23 Mar 2024 14:53:08 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 688133D96B; Sat, 23 Mar 2024 14:53:02 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b="lOMuTTG6" Received: from mail-qv1-f41.google.com (mail-qv1-f41.google.com [209.85.219.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 702F117583 for ; Sat, 23 Mar 2024 14:52:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.41 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711205581; cv=none; b=EZWcHdmzj+m0mzmOvDeapUSBcLnGgRuahcqIWQajcP5DXNym+/NTk4Lr96QrensxQNngmGPeG32PvZypruAJLR1tG3Jf63uVGr+vuE+su51/o7LFM48mKO1L4n/w+BxeUGYSR7jtFBocGGrq0LprNw/r0EIaiqZx0kweUwLq9gE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711205581; c=relaxed/simple; bh=lrtfH3zzzgl6lWeZpSHoMuGg8Ea02QXDs7/AlYdtTQk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=G/vgjSmVIpvb//VVUyudovd7QZfA0eUDTsq7QNEbBRcYX3HDsLXQ4ioOD8bpJEoLnJEkWzoXNDxCOaiZek2JcuyB7PkavnOwORDakLK8SwBDVYB4viJtx50SdqnJloZAcSiJ9jGUxcMqYfZRFOZQqFqBwS8XmFZP0qhLb+oEUKI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org; spf=pass smtp.mailfrom=cmpxchg.org; dkim=pass (2048-bit key) header.d=cmpxchg-org.20230601.gappssmtp.com header.i=@cmpxchg-org.20230601.gappssmtp.com header.b=lOMuTTG6; arc=none smtp.client-ip=209.85.219.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=cmpxchg.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=cmpxchg.org Received: by mail-qv1-f41.google.com with SMTP id 6a1803df08f44-690bd329df2so17011496d6.2 for ; Sat, 23 Mar 2024 07:52:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20230601.gappssmtp.com; s=20230601; t=1711205577; x=1711810377; darn=vger.kernel.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=PQy0LgbNRS2IUlbgbrbirFDizWSucGasGxIZDrnu8QQ=; b=lOMuTTG6K7f7ge/8wwyZGpCFSIdzCOivAV/HH/fMFoiXDKA6jAgpaI+qFTTQuuzXzb /U37cSD4ok3+GwlCT2gKixqBOgML4AeQUmKz0xpuHJt4buCYB4kwwNw3d5YJEU8RVNrK odluiA1ArOBRgV5485e3qjFOPk6NZKEGPYBxuY/k2LPtEQWHZmXC5LLn/ZVutsuNMCu3 DQu7f2s5RuefWmqy7j3jKwUAQaHrGIIwgLOs/kdMs6Acx7uPVLNcjbHCacxLk1abeuTO +UxG6ub+yZ15Xe++FMa7Me2tIwxHCUApPwh626IoysVmqtvqwvWZ2Nuw1DB2pZB05xYZ C+Xg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711205577; x=1711810377; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PQy0LgbNRS2IUlbgbrbirFDizWSucGasGxIZDrnu8QQ=; b=dLf9MPXkBVPomgwOKThJSDHg8idlX6gf7fkOEIHudsJRGzCDFMAsHH2HIYxv4vFtSO jvPihJWF4OKZy2ldMs4Svuo4sCNUkBr1PCpjm3LtLj4kndR5rzg2EGZ69NSnbbRi+beR 4aKQCojqLScfEJSUfxALVISliXJpbHmujaEP8EZET8vZl2G6mAiDkmyG20s5k8ify8PV lkRF8X+bgts9y6zV/Dbulc1/P73YpHja38CAsYZNx+tdiFvJwQyrMpCSk3jJSEMiXFBH Y2Inx9kn0vjyBhOpQfNuIGU9ez+Oh1prUkjyYv5jJla0Gb90xweJwV9IxCyH72g5XkWA p/qQ== X-Forwarded-Encrypted: i=1; AJvYcCU8n7Zg4UQFM5p3D213WApmaJgq+bYQH2Q4O4wm8F5pe430HRMAUXbnVgHgdTd9T8rZFD3LKnZxs5+i7eWIlVmDpmM1i8iKVjkS1zbk X-Gm-Message-State: AOJu0YwlWaVpFTHpynR6wAAk6nrCJVfRpE5sWRqnMSVPW7K8m6b8aCP1 qwWM93AsIuspbAg0MgvbaqRuD4H6c3zT9yalr4brNa8vl0UFT/CqY2LoM8l8+M8= X-Received: by 2002:a05:6214:4017:b0:696:8505:1947 with SMTP id kd23-20020a056214401700b0069685051947mr20765qvb.30.1711205577232; Sat, 23 Mar 2024 07:52:57 -0700 (PDT) Received: from localhost ([2620:10d:c091:400::5:16be]) by smtp.gmail.com with ESMTPSA id q1-20020a05621419e100b006968077890csm298604qvc.118.2024.03.23.07.52.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 23 Mar 2024 07:52:56 -0700 (PDT) Date: Sat, 23 Mar 2024 10:52:47 -0400 From: Johannes Weiner To: Christian =?iso-8859-1?Q?K=F6nig?= Cc: Alex Deucher , "Sharma, Shashank" , Christian =?iso-8859-1?Q?K=F6nig?= , amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drm/amdgpu: fix deadlock while reading mqd from debugfs Message-ID: <20240323145247.GC448621@cmpxchg.org> References: <20240307221609.7651-1-hannes@cmpxchg.org> <20240314170948.GA581298@cmpxchg.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240314170948.GA581298@cmpxchg.org> On Thu, Mar 14, 2024 at 01:09:57PM -0400, Johannes Weiner wrote: > Hello, > > On Fri, Mar 08, 2024 at 12:32:33PM +0100, Christian K?nig wrote: > > Am 07.03.24 um 23:07 schrieb Johannes Weiner: > > > Lastly I went with an open loop instead of a memcpy() as I wasn't > > > sure if that memory is safe to address a byte at at time. > > Shashank pointed out to me in private that byte access would indeed be > safe. However, after actually trying it it won't work because memcpy() > doesn't play nice with mqd being volatile: > > /home/hannes/src/linux/linux/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c: In function 'amdgpu_debugfs_mqd_read': > /home/hannes/src/linux/linux/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c:550:22: warning: passing argument 1 of '__builtin_dynamic_object_size' discards 'volatil' qualifier from pointer target type [-Wdiscarded-qualifiers] > 550 | memcpy(kbuf, mqd, ring->mqd_size); > > So I would propose leaving the patch as-is. Shashank, does that sound > good to you? Friendly ping :) Shashank, is your Reviewed-by still good for this patch, given the above? Thanks