From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 CF4CD139D1A; Sun, 4 Aug 2024 17:44:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.51 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722793475; cv=none; b=WOib50Fxd2l2uBNZ17Ql9bO7Y/fBxdW6klv13XniOySHZmFR3pfKgPcqu+huSuCAGfFJ7rNSgSrZbjOtU5jrKHvbPPNy9nmBpKBGqkyB2kNH8uEsqJZWh8TkTawa5HDPz4wDnSa3rQY25U1wgYm5VA/GwG+uSyQWY2aRwzCJasM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722793475; c=relaxed/simple; bh=P6tl98PPpFGrbbFj5w75g3BxJxNbMlbPQduy4dlyBE0=; h=From:To:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Rj4F61L/aQ1/7yxEJBXG7nA7pKg6eKbfwoiVLdwlIty9J3Iw6pTPOp7GBplKdoGwMsnj9dvYfIxtzpPLt5z+q96AS/pmqtzVbgZiXqsP/mroTYLhl4mzbsrmbQ/da0brk3zLnyNfRHv4hhrt1wfB3YMg+GWKL6nfw63OxWveMmQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=OnCwZQEM; arc=none smtp.client-ip=209.85.128.51 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="OnCwZQEM" Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-42809d6e719so67802645e9.3; Sun, 04 Aug 2024 10:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722793472; x=1723398272; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NJElgdSeo7tFBhUWI5Y2VGkmcaarTUGB2bJhxj7nOts=; b=OnCwZQEM08v/Zujyjcil9c/frULNyHyWxpWQDLCNM4L5fEqQaL+6EkVzl5H1RtJezm +WIeOJ1+NoHPh3mdLIX4Hm1NK9qFCB8Rfq9aMbFkV5LY4Eo02AZPsnoNPuv1t08tAz4S TU6wNvnLKQ7pKWYTx19cHc0mu4D4oORoNtcb1IaOz9211dnEwAly0MmilvHr6j/UjIJY 8T/DnC+xKbfGW7YRpf6Vi2B5vfoM3QgHFDLJNcJ3jvMDW3fFK/Asle28W3WRh3v4d/is WhjCzDhmQpt8OxjsnqETwCnAjDzsVnIfoYTFisQJyX30XQ5Y5Cas0VNxCqVzz3SulLEY SfOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722793472; x=1723398272; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NJElgdSeo7tFBhUWI5Y2VGkmcaarTUGB2bJhxj7nOts=; b=AHH6eEB8JexnN4lv/3SunAg0+KfVXMdjdU46YcnQagfdo6nSMEi+GqqbkMSHlS+S3E 3ABRQEDEs2XUTzdW4pjqTgqx6dmR1OIzWKXUfDHPCoFh0qC0c73ewZ75VKtw/rKaRUHj Eo52Evh33MgWcuoUIwRqUwBFqfJvO/TDUwC8YRyE96ii4ChgmoJ494h1r2UVVjp/K+Lk IO7nL820vBx6iG4+NIxlDwLHdZ0YYWPStKJsk3J+uvDeePtdnml7UEc6/lZp0iAdGOp8 0gSvTLVHcg2CgTMhLEtQDhHbF5SFyYUNnji8aPq5RzvLdLazJGV6FNPVQOZ+s1hgM3dx EI9w== X-Forwarded-Encrypted: i=1; AJvYcCVBr/DBCiYdGfClDIkhS9ceKKKRFsBc0Vw8kM9235iOYJ1Ggq0m9OhyPhtVLc6GU9GIynZ0jk7aniG7N8qCP6pN/LaKcO/ugfih9UAWPQhy9eugIiB2GMLNmEEBuGdcc0PROf1cdcB5clLRFBCh7TIl/IPRQSpIVHZQudWlDzCEnqH5xw== X-Gm-Message-State: AOJu0YwdPruq8kXBrSZI67VLq8M4/sFv3gCAtxxWthgYFbSSjjtBZ2iH /mUesmgbUHZFDI0V8uPAw2aquYPntAJwRUM21UvDLJVJpJY/Q2jA X-Google-Smtp-Source: AGHT+IF6h/dGDHwUKaeJf81/S6Xw4YXN06iaLrsJ+xyLkFLlhqRSyGV1A+2MwoRSks+8BuECDOiQtg== X-Received: by 2002:a05:600c:470e:b0:426:59fe:ac2d with SMTP id 5b1f17b1804b1-428e6b9369bmr73165125e9.32.1722793472007; Sun, 04 Aug 2024 10:44:32 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e0357asm109530485e9.12.2024.08.04.10.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 10:44:31 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v2 2/6] nvme: assign of_node to nvme device Date: Sun, 4 Aug 2024 19:44:06 +0200 Message-ID: <20240804174414.18171-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240804174414.18171-1-ansuelsmth@gmail.com> References: <20240804174414.18171-1-ansuelsmth@gmail.com> Precedence: bulk X-Mailing-List: linux-mmc@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Introduce support for a dedicated node for a nvme card. This will be a subnode of the nvme controller node that will have the "nvme-card" compatible. This follow a similar implementation done for mmc where the specific mmc card have a dedicated of_node. This can be used for scenario where block2mtd module is used to declare partition in DT and block2mtd is called on the root block of the nvme card, permitting the usage of fixed-partition parser or alternative ones. Signed-off-by: Christian Marangi --- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 053d5b4909cd..344523274d1b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -4651,6 +4652,7 @@ void nvme_uninit_ctrl(struct nvme_ctrl *ctrl) nvme_hwmon_exit(ctrl); nvme_fault_inject_fini(&ctrl->fault_inject); dev_pm_qos_hide_latency_tolerance(ctrl->device); + of_node_put(ctrl->device->of_node); cdev_device_del(&ctrl->cdev, ctrl->device); nvme_put_ctrl(ctrl); } @@ -4771,6 +4773,8 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev, else ctrl->device->groups = nvme_dev_attr_groups; ctrl->device->release = nvme_free_ctrl; + ctrl->device->of_node = of_get_compatible_child(ctrl->dev->of_node, + "nvme-card"); dev_set_drvdata(ctrl->device, ctrl); return ret; -- 2.45.2 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7807AC52D71 for ; Sun, 4 Aug 2024 17:44:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=pQNjTwW+MOpp9C5Q/MHr5cvRe4inORamchhN1WnnaDA=; b=sbneLcAWmuSOv9 hFTgJtW49Vidxr+r11Y7fIKlNaHkhoXPS2nrh8vQuYn2+cUQYEJki/BQfQC75q2mZQADFqFw1SUC2 eWtIpjGtrG17C7jgLIiH9LfR9Kqqa2ceoxxJFh6bIsj8vAL5xGVWhSu8oeEV+nwbvM9pNfOrgm+Pb kA3TZo/j5UZPu6l/N7YTNqNyq7Mkt59RKYk4t7rIi376jajfD69dCiGyfKIYSzpRb+vvS9L+nZHEA bMCithXQ/AijMoLES3QZDWIZ+0StPsta/JCmzxr6iUXlU5j7gv3dsAKK1FwjL90BmiJk+/RBYR+3x cDjYVYutn1ini4ZmlAfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1safHY-0000000Dgvg-0zMv; Sun, 04 Aug 2024 17:44:36 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1safHW-0000000DguQ-03ou; Sun, 04 Aug 2024 17:44:35 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-427fc97a88cso67939045e9.0; Sun, 04 Aug 2024 10:44:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1722793472; x=1723398272; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=NJElgdSeo7tFBhUWI5Y2VGkmcaarTUGB2bJhxj7nOts=; b=K8z8gMZ7BL9qsooCkXLPlo2AxcpT4TSjOtMoKYYisu5BcLqYyDtWZWji2910FMWhek zlBbC9wd24WzR+0GWT8sMZxjiJOhR4FWZiSH5gFb/ykzd1OQBEuJqKdcMMObyqoRgrPv OPS31wqBNUyZgDy2Yjj/FlF3FAEkNHDYyWkqgfjJxxkek1BQHoxdc5/tUcKa700AKWmo oET2AcljtmiRvxA32eGMQlKlRftxhft7RO3QJ4M4mNWGmLQxcFzg6V2v2xjrMllrsttW Clad14n0MIpoJ/P1yppAIYpzVtO+PBZjyVYGqLR0MC5Pm45wJ0wI2DgpEKPccI8nXBNd XX2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722793472; x=1723398272; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=NJElgdSeo7tFBhUWI5Y2VGkmcaarTUGB2bJhxj7nOts=; b=m6hgfN85Vr6LpCvVN1S2vQynRMTl2QflZrTmLiZwf9ijQehrWTHRDEuIMO4VYLXlQZ 2DeaSKfVRPB8fauleNMxNhzwnT4fGWdrdTtXqgF00l24670EgtIQk9yAJTbiwwWiLXy0 1WckT1sJgeBmsbUSZvHa1j0hG/YYcIrbGZav2gfUimNZoHpak/J393LH+90ks43LgiDe 5hbW6xhX9B2o0QFFzDXO1bTXfpc+uATYA1lHvH8P64wCjYzJ1UTd/fxIoyiYtL9Gctaw etGSaEfboy2VTsyOV9SpX/jVWn6oOCPLZL5WwaizxFcwLU/pcCDL9QAha40gV4Wox3/2 Qysg== X-Forwarded-Encrypted: i=1; AJvYcCVxb9N5AyD0sdWi3Yzh/Tkawrqdk/RGDXycoFvIgfWJtGpKhhI+3Hf9NWRnDOt/4XuVwv5AnmW2h8rAxpFCn7k7OXKicDCrD3SQyAZtAEbftqVDHLxKkjLwPQhpZuji5kTLLqbRPt0o134SEhYo X-Gm-Message-State: AOJu0YwFsdXkQpaf5wtNLt4nJjcch7tRXqYXvaosurfuuKWLnOVKeDUF iaecb8BKW+xI0kjyOkOHS3ARUmxeExpTZxXC8UdwDCJaJD4bQJ7+ X-Google-Smtp-Source: AGHT+IF6h/dGDHwUKaeJf81/S6Xw4YXN06iaLrsJ+xyLkFLlhqRSyGV1A+2MwoRSks+8BuECDOiQtg== X-Received: by 2002:a05:600c:470e:b0:426:59fe:ac2d with SMTP id 5b1f17b1804b1-428e6b9369bmr73165125e9.32.1722793472007; Sun, 04 Aug 2024 10:44:32 -0700 (PDT) Received: from localhost.localdomain (host-87-6-196-30.retail.telecomitalia.it. [87.6.196.30]) by smtp.googlemail.com with ESMTPSA id 5b1f17b1804b1-428e6e0357asm109530485e9.12.2024.08.04.10.44.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Aug 2024 10:44:31 -0700 (PDT) From: Christian Marangi To: Ulf Hansson , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Joern Engel , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , Christian Marangi , Wolfram Sang , Florian Fainelli , Thomas Bogendoerfer , linux-mmc@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nvme@lists.infradead.org Subject: [PATCH v2 2/6] nvme: assign of_node to nvme device Date: Sun, 4 Aug 2024 19:44:06 +0200 Message-ID: <20240804174414.18171-3-ansuelsmth@gmail.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240804174414.18171-1-ansuelsmth@gmail.com> References: <20240804174414.18171-1-ansuelsmth@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240804_104434_092680_BBB655B3 X-CRM114-Status: GOOD ( 14.94 ) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" Errors-To: linux-mtd-bounces+linux-mtd=archiver.kernel.org@lists.infradead.org Introduce support for a dedicated node for a nvme card. This will be a subnode of the nvme controller node that will have the "nvme-card" compatible. This follow a similar implementation done for mmc where the specific mmc card have a dedicated of_node. This can be used for scenario where block2mtd module is used to declare partition in DT and block2mtd is called on the root block of the nvme card, permitting the usage of fixed-partition parser or alternative ones. Signed-off-by: Christian Marangi --- drivers/nvme/host/core.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 053d5b4909cd..344523274d1b 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -4651,6 +4652,7 @@ void nvme_uninit_ctrl(struct nvme_ctrl *ctrl) nvme_hwmon_exit(ctrl); nvme_fault_inject_fini(&ctrl->fault_inject); dev_pm_qos_hide_latency_tolerance(ctrl->device); + of_node_put(ctrl->device->of_node); cdev_device_del(&ctrl->cdev, ctrl->device); nvme_put_ctrl(ctrl); } @@ -4771,6 +4773,8 @@ int nvme_init_ctrl(struct nvme_ctrl *ctrl, struct device *dev, else ctrl->device->groups = nvme_dev_attr_groups; ctrl->device->release = nvme_free_ctrl; + ctrl->device->of_node = of_get_compatible_child(ctrl->dev->of_node, + "nvme-card"); dev_set_drvdata(ctrl->device, ctrl); return ret; -- 2.45.2 ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/