Received: by 2002:ab2:1689:0:b0:1f7:5705:b850 with SMTP id d9csp2203768lqa; Tue, 30 Apr 2024 10:44:52 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUYDh2lKuR2qjn9B3E5RcvfRdXP5dIBkOIdS2eIsiLHp81F/hj2Uv8oSXoU3XoODPG8cE3dCeCeP1OFvEpjSMU3jgvEiwunPIVzWKlEUw== X-Google-Smtp-Source: AGHT+IHAjpVOwVJmc+wWRjruM77QP/maqUu8MVA60h6smctdRJMorinue/OW7+ceQDq4x/+Na85Q X-Received: by 2002:a05:6214:2528:b0:6a0:cde0:e46d with SMTP id gg8-20020a056214252800b006a0cde0e46dmr27979qvb.46.1714499092269; Tue, 30 Apr 2024 10:44:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714499092; cv=pass; d=google.com; s=arc-20160816; b=exYT/9cOqsvATvwtWKnsgydoMMMuzUkeNz5g248o4lt+ryYd0sS21lz0iegDvS17lw DnWAUKQ8buHqvWKAgpPN6e1mjrVZXyLlwSTaPcR3ZlCqoE3fKgsP48VULGxr/NLo5Frh dEdZbnWzqSYLnr2ZR2FF6yZOOvYijZ+lO3YCzEoJNkCKVcztLBsq2PpGZKQ30OxVmJNN av0+XyZG2QB6cVwcAcuDWJHDerBSnWD+Bfl3kGi9NqRdez0Lbta0ucoMVXr/GN7Uyfqh BmmGxoDeU8ZX+v9oZybWhy1DtuJLyc0vPXmS5Vyrr4V24LWPmXNCtyxMet+h/V5uQTNu 2S8g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=7Qi+9Lj//2gN5mxI1dgvSV2MpYjsPTXxcZS5Otw2dBs=; fh=ZUwGF2Xiq/7+seiEO5Dgh1kzjZ4PK63EuEROupdVH1s=; b=nEg8PLH5Oq4izmVACUEDr0AUGsfHTik9Bj9AH3bgK6f7htmAnol5Prh/yvoElO1dFV 9NCTn2rKf6IKmC2msDtN4qSW9HV6aRoizKZ7/B2RudY1h3XlV6XTeX152kL1CZew1y7X NhpV+oMTzzW8TrFmj+FBh00lcSeRn0IF+iOShGXz5d/ImoDrFFBtl+tUQHqpkJM2b5MN i8zvZX9M8Pwzup20gNpLzcZNAJyQnlaIoISKDpH1du5C7SqZutiMooQNJNvA6sjBDcvY Ewzv2QnLiISg7z+MMNXkUIFugm6B+Q4fQJsQQ/tQnDovWBTD13c49s4D1k48Ae3TOMqL oPcQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AwraDZex; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-164543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id gc15-20020a056214230f00b0069b0b8b31bcsi29239062qvb.429.2024.04.30.10.44.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 10:44:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-164543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=AwraDZex; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-164543-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-164543-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id F2E871C22F23 for ; Tue, 30 Apr 2024 17:44:51 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BAFF218133E; Tue, 30 Apr 2024 17:44:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="AwraDZex" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AAF8A17BB16; Tue, 30 Apr 2024 17:44:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.10 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714499083; cv=none; b=WcdvMxtZQHDGTUUaT5gY25TYM4NSE1KqlqGe/LBYs5+RUnPBg8OOXYKp10lQNG+7bNR0a7hDQr4yOdERYVGs8at/N+k9q9c3v30FA6OqezTHiSCAYhCxVKNd8WrHVPt1JoKpBDdadcctvdEunmS5rGt8FmP+YSmNXyuH8cuZ6ms= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714499083; c=relaxed/simple; bh=nHPBa1hKRfZ9dLWYPef6NXJGJU2ladqY7W9AbvHufiI=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=ZZLr5wuPNUt3n5qHM6Bbdxm8/pdqrMuOYwZk2s9IFu07o3U6B4lYveBCwwACeDf0Ygm8lUOSc4Vgaw0WY1iOJezigLAYtuEim7UAN//yVRYJVK5EA88y9RvrsAYCCaZize5mmP5+Hw0LWPB3v1iMmVyfsRB1clAebIVKVdZcPvc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=AwraDZex; arc=none smtp.client-ip=198.175.65.10 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1714499081; x=1746035081; h=from:subject:date:message-id:mime-version: content-transfer-encoding:to:cc; bh=nHPBa1hKRfZ9dLWYPef6NXJGJU2ladqY7W9AbvHufiI=; b=AwraDZex4WsSu/Jx23SAjIegN0JJkjS1c9PvvqFqFHwPs4bNsFoVm5qF UJTIi+DzMRkEsQTgLPqRS9K81QDX7pSAucUm3Wcd/hZauUfnP8Xdd87pB SRFJZaOktUJTD/zde3ezBWDX1WiaKqT2QA0VccdhMbdw47k3rZfb3/8UJ L0Jnc7j6peunchmx0BuexQ313jQJy/RSA8+TiNi3m46dfWv2Mn+Em+pXu uikz57CCvGTlW5o7gNGcn6RjgLT1oezUI9SR8HwHNMNxwmH0r3hYEFepx yj4nZheCEw6sSJ7TE2bmYL7ti5HUnNgDYwKnKH9s/d+AvXsNO1mlnIv2u Q==; X-CSE-ConnectionGUID: NPVEXPMQRMK+H0jZETWwfg== X-CSE-MsgGUID: uvEv6E0PQbCiqyckGuw6Lg== X-IronPort-AV: E=McAfee;i="6600,9927,11060"; a="27669827" X-IronPort-AV: E=Sophos;i="6.07,242,1708416000"; d="scan'208";a="27669827" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2024 10:44:41 -0700 X-CSE-ConnectionGUID: deO5bSNgTo+ezujjPEwEoQ== X-CSE-MsgGUID: PNLzAvs+Qaai0A1NouEAMQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,242,1708416000"; d="scan'208";a="26534771" Received: from vverma7-desk1.amr.corp.intel.com (HELO [192.168.1.200]) ([10.212.82.45]) by fmviesa007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Apr 2024 10:44:41 -0700 From: Vishal Verma Subject: [PATCH v3 0/4] dax/bus.c: Fixups for dax-bus locking Date: Tue, 30 Apr 2024 11:44:22 -0600 Message-Id: <20240430-vv-dax_abi_fixes-v3-0-e3dcd755774c@intel.com> 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="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAPYtMWYC/32NywqDMBBFf0Wy7pRkfCBd9T9KkTwmdaDVkkiwi P/e6MpF6fLcyz13EZECUxSXYhGBEkcehwzlqRC218ODgF1mgRIrWUmElMDpudOGO88zRWi1L03 jPVKtRZ69A+1FXt3umXuO0xg++0NSW/pHlhQosCVJ74z2RtdXHiZ6nu34Epss4UGgmh8CBAmu9 tK2ZFWDdBSs6/oFMTrq5PEAAAA= To: Dan Williams , Dave Jiang , Alison Schofield , Andrew Morton Cc: linux-mm@kvack.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-kernel@vger.kernel.org, Vishal Verma X-Mailer: b4 0.14-dev-5ce50 X-Developer-Signature: v=1; a=openpgp-sha256; l=1729; i=vishal.l.verma@intel.com; h=from:subject:message-id; bh=nHPBa1hKRfZ9dLWYPef6NXJGJU2ladqY7W9AbvHufiI=; b=owGbwMvMwCXGf25diOft7jLG02pJDGmGuv9st9TPPWRY8i5c9u6JlcEX7z5jyRLXjFOptzt44 dWC0rTKjlIWBjEuBlkxRZa/ez4yHpPbns8TmOAIM4eVCWQIAxenAEzE9T0jw0qZM96Tzc9dlFk4 Y0VrxgTvE8cU9+SYL7vbaLX996Y1W6IZ/srdPSG3SGlNcNnKY0fNZzgWN0uU8ShkWrQl/729uK7 qEhcA X-Developer-Key: i=vishal.l.verma@intel.com; a=openpgp; fpr=F8682BE134C67A12332A2ED07AFA61BEA3B84DFF Commit Fixes: c05ae9d85b47 ("dax/bus.c: replace driver-core lock usage by a local rwsem") introduced a few problems that this series aims to fix. Add back device_lock() where it was correctly used (during device manipulation operations), remove conditional locking in unregister_dax_dev() and unregister_dax_mapping(), use non-interruptible versions of rwsem locks when not called from a user process, and fix up a write vs. read usage of an rwsem. Signed-off-by: Vishal Verma --- Changes in v3: - Rebase to v6.9-rc6 - Collect review tags (Dan) - Reword commit message for patch 2 (Dan) - Use plain down_write() in delete_store() (Dan) - Link to v2: https://lore.kernel.org/r/20240416-vv-dax_abi_fixes-v2-0-d5f0c8ec162e@intel.com Changes in v2: - Add back valid device_lock uses (Dan) - Remove conditional locking (Dan) - Use non-interruptible versions of rwsem locks when not called from a user process (Dan) - Fix up a write vs. read usage of an rwsem - Link to v1: https://lore.kernel.org/r/20240402-vv-dax_abi_fixes-v1-1-c3e0fdbafba5@intel.com --- Vishal Verma (4): dax/bus.c: replace WARN_ON_ONCE() with lockdep asserts dax/bus.c: fix locking for unregister_dax_dev / unregister_dax_mapping paths dax/bus.c: Don't use down_write_killable for non-user processes dax/bus.c: Use the right locking mode (read vs write) in size_show drivers/dax/bus.c | 66 +++++++++++++++---------------------------------------- 1 file changed, 18 insertions(+), 48 deletions(-) --- base-commit: e67572cd2204894179d89bd7b984072f19313b03 change-id: 20240402-vv-dax_abi_fixes-8af3b6ff2e5a Best regards, -- Vishal Verma