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=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 8B36FC43381 for ; Fri, 29 Mar 2019 19:21:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 52DE5218A3 for ; Fri, 29 Mar 2019 19:21:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729832AbfC2TVp (ORCPT ); Fri, 29 Mar 2019 15:21:45 -0400 Received: from mga06.intel.com ([134.134.136.31]:32135 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729652AbfC2TVp (ORCPT ); Fri, 29 Mar 2019 15:21:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 Mar 2019 12:21:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.60,285,1549958400"; d="scan'208";a="135979530" Received: from dorilex.jf.intel.com (HELO dorilex) ([10.54.70.79]) by fmsmga008.fm.intel.com with ESMTP; 29 Mar 2019 12:21:44 -0700 From: Leandro Dorileo To: Cong Wang , Leandro Dorileo Cc: Linux Kernel Network Developers , Jamal Hadi Salim , Jiri Pirko , "David S . Miller" , Vinicius Costa Gomes , Florian Fainelli , vedang.patel@intel.com, andre.guedes@intel.com Subject: Re: [PATCH net V5 1/2] net/sched: taprio: fix picos_per_byte miscalculation In-Reply-To: References: <20190329001906.18594-1-leandro.maciel.dorileo@intel.com> <20190329001906.18594-2-leandro.maciel.dorileo@intel.com> Date: Fri, 29 Mar 2019 12:20:24 -0700 Message-ID: <87bm1t1o93.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, Cong Wang writes: > On Thu, Mar 28, 2019 at 5:20 PM Leandro Dorileo > wrote: >> +static int taprio_dev_notifier(struct notifier_block *nb, unsigned long event, >> + void *ptr) >> +{ >> + struct net_device *dev = netdev_notifier_info_to_dev(ptr); >> + struct taprio_sched *q; >> + struct net_device *qdev; >> + >> + ASSERT_RTNL(); >> + >> + if (event != NETDEV_UP && event != NETDEV_CHANGE) >> + return NOTIFY_DONE; >> + >> + spin_lock(&taprio_list_lock); >> + list_for_each_entry(q, &taprio_list, taprio_list) { >> + qdev = qdisc_dev(q->root); >> + if (qdev == dev) { >> + taprio_set_picos_per_byte(dev, q); >> + break; > > Is it safe to call __ethtool_get_link_ksettings() with spinlock held? > I mean is it blocking? > > Please audit all the dev->ethtool_ops->get_link_ksettings(), > I just look at a few of them, it seems good. Yep, you're right. There are some get_link_ksettings implementations that will lock a mutex. I'm changing the implementation to avoid that. Thanks for catching this up. -- Dorileo