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 X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 02798C11F64 for ; Thu, 1 Jul 2021 10:34:19 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D38E661494 for ; Thu, 1 Jul 2021 10:34:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236042AbhGAKgr (ORCPT ); Thu, 1 Jul 2021 06:36:47 -0400 Received: from foss.arm.com ([217.140.110.172]:50958 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235300AbhGAKgr (ORCPT ); Thu, 1 Jul 2021 06:36:47 -0400 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 79C9AD6E; Thu, 1 Jul 2021 03:34:16 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D7B223F718; Thu, 1 Jul 2021 03:34:12 -0700 (PDT) Date: Thu, 1 Jul 2021 11:34:06 +0100 From: Cristian Marussi To: Peter Hilber Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, igor.skalkin@opensynergy.com, alex.bennee@linaro.org, jean-philippe@linaro.org, mikhail.golubev@opensynergy.com, anton.yakovlev@opensynergy.com, Vasyl.Vavrychuk@opensynergy.com, Andriy.Tryshnivskyy@opensynergy.com Subject: Re: [PATCH v4 14/16] firmware: arm_scmi: Add virtio transport Message-ID: <20210701103406.GE17807@e120937-lin> References: <20210611165937.701-1-cristian.marussi@arm.com> <20210611165937.701-15-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On Thu, Jul 01, 2021 at 10:43:07AM +0200, Peter Hilber wrote: > On 11.06.21 18:59, Cristian Marussi wrote: > > > > > +static struct virtio_driver virtio_scmi_driver = { > > + .driver.name = "scmi-virtio", > > + .driver.owner = THIS_MODULE, > > + .feature_table = features, > > + .feature_table_size = ARRAY_SIZE(features), > > + .id_table = id_table, > > + .probe = scmi_vio_probe, > > + .remove = scmi_vio_remove, > > +}; > > + > > It might be good to also check for the VIRTIO_F_VERSION_1 feature bit in the > optional .validate op (not yet implemented above), as some other devices do > (quoting virtio-snd in the following): > Ah, thanks for pointing that out, I'll do because indeed in my hackish emulation test-setup I forgot to emulate that bit and everything fall flat. > > /** > > * virtsnd_validate() - Validate if the device can be started. > > * @vdev: VirtIO parent device. > > * > > * Context: Any context. > > * Return: 0 on success, -EINVAL on failure. > > */ > > static int virtsnd_validate(struct virtio_device *vdev) > > { > > > > > > > if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { > > dev_err(&vdev->dev, > > "device does not comply with spec version 1.x\n"); > > return -EINVAL; > > } > > > > > > > > > static struct virtio_driver virtsnd_driver = { > > .driver.name = KBUILD_MODNAME, > > .driver.owner = THIS_MODULE, > > .id_table = id_table, > > .validate = virtsnd_validate, > > (end of virtio-snd quote) Thanks, Cristian 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 X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 271F7C11F64 for ; Thu, 1 Jul 2021 10:35:47 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id DEA476146B for ; Thu, 1 Jul 2021 10:35:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DEA476146B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Jo49Fni48jkM9ad9TsqZtQNU78tkobAeiADzu8NMOE4=; b=k9B4Kf+U2i0A5W RZm3ImluFumGFh+HUp8BxRAABcn2HRV/bzc1ofk9h+z0jdz/L7ygTtz6a9YLwwkdm6HO6e+Ve4mb1 GC9Kis4yYT3P886NAfOW0AzA4J0LYp7rFazj5duedk9HegW+LrnDjQt183vkZPK6++wCAA39vWMR2 Pr27jfXtEU+sUwl0xMSg2urGcxpqO/1XZUDJKrVVTFCats2ey+m7rhTerxssxLYQA93bm6CjX/gYA Y41wc4ZtxlFUNM+1R2NrWeEnkUHRCnBDSMNVVQL/pIwBjdniAQsQcuuh80GeuTtrUZwo7QomvYYYI dyDasg+ffSosO8B8/E/w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyu1W-00GxKr-2r; Thu, 01 Jul 2021 10:34:22 +0000 Received: from foss.arm.com ([217.140.110.172]) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyu1T-00GxK5-2y for linux-arm-kernel@lists.infradead.org; Thu, 01 Jul 2021 10:34:20 +0000 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 79C9AD6E; Thu, 1 Jul 2021 03:34:16 -0700 (PDT) Received: from e120937-lin (unknown [172.31.20.19]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id D7B223F718; Thu, 1 Jul 2021 03:34:12 -0700 (PDT) Date: Thu, 1 Jul 2021 11:34:06 +0100 From: Cristian Marussi To: Peter Hilber Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, virtualization@lists.linux-foundation.org, virtio-dev@lists.oasis-open.org, sudeep.holla@arm.com, james.quinlan@broadcom.com, Jonathan.Cameron@Huawei.com, f.fainelli@gmail.com, etienne.carriere@linaro.org, vincent.guittot@linaro.org, souvik.chakravarty@arm.com, igor.skalkin@opensynergy.com, alex.bennee@linaro.org, jean-philippe@linaro.org, mikhail.golubev@opensynergy.com, anton.yakovlev@opensynergy.com, Vasyl.Vavrychuk@opensynergy.com, Andriy.Tryshnivskyy@opensynergy.com Subject: Re: [PATCH v4 14/16] firmware: arm_scmi: Add virtio transport Message-ID: <20210701103406.GE17807@e120937-lin> References: <20210611165937.701-1-cristian.marussi@arm.com> <20210611165937.701-15-cristian.marussi@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210701_033419_221907_79DFA14A X-CRM114-Status: GOOD ( 16.89 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi, On Thu, Jul 01, 2021 at 10:43:07AM +0200, Peter Hilber wrote: > On 11.06.21 18:59, Cristian Marussi wrote: > > > > > +static struct virtio_driver virtio_scmi_driver = { > > + .driver.name = "scmi-virtio", > > + .driver.owner = THIS_MODULE, > > + .feature_table = features, > > + .feature_table_size = ARRAY_SIZE(features), > > + .id_table = id_table, > > + .probe = scmi_vio_probe, > > + .remove = scmi_vio_remove, > > +}; > > + > > It might be good to also check for the VIRTIO_F_VERSION_1 feature bit in the > optional .validate op (not yet implemented above), as some other devices do > (quoting virtio-snd in the following): > Ah, thanks for pointing that out, I'll do because indeed in my hackish emulation test-setup I forgot to emulate that bit and everything fall flat. > > /** > > * virtsnd_validate() - Validate if the device can be started. > > * @vdev: VirtIO parent device. > > * > > * Context: Any context. > > * Return: 0 on success, -EINVAL on failure. > > */ > > static int virtsnd_validate(struct virtio_device *vdev) > > { > > > > > > > if (!virtio_has_feature(vdev, VIRTIO_F_VERSION_1)) { > > dev_err(&vdev->dev, > > "device does not comply with spec version 1.x\n"); > > return -EINVAL; > > } > > > > > > > > > static struct virtio_driver virtsnd_driver = { > > .driver.name = KBUILD_MODNAME, > > .driver.owner = THIS_MODULE, > > .id_table = id_table, > > .validate = virtsnd_validate, > > (end of virtio-snd quote) Thanks, Cristian _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel