Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp1239949rwb; Sat, 5 Aug 2023 10:02:58 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEW824FWA1QBjGu4giQ1aXAwkJ5PGhJrUrXl9KP84EB0jw/Z7QAFeG5C0XXzXdyGHdgwsuE X-Received: by 2002:a05:6a00:1993:b0:676:76ea:e992 with SMTP id d19-20020a056a00199300b0067676eae992mr6606125pfl.5.1691254978396; Sat, 05 Aug 2023 10:02:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691254978; cv=none; d=google.com; s=arc-20160816; b=j4Azxdt3OReNCXFev8wwUm3bTqm+FBh+3/JCAnvbhIC1dkdA5gqUsnrCFk9kAfJN80 NX/Gy6A7QNpRpFhfpuxRYxGla0AGPTeHTrShgkE0d4uHfn0uik82e0N5+hrTnOB8sB39 rHNDGSvRuXNNkSlOYSb2kSIp2nvk7B6ETEq3s/i6s58poAuMCvpiMLMAhFacCyZksFhN Mv+eNdYcBfqmOouLzONNS8cJPNHnqwKaBccgBhzTsPrGPaWYIDpLFv22Lsxe0zeAe9aP 66yAHiSj7gRT4Tjt5xpcFSwztE3T5nfkmOOej66+2N4isXSrW38uyt9YyTVyi8DuI89+ d2VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:sender:dkim-signature; bh=EyjSidwJSs1+lh6cGsr1E2Ndio59AcP0tZxWu5XP/W0=; fh=o5ykWxn5+S+AsktlqUZr76CWoM8CzBjq6hG4r6G9fa0=; b=iUeA2GzC4BeB/Qogo+2BVBt24gNY91muxzt3Y25nx7qybLGH+Xb2mBsC7NED+lRzVr w09atnxv8vYy8q7GIN5qmvFPmwhsyTyJ857E8xjiK2ldGG/XdhhXNadal8VSxyOlEwgs QExXvakdfJWN9WXSuqTry4QdTpanI2Dst/B+yxTm7DXHmIbyBJIv+TU6PuIMlptBd/iL CpHSZg1q8/JjDlodduW+867eeY1PE7FTfBoMckMod/t2isFwpDAqYh897BII6D/8orn/ wlWjJt55Bfe1ry0Ick3ZypzFsFPUlr3sDLNxkGVz0y2vo2fWS6lQSbGURwC4YLY1Ervm /VRQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=SwGTRB6m; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cp26-20020a056a00349a00b0067c03d5624csi3385837pfb.293.2023.08.05.10.02.45; Sat, 05 Aug 2023 10:02:58 -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=@gmail.com header.s=20221208 header.b=SwGTRB6m; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229708AbjHEPux (ORCPT + 99 others); Sat, 5 Aug 2023 11:50:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229436AbjHEPuw (ORCPT ); Sat, 5 Aug 2023 11:50:52 -0400 Received: from mail-pf1-x42b.google.com (mail-pf1-x42b.google.com [IPv6:2607:f8b0:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1E6E0E51; Sat, 5 Aug 2023 08:50:51 -0700 (PDT) Received: by mail-pf1-x42b.google.com with SMTP id d2e1a72fcca58-686f1240a22so2949707b3a.0; Sat, 05 Aug 2023 08:50:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691250650; x=1691855450; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=EyjSidwJSs1+lh6cGsr1E2Ndio59AcP0tZxWu5XP/W0=; b=SwGTRB6mGgoav+Ytvmsxez0OV3sRBvyvF/lroCiX9zTEmqyxbW2Aiy0y98/HZ753Cx GbzqHLGA3fAtSiR/CJFWo0FsUkIeF099zQngmpC8YYEE1PHmY6zCeLrXmdFi3EJJ4gnz iPdXnKY2zdRXrcNTZl6nvSRtAdhf/xcDiJWarsIB9u/SPVsQNkdsRSPEhKOYhrTVq3xS /pTWCeh6zzVhVvcykV019pKQRMX1fcLKL7qDmQoC39ZexEVMJKM05leyaC/U6HjJAyUE b88wXnjwx9t7hRIedpuD2rkjr1LtyN/WAflcQzpyQPRxtxLKIx6bGjmsg3wly6lPJLog uAkA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691250650; x=1691855450; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=EyjSidwJSs1+lh6cGsr1E2Ndio59AcP0tZxWu5XP/W0=; b=OMb8ZekpVWx+umVImEmTITwHFcGFd4KhvBsVavpRCwUkKeYDNeIPyOyXeNofAIx7MY BhL+hKZkZR20BDdGbaK+liuQxLZZIL4lRie6mbras07Bw+HuwfvIJSf/1mam9s/SiPCy 1JfvJ3B62ghotJ2liC1wBHYc5K0tLOaS/IGpC/z0Nywhc+NUQN2MMi3RPIB8vmSR4+r9 ViHc2bhHr3uPQnSUaN0Nca0oL7AON7ii8lv6au0Xwi1wOEo9I07mY19ONEdhmsmqStLK MUqpVM73pt1YDJyeicLFRPoCG5irakUf4SZHXRes8I3sftfSqUL0Z/aH/Ojcz+Hl/Wev 77wA== X-Gm-Message-State: AOJu0YzHmqtPSQtN2/RaX7EIA7I7KtmYQp7fEAQ7A0SyxyIqv1Kix9oU KUKQT6r/EkbR2ObjAfbKGpc= X-Received: by 2002:a05:6a00:3990:b0:67a:553d:3bc3 with SMTP id fi16-20020a056a00399000b0067a553d3bc3mr5999354pfb.6.1691250650338; Sat, 05 Aug 2023 08:50:50 -0700 (PDT) Received: from ?IPV6:2600:1700:e321:62f0:329c:23ff:fee3:9d7c? ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id x10-20020a056a00270a00b0068796c58441sm3302401pfv.60.2023.08.05.08.50.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Aug 2023 08:50:49 -0700 (PDT) Sender: Guenter Roeck Message-ID: Date: Sat, 5 Aug 2023 08:50:48 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH v2 1/1] serial: core: Fix serial_base_match() after fixing controller port name Content-Language: en-US To: Tony Lindgren Cc: Greg Kroah-Hartman , Jiri Slaby , Andy Shevchenko , Andy Shevchenko , Dhruva Gole , =?UTF-8?Q?Ilpo_J=c3=a4rvinen?= , John Ogness , Johan Hovold , Sebastian Andrzej Siewior , Vignesh Raghavendra , linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, kernel test robot References: <20230803071034.25571-1-tony@atomide.com> <0e1bc27d-dc84-473d-bfdf-db0743c5d64a@roeck-us.net> <20230805044910.GJ14799@atomide.com> <20230805114846.GK14799@atomide.com> From: Guenter Roeck In-Reply-To: <20230805114846.GK14799@atomide.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, NICE_REPLY_A,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=no 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 8/5/23 04:48, Tony Lindgren wrote: > * Guenter Roeck [230805 10:50]: >> On 8/4/23 21:49, Tony Lindgren wrote: >>> * Guenter Roeck [230804 21:42]: >>>> kobject: kobject_add_internal failed for serial8250.0:0.0 with -EEXIST, don't try to register things with the same name in the same directory. >>>> serial8250 serial8250.0: unable to register port at index 1 (IO2f8 MEM0 IRQ3): -17 >>>> sysfs: cannot create duplicate filename '/devices/platform/serial8250.0/serial8250.0:0/serial8250.0:0.0' >>> >>> The issue above should be fixed with commit: >>> >>> bbb4abb1bcfb ("serial: 8250: Reinit port_id when adding back serial8250_isa_devs") >>> >> >> No. I tested the tip of tty-linus (v6.5-rc4-9-gdfe2aeb226fd) which includes >> above commit, but still see the problem. sparc images also still stall after >> the "cannot create duplicate filename" message. >> I bisected the sparc problem - it also bisects to commit d962de6ae51f. >> >> The problem affects all mips boot tests, all sparc boot tests, as well as >> arm sx1, ppc bamboo and sam460ex emulations. As far as I can see, those >> call serial8250_register_8250_port() without calling serial8250_setup_port() >> and thus don't set port_id. I am only testing a few of those, so I strongly >> suspect that all similar callers of serial8250_register_8250_port() are >> affected (i.e., almost all of them) if they register more than one serial port. > > OK thanks for explaining. So we need to initialize port->port_id for the > multi-port instances to avoid being stuck with the port->line index. I'll > take a look. > > I wonder if we should just revert d962de6ae51f for now. It needs to be > tested to see if something else also needs reverting though. > It is actually more complicated like that. Adding some debug into, I get the following from a mips boot. Turns out that serial8250_setup_port() is actually called. ... ####### serial8250_setup_port: index 0 ####### serial8250_setup_port: index 0 returning 819a5ab8 ####### serial8250_setup_port: index 1 ####### serial8250_setup_port: index 1 returning 819a5d20 ####### serial8250_setup_port: index 2 ####### serial8250_setup_port: index 2 returning 819a5f88 ####### serial8250_setup_port: index 3 ####### serial8250_setup_port: index 3 returning 819a61f0 ... #### serial8250_register_8250_port: uart=819a5ab8 #### serial8250_register_8250_port: uart=819a5ab8 port_id=0 line=0 ... #### serial8250_register_8250_port: uart=819a5d20 #### serial8250_register_8250_port: uart=819a5d20 port_id=1 line=1 sysfs: cannot create duplicate filename '/devices/platform/serial8250.0/serial8250.0:0/serial8250.0:0.0' So line and port_id are both set, but the created sysfs attribute is still duplicate. I'll do some more debugging. Guenter