Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3456663rwa; Tue, 23 Aug 2022 05:12:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR4OY6B45iI+FebfdzlFgZp5P+vkd7gJtaR4rovB8POwawozjaFgszpklM9XGGUDtwDik3wR X-Received: by 2002:a05:6402:3805:b0:43e:8335:3a2a with SMTP id es5-20020a056402380500b0043e83353a2amr3529483edb.296.1661256738405; Tue, 23 Aug 2022 05:12:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661256738; cv=none; d=google.com; s=arc-20160816; b=BwQ5EA3UG17KYCFVtlHF4CLZKo0779dOOrGZfH3rQ6dz9NTp8y4vGpQ+qA6Jtk9roU Q/78Ro7T0adgXg+7UrHMflNsU7JFXThyjADOJ6HNo7zbN60JRsS4Q25MSwmIxEyyK9Ab lYS6Px/FJa5jNBJPjkujl5MIshNl4whCWhPpD8AUos6F1t/7PeCMdqv68pnTMOCryFJM 2+YIQCnMjn4SZpj2tK+F2Y8dIDMpIi5aL5JtckkMvWyW9pYOeRY62h4c6P6CHiPRaQT2 sqO05pZOxCpvZVT0xSE8USDLMeAP/9N6Cp0pXjizHgMlX5L+OVtWM9VBwHrCbuB/1j40 o42Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=0CA02dyjPk6Sz7VphOxxmnZdNLUCQB1JIU7g+oFm2Rs=; b=NqxvGVrr/gMUNtBy+FVaPo733iBIhmDaHh4XJnlN2bLswzn2cOyS5/a+G5sPIweGwC hE1YPbnVtLNvDr1kaamRU+fwmIaaVqLt7f7KblIAzTmukyDBEtIuDkrQO5WONd5whFJi D4wzTzRjZrnuaIUW2p0s7eRDBkvL49TMXfI8GIUcND7fC2UWmieNqB/ho4vm9geestQ7 agiNrj2jeUE+P1WLsmcklYOY7HpWXgmogLQE1r+TgVjLFcSxrTgKQS8ptcWLWtsS8Bul 8GR9kNiD6dC/ERqme4tCyuc1CmkWUXgYSGO2K1LzptPxufRyc1AiFK2mms5Mbj3il79m 7QPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LwqUB8RQ; 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=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qo8-20020a170907874800b007317274bb0dsi1827277ejc.979.2022.08.23.05.11.53; Tue, 23 Aug 2022 05:12:18 -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=@linuxfoundation.org header.s=korg header.b=LwqUB8RQ; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1352982AbiHWKMw (ORCPT + 99 others); Tue, 23 Aug 2022 06:12:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45818 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352699AbiHWKGH (ORCPT ); Tue, 23 Aug 2022 06:06:07 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B70CEA3466; Tue, 23 Aug 2022 01:52:26 -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 ams.source.kernel.org (Postfix) with ESMTPS id 53177B81C35; Tue, 23 Aug 2022 08:52:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9AF00C433D6; Tue, 23 Aug 2022 08:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244744; bh=8FgyVo3x1/fTtKYfDm5v9sXbRI0V0BPvK2V8hKQPRrw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LwqUB8RQuPbB8gc5/yK7mJxvl31pg3l8ojeCxlUX4yR9bvv2YhgPF6z51h+9h3XoE pL+rqcUJmvm5vRjxGebHYC/ZkWC2VifTAqBs9FebYN7agZ4TcS/iduZBp79ilOTDIq kcruk/5IulhS3HEl+3f+N+DgW/M9mpLZ7fywZAJ4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Sergei Antonov , Vladimir Oltean , Jakub Kicinski Subject: [PATCH 5.15 142/244] net: dsa: dont warn in dsa_port_set_state_now() when driver doesnt support it Date: Tue, 23 Aug 2022 10:25:01 +0200 Message-Id: <20220823080103.908855403@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 From: Vladimir Oltean commit 211987f3ac734000ea1548784b2a4539a974fbc8 upstream. ds->ops->port_stp_state_set() is, like most DSA methods, optional, and if absent, the port is supposed to remain in the forwarding state (as standalone). Such is the case with the mv88e6060 driver, which does not offload the bridge layer. DSA warns that the STP state can't be changed to FORWARDING as part of dsa_port_enable_rt(), when in fact it should not. The error message is also not up to modern standards, so take the opportunity to make it more descriptive. Fixes: fd3645413197 ("net: dsa: change scope of STP state setter") Reported-by: Sergei Antonov Signed-off-by: Vladimir Oltean Reviewed-by: Sergei Antonov Link: https://lore.kernel.org/r/20220816201445.1809483-1-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski Signed-off-by: Greg Kroah-Hartman --- net/dsa/port.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) --- a/net/dsa/port.c +++ b/net/dsa/port.c @@ -111,11 +111,14 @@ int dsa_port_set_state(struct dsa_port * static void dsa_port_set_state_now(struct dsa_port *dp, u8 state, bool do_fast_age) { + struct dsa_switch *ds = dp->ds; int err; err = dsa_port_set_state(dp, state, do_fast_age); - if (err) - pr_err("DSA: failed to set STP state %u (%d)\n", state, err); + if (err && err != -EOPNOTSUPP) { + dev_err(ds->dev, "port %d failed to set STP state %u: %pe\n", + dp->index, state, ERR_PTR(err)); + } } int dsa_port_enable_rt(struct dsa_port *dp, struct phy_device *phy)