Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp2531479rwi; Fri, 28 Oct 2022 08:08:22 -0700 (PDT) X-Google-Smtp-Source: AMsMyM70QmjZLuhon93DYrQpat3HtILylMq4l0vcVU/xc62u/tPJzFzPQOgy7C14yqOtVFZvIcV0 X-Received: by 2002:a05:6a00:18a8:b0:56c:702a:5f49 with SMTP id x40-20020a056a0018a800b0056c702a5f49mr12902268pfh.1.1666969701936; Fri, 28 Oct 2022 08:08:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666969701; cv=none; d=google.com; s=arc-20160816; b=tvZ1MQ5NnYPwhpQLCQKQZD5FDbFT/NKbl/ZS5jnMUeCkzziLPCGkxeY7pRWv0vQTvS t57fbVxckPUyscFLMrdwje1/GAzpPFMAgWtKThBCTHWJynKdgOnXfKElC9IzUnqyv/ct hvAu+PRgA2aCU/xQK8GAfsodoML18RKQnx3UNtfJV8BKzGAbWQos2ZDM878N3SFbt7NY aFEJyXucsNBzj2xUt1+rsBuH9hCX1qU8a/rElEb5jOCS5gL97D6Z5HM/yod/hp87mDJe +bLLme2JTlk6HZkCmksR9RO+MSR7JAfdSJQavuTTZwWMjFrMpr9B8VXn4iXwjooW6kK7 3vsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=GN1FFIke+/ylut5zHuh8bs4SrYwUHHWxl1Ixeodu3so=; b=MmL3sT5zeAvW+sCbjLSIMqxl4Oqzl0geqy+N8q1WA6259IEqsbW/1sS0Kj5drwA0Fa trLE6Pss+8cEALTYC0xjXRq1stMHHbL0w5aGo2K4kfwBG7xb3Nknxjl0xo0UOexCihTn P3mgvMc+t6NFOLUye/b6zxY5tMXXG1B6HWEf7tOXPnmpVWzZHvIFIArYbx2PQVOEQFLX oT6Mj2MlXP8F8UyVnkMqapO909PkOtPSnaXtdOaNSYt5zf7Sw9YOhJ7n/LnvHGyCJJfI M3H1gIINqgiEz8gWeA6Zr7uL6JZ4m+FubQpStbr1n2D6Dywyj6oIULafIGdD3q54nmDF Lw/A== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j73-20020a638b4c000000b00439a5dfc7absi393143pge.365.2022.10.28.08.08.09; Fri, 28 Oct 2022 08:08:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231442AbiJ1OJX (ORCPT + 99 others); Fri, 28 Oct 2022 10:09:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231476AbiJ1OJK (ORCPT ); Fri, 28 Oct 2022 10:09:10 -0400 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 3766B1E0449 for ; Fri, 28 Oct 2022 07:09:09 -0700 (PDT) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 467DE1063; Fri, 28 Oct 2022 07:09:15 -0700 (PDT) Received: from e120937-lin.. (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 276103F534; Fri, 28 Oct 2022 07:09:08 -0700 (PDT) From: Cristian Marussi To: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: sudeep.holla@arm.com, cristian.marussi@arm.com, Peter Hilber Subject: [PATCH 5/8] firmware: arm_scmi: Fix devres allocation device in virtio Date: Fri, 28 Oct 2022 15:08:30 +0100 Message-Id: <20221028140833.280091-5-cristian.marussi@arm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221028140833.280091-1-cristian.marussi@arm.com> References: <20221028140833.280091-1-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org SCMI Virtio transport device managed allocations must use the main platform device in devres operations instead of the channel devices. Cc: Peter Hilber Fixes: 46abe13b5e3d ("firmware: arm_scmi: Add virtio transport") Signed-off-by: Cristian Marussi --- Since as of now (v6.1-rc2) cinfo->dev == info->dev in virtio (given ONLY one channel can exist in virtio transport), this change is sort of more semantic than real as of now, BUT it will be needed fully soon, once the per-transport-devices will be adopted (part of an unrelated series) since in that case cinfo->dev != info->dev for virtio too. So maybe I can fold this one in the SCMI Raw series carrying transport devices patch, if you prefer. --- drivers/firmware/arm_scmi/virtio.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/firmware/arm_scmi/virtio.c b/drivers/firmware/arm_scmi/virtio.c index 14709dbc96a1..36b7686843a4 100644 --- a/drivers/firmware/arm_scmi/virtio.c +++ b/drivers/firmware/arm_scmi/virtio.c @@ -444,12 +444,12 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, for (i = 0; i < vioch->max_msg; i++) { struct scmi_vio_msg *msg; - msg = devm_kzalloc(cinfo->dev, sizeof(*msg), GFP_KERNEL); + msg = devm_kzalloc(dev, sizeof(*msg), GFP_KERNEL); if (!msg) return -ENOMEM; if (tx) { - msg->request = devm_kzalloc(cinfo->dev, + msg->request = devm_kzalloc(dev, VIRTIO_SCMI_MAX_PDU_SIZE, GFP_KERNEL); if (!msg->request) @@ -458,7 +458,7 @@ static int virtio_chan_setup(struct scmi_chan_info *cinfo, struct device *dev, refcount_set(&msg->users, 1); } - msg->input = devm_kzalloc(cinfo->dev, VIRTIO_SCMI_MAX_PDU_SIZE, + msg->input = devm_kzalloc(dev, VIRTIO_SCMI_MAX_PDU_SIZE, GFP_KERNEL); if (!msg->input) return -ENOMEM; -- 2.34.1