Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp758683rwb; Mon, 26 Sep 2022 05:36:50 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7R7E+1i7cA4lFqwovKlBgLmB7XHYNPSu7v7JAJ3VXHjdaKUvakgKYfymQqXf/V1/QwuArc X-Received: by 2002:a17:906:6a23:b0:782:e8:1b7d with SMTP id qw35-20020a1709066a2300b0078200e81b7dmr17968458ejc.127.1664195810069; Mon, 26 Sep 2022 05:36:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1664195810; cv=none; d=google.com; s=arc-20160816; b=O5Kjr5VpDPyAyUxgSmmYuf01KkVc54iS5MF4pxW1YIxB1tRSPF2Mn40DU98E1NOe1i b4H79klfKWZKVniaesYxtcsvBVgb7QKl860U5h1lt78UvOne/sopwb+6i0E1xTsLAUS5 4jLCUaF9jaCJynhGoXDtJnjXnSHBJB0PXNlCVjwwgu/8LEwz0cpX+LE8xcIcIze86GvL wC5oHIbLDUfoqYlQh04Wduwy1j537j0kAgNIINbLUIeuNbeY70WJVym841t/tv0SXc7U x+yJsJ0roLEFfJD7wZyUBDW73xM6Ac2HBnQCWTuYQe1WnruKae5rndvWeo37LAEynrPo 4zvg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=mZ2GcydiOb2dbfxbXsFozyRlZcsTL11qErzMDgnnUVQ=; b=Yve+pCGobXwK9dda6mue5qxFhRHHip09hZogDQ3QMImfiOboiCaqIOk3mNh7X4WAv8 PhjihQX7bLCjyrzXblpji+vPyTDZXHUvfOoyBrXcU5gekAMXJOyV4A8lF8sWp07GTnsn HUc0GTgscgo6RNGS3p3LH6j7Ks/oecMck/FFfaZXHKvJQyNIQfUZ8/6H9YM2XCqz5hvi a0ElXNONZWpl5yZEvLfQ93pwMgmQVxTwLiTaAIHKxP8tFKosnXRfPm+vmMx6DaNPq3L7 bWBbFyfim22bc4r0I2u+juQmne7gAbUzYbSIz5u8DAIzHSjWa0qC+j7HRsh5ZMH03ahp KMKA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NmQHGprz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s7-20020a50ab07000000b00446dc8f5e44si15756048edc.243.2022.09.26.05.36.24; Mon, 26 Sep 2022 05:36:50 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=NmQHGprz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234886AbiIZKJu (ORCPT + 99 others); Mon, 26 Sep 2022 06:09:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234765AbiIZKJB (ORCPT ); Mon, 26 Sep 2022 06:09:01 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28AF44663D for ; Mon, 26 Sep 2022 03:09:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id B2C2560B7B for ; Mon, 26 Sep 2022 10:09:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EF84DC433C1; Mon, 26 Sep 2022 10:08:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1664186940; bh=gVXyyA5IAbFfV7vJ/QOv0MxnXnumH7DZXircDqF5Z70=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NmQHGprzaXKvnrjt+vF3CfG0A6mz05d101IvDpP0S0KlWA/HxV02WBqm7aJ/85fKO 776eQFUJPgC7L8koUGoInyWAn2pq3tjO2Wuq1tJaAE3lYQNW1w0fnHhtUvXbulDefb HXgalDIaN+/D6rCOCQ2fpGYC9oBSD55ApXAp20ZQhWiCbmquWs8KVP+pwjZ874O/Ku eUR+d8MNkrIlEGjwBKad02tb2rHugUHFzpxGvXz6sxZBRE/XGdFqlGxB22WM2YuCMy SBtGpekUg9s3HWGnMKKU0pfGald1AlS+OoImzYUVydBIrgF2Vviyt86f8+cK+lbcJ8 KLcwsluiqzqCQ== Received: by pali.im (Postfix) id 00CE28A3; Mon, 26 Sep 2022 12:08:56 +0200 (CEST) Date: Mon, 26 Sep 2022 12:08:56 +0200 From: Pali =?utf-8?B?Um9ow6Fy?= To: Christophe Leroy Cc: Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Scott Wood , Sinan Akman , "linuxppc-dev@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH 5/7] powerpc/85xx: p2020: Define just one machine description Message-ID: <20220926100856.klwmxgujr7nv4qik@pali> References: <20220819191557.28116-1-pali@kernel.org> <20220819191557.28116-6-pali@kernel.org> <638a2f98-5c23-85ba-c835-bce276312182@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <638a2f98-5c23-85ba-c835-bce276312182@csgroup.eu> User-Agent: NeoMutt/20180716 X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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 On Monday 26 September 2022 10:02:47 Christophe Leroy wrote: > > +static int __init p2020_probe(void) > > { > > - if (of_machine_is_compatible("fsl,P2020RDB-PC")) > > - return 1; > > - return 0; > > + struct device_node *p2020_cpu; > > + > > + /* > > + * There is no common compatible string for all P2020 boards. > > + * The only common thing is "PowerPC,P2020@0" cpu node. > > + * So check for P2020 board via this cpu node. > > + */ > > + p2020_cpu = of_find_node_by_path("/cpus/PowerPC,P2020@0"); > > + if (!p2020_cpu) > > + return 0; > > This looks odd. I though all probe were using the compatible, and in > fact I have a series in preparation that drops all > of_machine_is_compatible() checks in probe functions and do it in the > caller instead, after adding a .compatible string in the machine > description. > > Is there really no compatible that can be used for all p2020 ? Really. There is none. I have looked into all available P2020 DTB files (either externals passed by bootloader or kernel in-tree) and there is no common compatible string. The only "common" thing is cpu node, how I implemented it int this patch series. And same issue is with boards with P101x and P102x DTB files.