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=-16.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED 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 1B761C433F5 for ; Mon, 13 Sep 2021 20:24:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3088610CC for ; Mon, 13 Sep 2021 20:24:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243525AbhIMUZV (ORCPT ); Mon, 13 Sep 2021 16:25:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:23391 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243503AbhIMUZU (ORCPT ); Mon, 13 Sep 2021 16:25:20 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631564644; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=NhPD0uUD31I/CKuX1ZppKPQ477bEoW/ZxvwAE00nVcg=; b=GtumtC5Y7X1IXmNlVTCC/WxDY62tfTkYFrAwe8+TnWHO40Rbt9Z/ZM4NjVQjg+PeX1CgIi P3IwRcGrMBq/ErZjJLLkyqZdrqQhfZ+Ld415iJJjP8+QX9wJfCRiYPzlIfF9Akces9LBbT 8vme7MV9X2zBItQHkJBmDc4T20pbxvo= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-100-XxCb5M4yP9WioQ37LGnUWQ-1; Mon, 13 Sep 2021 16:24:03 -0400 X-MC-Unique: XxCb5M4yP9WioQ37LGnUWQ-1 Received: by mail-wm1-f71.google.com with SMTP id n17-20020a7bc5d1000000b002f8ca8bacdeso250942wmk.3 for ; Mon, 13 Sep 2021 13:24:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NhPD0uUD31I/CKuX1ZppKPQ477bEoW/ZxvwAE00nVcg=; b=sU1qouneEOOKpw/gJ7zsKyMpbwVX2PP3mF65aRSgJ+AWTUINNrRtMQ9nG4P4R73OFP 8aHwlvqZDJ5r5WdeNWYShUn0+z2/D2kiFE1sgydt/j8XRUb3fiUEprorL7oCd4wVhv97 VS6mtYHawLHpskOnpkoIxVkmtceJtS6DF0oRUNFZee6sQdHD0T7EOLaQdSBB0eoQxdkm lqo6lPUqbWJC4jnHeMhWqjTFX81a0FNTejetbwk8OAqmWEbmDRNHMTN1W0kafFwFxftF 5Trs1aUuhTviLFJVgmWWHdKwOc1JouhZozAAjcN0Zt5OILi7NQkM6nh1NPteSpb1I1J6 OaKg== X-Gm-Message-State: AOAM531g+ptm1ynpEzUGD1ynfSIvEq5vCtDeUk/5kpM9dplCgdQfM7OA /cB9VNQSI9CTa5xFfYWBy3SxsjsHq/KJvAkgbiPIeNtbXLRm1E+LMo7sDONDhvEfVR/tiVp/dPz fLMMROw9fhoxaJ2zoGhwhXQ== X-Received: by 2002:adf:8b19:: with SMTP id n25mr15678733wra.216.1631564641935; Mon, 13 Sep 2021 13:24:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZ4VPgchaH0UTtSoQXdz3pY1CJwy3IEzUFNkJqC0hstFpyRondLeVvmI4fHJvgYlZOixZWGg== X-Received: by 2002:adf:8b19:: with SMTP id n25mr15678716wra.216.1631564641742; Mon, 13 Sep 2021 13:24:01 -0700 (PDT) Received: from redhat.com ([2.55.151.134]) by smtp.gmail.com with ESMTPSA id j98sm8615187wrj.88.2021.09.13.13.23.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Sep 2021 13:24:01 -0700 (PDT) Date: Mon, 13 Sep 2021 16:23:57 -0400 From: "Michael S. Tsirkin" To: Alexey Kardashevskiy Cc: Jason Wang , Rob Herring , Arnd Bergmann , Jean-Philippe Brucker , Viresh Kumar , Vincent Guittot , Bill Mills , Alex =?iso-8859-1?Q?Benn=E9e?= , "Enrico Weigelt, metux IT consult" , Jie Deng , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Arnd Bergmann , Guenter Roeck Subject: Re: [PATCH] virtio: don't fail on !of_device_is_compatible Message-ID: <20210913162308-mutt-send-email-mst@kernel.org> References: <20210913104640.85839-1-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210913104640.85839-1-mst@redhat.com> Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On Mon, Sep 13, 2021 at 06:47:52AM -0400, Michael S. Tsirkin wrote: > A recent change checking of_device_is_compatible on probe broke some > powerpc/pseries setups. Apparently there virtio devices do not have a > "compatible" property - they are matched by PCI vendor/device ids. > > Let's just skip of_node setup but proceed with initialization like we > did previously. > > Fixes: 694a1116b405 ("virtio: Bind virtio device to device-tree node") > Reported-by: Alexey Kardashevskiy > Cc: Arnd Bergmann > Cc: Viresh Kumar > Signed-off-by: Michael S. Tsirkin > --- Guenter could you take a look at this patch pls? Does it help? > Arnd could you help review this pls? Viresh is on vacation. > > drivers/virtio/virtio.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/virtio/virtio.c b/drivers/virtio/virtio.c > index c46cc1fbc7ae..19a70a2361b4 100644 > --- a/drivers/virtio/virtio.c > +++ b/drivers/virtio/virtio.c > @@ -347,8 +347,13 @@ static int virtio_device_of_init(struct virtio_device *dev) > ret = snprintf(compat, sizeof(compat), "virtio,device%x", dev->id.device); > BUG_ON(ret >= sizeof(compat)); > > + /* > + * On powerpc/pseries virtio devices are PCI devices so PCI > + * vendor/device ids play the role of the "compatible" property. > + * Simply don't init of_node in this case. > + */ > if (!of_device_is_compatible(np, compat)) { > - ret = -EINVAL; > + ret = 0; > goto out; > } > > -- > MST