From patchwork Fri Oct 28 14:08:30 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cristian Marussi X-Patchwork-Id: 12322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp858906wru; Fri, 28 Oct 2022 07:19:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6yVMl2809et1NEXFy70RNmD1gZK6GO6QGAxKFO/btoS9Tuv9uK6ZbDgz7IYuIQEo9rTm9Z X-Received: by 2002:a63:c142:0:b0:43c:9fcc:c9f2 with SMTP id p2-20020a63c142000000b0043c9fccc9f2mr46719231pgi.44.1666966781163; Fri, 28 Oct 2022 07:19:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666966781; cv=none; d=google.com; s=arc-20160816; b=l6CsIFlxz8HmldyfAxxm04nq2evIrFF0Hd0bWoVQO/1V1p6urWc6yPitcgeaZr0M5x okDqtvBda6SiFV5NB2ynGNFXLOoKsSXq85Jg/784HOqM8JAq9EKLEFym+Gsuu1MTvFtc NfwZXU7xhVR/YDXFwC04qVXS9/O48RzULqDfJs05ybjDkHIUfyBxe+LFozAP23TRqu9Q bj/k1OwZ7fr5XSB8NKsRROWGb6qxwDxFP1Nc0er9av6Mq/9Vizk0aWEhyav/bpixFa8b V/gDAqbqEgCOc+G2pY4w3CHqDiDRsljLkYupZf0fB9sWkfcedElDmY82ZZRBXSsM7b26 1DMQ== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a635505000000b004404705691dsi5212540pgb.487.2022.10.28.07.19.26; Fri, 28 Oct 2022 07:19:41 -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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747941359770991324?= X-GMAIL-MSGID: =?utf-8?q?1747941359770991324?= 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;