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=-2.3 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,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 4D139C432C3 for ; Wed, 27 Nov 2019 09:07:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 211712070A for ; Wed, 27 Nov 2019 09:07:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=c-s.fr header.i=@c-s.fr header.b="U/x/1ocr" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726204AbfK0JHk (ORCPT ); Wed, 27 Nov 2019 04:07:40 -0500 Received: from pegase1.c-s.fr ([93.17.236.30]:19822 "EHLO pegase1.c-s.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726149AbfK0JHk (ORCPT ); Wed, 27 Nov 2019 04:07:40 -0500 Received: from localhost (mailhub1-ext [192.168.12.233]) by localhost (Postfix) with ESMTP id 47NFKP4697z9tydt; Wed, 27 Nov 2019 10:07:37 +0100 (CET) Authentication-Results: localhost; dkim=pass reason="1024-bit key; insecure key" header.d=c-s.fr header.i=@c-s.fr header.b=U/x/1ocr; dkim-adsp=pass; dkim-atps=neutral X-Virus-Scanned: Debian amavisd-new at c-s.fr Received: from pegase1.c-s.fr ([192.168.12.234]) by localhost (pegase1.c-s.fr [192.168.12.234]) (amavisd-new, port 10024) with ESMTP id Nz-sjEBQ0h5w; Wed, 27 Nov 2019 10:07:37 +0100 (CET) Received: from messagerie.si.c-s.fr (messagerie.si.c-s.fr [192.168.25.192]) by pegase1.c-s.fr (Postfix) with ESMTP id 47NFKP338Nz9tydr; Wed, 27 Nov 2019 10:07:37 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=c-s.fr; s=mail; t=1574845657; bh=rsONdo+K8BfuC4IMj+G4+FoVbNW+lryTfssc6iwUHnE=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=U/x/1ocrBg9rQRyfU7slf0TKlNC5/YYnvWV3Q9GZTD/O+SiJXuba8FftrdaeUtBcB /W8qqf0/iOLG7JIze7r0gNZgZQyLOIfZE3m9kNCvpwNYpbrBQSoBdi8VujJ55W3vUb cP6bVwmeNQ2JGLbPLB+iP5q/J6+MJWlwO+JXb5yY= Received: from localhost (localhost [127.0.0.1]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 701D58B844; Wed, 27 Nov 2019 10:07:38 +0100 (CET) X-Virus-Scanned: amavisd-new at c-s.fr Received: from messagerie.si.c-s.fr ([127.0.0.1]) by localhost (messagerie.si.c-s.fr [127.0.0.1]) (amavisd-new, port 10023) with ESMTP id HGo6Um4gICu9; Wed, 27 Nov 2019 10:07:38 +0100 (CET) Received: from [192.168.4.90] (unknown [192.168.4.90]) by messagerie.si.c-s.fr (Postfix) with ESMTP id 1BE108B770; Wed, 27 Nov 2019 10:07:38 +0100 (CET) Subject: Re: Boot failure with 5.4-rc5, bisected to 0f0581b24bd0 ("spi: fsl: Convert to use CS GPIO descriptors") To: Linus Walleij Cc: linux-spi , Mark Brown , Fabio Estevam , "open list:GPIO SUBSYSTEM" References: <1efb797c-e3c1-25a4-0e81-78b5bbadb355@c-s.fr> <3c79a8b9-65e4-bfc9-d718-b8530fe1e672@c-s.fr> From: Christophe Leroy Message-ID: <582b5ccf-8993-6345-94d1-3c2fc94e4d4f@c-s.fr> Date: Wed, 27 Nov 2019 10:07:37 +0100 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org Le 27/11/2019 à 09:26, Linus Walleij a écrit : > On Tue, Nov 26, 2019 at 8:14 PM Christophe Leroy > wrote: > >>> Digging a bit further, I see that devm_spi_register_master() fails in >>> spi_register_controler() because ctlr->num_chipselect is 0 > > Aha, I see what the problem is I think. The old code for mpc8xxx had this: > > ngpios = of_gpio_count(np); > ngpios = max(ngpios, 0); > if (ngpios == 0 && !spisel_boot) { > /* > * SPI w/o chip-select line. One SPI device is still permitted > * though. > */ > pdata->max_chipselect = 1; > return 0; > } > (...) > master->num_chipselect = pdata->max_chipselect; I confirm it can't be that .... here I get ngpios = 9 > > But the new code in the core has this: > > nb = gpiod_count(dev, "cs"); However the above is likely the issue. The property in the DTS is 'gpios' and not 'cs-gpios'. According to commit e3023bf80639 ("gpio: of: Handle the Freescale SPI CS"), it shouldn't be needed to rename it, and that's also what I understand from commit log of 0f0581b24bd0 ("spi: fsl: Convert to use CS GPIO descriptors") > ctlr->num_chipselect = max_t(int, nb, ctlr->num_chipselect); > > So it relied on inspecting the device tree and set this to 1 > if it didn't find anything. But it should find something. Christophe > > I will send a patch to test! Is it worth testing your new patch ? Christophe