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.0 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 3D6CEC7618B for ; Thu, 25 Jul 2019 13:42:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0768722C7B for ; Thu, 25 Jul 2019 13:42:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="aPB87YVN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390069AbfGYNmP (ORCPT ); Thu, 25 Jul 2019 09:42:15 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:37230 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390008AbfGYNmP (ORCPT ); Thu, 25 Jul 2019 09:42:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=FRNh0wyTll51oisS0SnbVxCH0zgOEhtHJm/E9K985lY=; b=aPB87YVNjmJlG+Z5bYRBRHM1Pk zWUYXjGbkiLCE++8uAOvtSNCBdvX0QWvo6N3T8ToTcESYuSfDK/JzYKDtgv/aRdj1/L2wQFMtfa3X ao9Xly3j7oYZMRiHbdO0xgJYm6IIUOllt/8QKaRg2QRDpoGS3UDGheNFNyoAcVuE/C6E=; Received: from andrew by vps0.lunn.ch with local (Exim 4.89) (envelope-from ) id 1hqe0X-0006Dy-OX; Thu, 25 Jul 2019 15:42:09 +0200 Date: Thu, 25 Jul 2019 15:42:09 +0200 From: Andrew Lunn To: Chen-Yu Tsai Cc: Vivien Didelot , Florian Fainelli , "David S . Miller" , Chen-Yu Tsai , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] net: dsa: Check existence of .port_mdb_add callback before calling it Message-ID: <20190725134209.GE21952@lunn.ch> References: <20190724034702.21212-1-wens@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190724034702.21212-1-wens@kernel.org> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 24, 2019 at 11:47:02AM +0800, Chen-Yu Tsai wrote: > From: Chen-Yu Tsai > > With the recent addition of commit 75dad2520fc3 ("net: dsa: b53: Disable > all ports on setup"), users of b53 (BCM53125 on Lamobo R1 in my case) > are forced to use the dsa subsystem to enable the switch, instead of > having it in the default transparent "forward-to-all" mode. Hi Chen-Yu I would do the check earlier, at the beginning of dsa_switch_mdb_add(). It is then similar to dsa_switch_mdb_del(). Andrew