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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89384C4332F for ; Fri, 25 Nov 2022 09:07:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229661AbiKYJHf (ORCPT ); Fri, 25 Nov 2022 04:07:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52012 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229599AbiKYJHe (ORCPT ); Fri, 25 Nov 2022 04:07:34 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0DDA2A721 for ; Fri, 25 Nov 2022 01:06:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669367203; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M7QTtRRbL7+Wq11xJkPqBXcSqP3SyIaC64ZZMRaftKc=; b=KtB3XnCGlV29khiUMh5RghpR89U+cVZYzqvojEyAKlDrE9aolrZwKrqqYumWYGUmAjLFi4 uQfUiNINxkIDO69wTt7fkGUN2igmBOScWk9Mf9MLJuhB66IAQ4lAKQVCMlJIuTmQaDRsTa y1noFcxHMrpevm0T+Qu9QLsoagxILzE= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-47-V_L-mldHM--iM3mdQSuwbQ-1; Fri, 25 Nov 2022 04:06:41 -0500 X-MC-Unique: V_L-mldHM--iM3mdQSuwbQ-1 Received: by mail-wr1-f71.google.com with SMTP id s1-20020adfa281000000b00241f7467851so713174wra.17 for ; Fri, 25 Nov 2022 01:06:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M7QTtRRbL7+Wq11xJkPqBXcSqP3SyIaC64ZZMRaftKc=; b=yGt5gPHURTSbMA9UjWXqPmaQ1o0egL7ARDUgPKBl2B508wZYuAsfSJye2qNc2vwdmI o2JtXhdeS0lHO17D98jAoiiedsA9QBy+Ca84uOGdUA+GR4ouvn5D0lkQTEtWb5WKC/lZ bDnUUFVK7iTOshkhDb/83DlSxS5i51B00SjHBEEvVonCBSL3mhWwFnvhgFNdeYej4ea6 kG3sfHB7oux3q5zigGWcIbKFODvMlfsN7rlYdtVKBXUi5cyE0PWiO1jKQD8OR0qERi57 krsZU+lHVYkD1GJL8wh5hybGKuA7HpFkBONIA8noLsDp4vpSBX9Dsp+UHvBz+dYItqYR 8ZAQ== X-Gm-Message-State: ANoB5pn8opMgEa7KA/InV0cO/sT27qRivhdLED0eLmYa+fEey7iIy5hZ TbGpAU0JqytoandidEIxVkxVuZ0iwc4IIN1FxiNIx6ec50xYv0EGgbeWxNNZGMhM9BSHgeAHyAk CXsPsr+4EKwYgpXoaBzwv8S9w/GYC X-Received: by 2002:adf:e305:0:b0:236:6089:cc5e with SMTP id b5-20020adfe305000000b002366089cc5emr13634720wrj.118.1669367200525; Fri, 25 Nov 2022 01:06:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5a4/3UUdnTCVdtjBQVAGdYcgL9eE9W0y2TcH3nZQvBy0bZE1SSPYRFB9nYPNcK7okvPIxpQA== X-Received: by 2002:adf:e305:0:b0:236:6089:cc5e with SMTP id b5-20020adfe305000000b002366089cc5emr13634702wrj.118.1669367200332; Fri, 25 Nov 2022 01:06:40 -0800 (PST) Received: from [192.168.1.130] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id j8-20020adff548000000b002367ad808a9sm3235859wrp.30.2022.11.25.01.06.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 01:06:38 -0800 (PST) Message-ID: Date: Fri, 25 Nov 2022 10:06:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 03/24] drm/tests: helpers: Create the device in another function Content-Language: en-US To: Maxime Ripard , Maxime Ripard , Maarten Lankhorst , Daniel Vetter , David Airlie , Thomas Zimmermann Cc: David Gow , linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman , linux-kselftest@vger.kernel.org, =?UTF-8?Q?Ma=c3=adra_Canal?= , linux-media@vger.kernel.org, kunit-dev@googlegroups.com, dri-devel@lists.freedesktop.org, Brendan Higgins , linux-kernel@vger.kernel.org, Dave Stevenson References: <20221123-rpi-kunit-tests-v1-0-051a0bb60a16@cerno.tech> <20221123-rpi-kunit-tests-v1-3-051a0bb60a16@cerno.tech> From: Javier Martinez Canillas In-Reply-To: <20221123-rpi-kunit-tests-v1-3-051a0bb60a16@cerno.tech> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kselftest@vger.kernel.org On 11/23/22 16:25, Maxime Ripard wrote: > We'll need in some tests to control when the device needs to be added > and removed, so let's split the device creation from the DRM device > creation function. > > Signed-off-by: Maxime Ripard > --- [...] > -static int dev_init(struct kunit_resource *res, void *ptr) > +struct device *drm_kunit_helper_alloc_device(struct kunit *test) > { > - char *name = ptr; > - struct device *dev; > - > - dev = root_device_register(name); > - if (IS_ERR(dev)) > - return PTR_ERR(dev); > - > - res->data = dev; > - return 0; > + return root_device_register(FAKE_DEVICE_NAME); I was going to ask if a platform device could be used here, to prevent the issue you mentioned the other day of root_device not having a bus set. But I see now that you are doing that change in the next patch. Reviewed-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Core Platforms Red Hat 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 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7CC59C4332F for ; Fri, 25 Nov 2022 09:06:50 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 29D7A10E216; Fri, 25 Nov 2022 09:06:49 +0000 (UTC) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by gabe.freedesktop.org (Postfix) with ESMTPS id B9E1510E191 for ; Fri, 25 Nov 2022 09:06:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1669367203; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M7QTtRRbL7+Wq11xJkPqBXcSqP3SyIaC64ZZMRaftKc=; b=KtB3XnCGlV29khiUMh5RghpR89U+cVZYzqvojEyAKlDrE9aolrZwKrqqYumWYGUmAjLFi4 uQfUiNINxkIDO69wTt7fkGUN2igmBOScWk9Mf9MLJuhB66IAQ4lAKQVCMlJIuTmQaDRsTa y1noFcxHMrpevm0T+Qu9QLsoagxILzE= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-438-wvBJKYxYMeSfI307M6-SHw-1; Fri, 25 Nov 2022 04:06:41 -0500 X-MC-Unique: wvBJKYxYMeSfI307M6-SHw-1 Received: by mail-wm1-f71.google.com with SMTP id j2-20020a05600c1c0200b003cf7397fc9bso2141244wms.5 for ; Fri, 25 Nov 2022 01:06:41 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=M7QTtRRbL7+Wq11xJkPqBXcSqP3SyIaC64ZZMRaftKc=; b=VpNwQUhNtce7v1wWuL8BhYFZOSMHzqyeptEgFAMB8iONywXz09cpLkMwE17tuVNXUB QmR+sTNWTTE5MFkKpxYiiK7gdyyIXJ+deVG36oxqniBauArKDcA4utKuNVPFnWnEksT9 P311KmsiXoXr6tDpKDtENKXOEB9/RVykaUTE2r3oKB7hFzTwwMrHukzrleqU5UBcqCx2 gV/mpJvjRT7vLTl3gSAy5ZSLWc2djSUvpjrbPZMEjiE43AhLAGIIU2qs/FGn/Opqbg9A 2wDz8xkamzV1rqDy0W8jOKtC292TTebuQOF9GExN7ajPJg+1AlYXKt2Srb8a3WssyG5b Y15A== X-Gm-Message-State: ANoB5pmNcGKw+/n7bzVKr9EUG4MGPYHf5h0Atf98n83a1T8GN5KX3Pag 7JmuKMcM8KPM7IKTjoWN/SuzBUxIRgi1ukzG4X9TQta7hB3MAvODUlMYlF4YUDYuzspsHGVs/Fs Xd+H1bh/f3FHbo15tuduD/TTOiIRl X-Received: by 2002:adf:e305:0:b0:236:6089:cc5e with SMTP id b5-20020adfe305000000b002366089cc5emr13634713wrj.118.1669367200524; Fri, 25 Nov 2022 01:06:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf5a4/3UUdnTCVdtjBQVAGdYcgL9eE9W0y2TcH3nZQvBy0bZE1SSPYRFB9nYPNcK7okvPIxpQA== X-Received: by 2002:adf:e305:0:b0:236:6089:cc5e with SMTP id b5-20020adfe305000000b002366089cc5emr13634702wrj.118.1669367200332; Fri, 25 Nov 2022 01:06:40 -0800 (PST) Received: from [192.168.1.130] (205.pool92-176-231.dynamic.orange.es. [92.176.231.205]) by smtp.gmail.com with ESMTPSA id j8-20020adff548000000b002367ad808a9sm3235859wrp.30.2022.11.25.01.06.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 01:06:38 -0800 (PST) Message-ID: Date: Fri, 25 Nov 2022 10:06:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH 03/24] drm/tests: helpers: Create the device in another function To: Maxime Ripard , Maxime Ripard , Maarten Lankhorst , Daniel Vetter , David Airlie , Thomas Zimmermann References: <20221123-rpi-kunit-tests-v1-0-051a0bb60a16@cerno.tech> <20221123-rpi-kunit-tests-v1-3-051a0bb60a16@cerno.tech> From: Javier Martinez Canillas In-Reply-To: <20221123-rpi-kunit-tests-v1-3-051a0bb60a16@cerno.tech> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: David Gow , Brendan Higgins , Greg Kroah-Hartman , Dave Stevenson , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, =?UTF-8?Q?Ma=c3=adra_Canal?= , linux-kselftest@vger.kernel.org, kunit-dev@googlegroups.com, linux-media@vger.kernel.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On 11/23/22 16:25, Maxime Ripard wrote: > We'll need in some tests to control when the device needs to be added > and removed, so let's split the device creation from the DRM device > creation function. > > Signed-off-by: Maxime Ripard > --- [...] > -static int dev_init(struct kunit_resource *res, void *ptr) > +struct device *drm_kunit_helper_alloc_device(struct kunit *test) > { > - char *name = ptr; > - struct device *dev; > - > - dev = root_device_register(name); > - if (IS_ERR(dev)) > - return PTR_ERR(dev); > - > - res->data = dev; > - return 0; > + return root_device_register(FAKE_DEVICE_NAME); I was going to ask if a platform device could be used here, to prevent the issue you mentioned the other day of root_device not having a bus set. But I see now that you are doing that change in the next patch. Reviewed-by: Javier Martinez Canillas -- Best regards, Javier Martinez Canillas Core Platforms Red Hat