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=-7.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS autolearn=ham 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 4AA01C43387 for ; Tue, 15 Jan 2019 02:12:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 208A620659 for ; Tue, 15 Jan 2019 02:12:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727271AbfAOCMg (ORCPT ); Mon, 14 Jan 2019 21:12:36 -0500 Received: from mga14.intel.com ([192.55.52.115]:58070 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726886AbfAOCMg (ORCPT ); Mon, 14 Jan 2019 21:12:36 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Jan 2019 18:12:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,480,1539673200"; d="scan'208";a="127756656" Received: from unknown (HELO [10.239.13.114]) ([10.239.13.114]) by orsmga001.jf.intel.com with ESMTP; 14 Jan 2019 18:12:33 -0800 Message-ID: <5C3D42E1.7030005@intel.com> Date: Tue, 15 Jan 2019 10:18:09 +0800 From: Wei Wang User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Cornelia Huck , "Michael S . Tsirkin" , Jason Wang CC: virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org, virtio-dev@lists.oasis-open.org, Halil Pasic Subject: Re: [virtio-dev] [PATCH 2/2] virtio: document virtio_config_ops restrictions References: <20190103160804.21438-1-cohuck@redhat.com> <20190103160804.21438-3-cohuck@redhat.com> In-Reply-To: <20190103160804.21438-3-cohuck@redhat.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/04/2019 12:08 AM, Cornelia Huck wrote: > Some transports (e.g. virtio-ccw) implement virtio operations that > seem to be a simple read/write as something more involved that > cannot be done from an atomic context. > > Give at least a hint about that. > > Signed-off-by: Cornelia Huck > --- > include/linux/virtio_config.h | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h > index 7087ef946ba7..987b6491b946 100644 > --- a/include/linux/virtio_config.h > +++ b/include/linux/virtio_config.h > @@ -12,6 +12,11 @@ struct irq_affinity; > > /** > * virtio_config_ops - operations for configuring a virtio device > + * Note: Do not assume that a transport implements all of the operations > + * getting/setting a value as a simple read/write! Generally speaking, > + * any of @get/@set, @get_status/@set_status, or @get_features/ > + * @finalize_features are NOT safe to be called from an atomic > + * context. > * @get: read the value of a configuration field > * vdev: the virtio_device > * offset: the offset of the configuration field Reviewed-by: Wei Wang Best, Wei