Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp4028168ybi; Mon, 27 May 2019 09:42:21 -0700 (PDT) X-Google-Smtp-Source: APXvYqyg8p4vqUwNxYhkng8syLbtdOy/UUXGKTDGeH0u++CXWMtLaAYkmiHd/Q7+jmDP24G9N2U1 X-Received: by 2002:a17:902:bd95:: with SMTP id q21mr92263695pls.159.1558975341622; Mon, 27 May 2019 09:42:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558975341; cv=none; d=google.com; s=arc-20160816; b=sZgfBhoPUVevl2R5Et9X0yEvMC3hi+uoiJMQpjpXW7JKMekJ64ka6ioUyKuZRyPqyt lg5Ukn91ThnqtdcGKjTyHPaSJcOn2UWb3X9VgUBbR6RGUPEbNuGREeJhMvrOuUm++bzS OINvSup7GmRJTmySUmJWFksyDYbVdtVS7cFetffmuClJkoRso0bLMRxAEq7SpBRBCL53 38AZwFN5sblH9PC/IxGsLQdI8v8FfOyFDg9eLEJwZEDAWe9iY7P+4F+VlXz8/5yD7Mr+ NUQtpaXA9NbgRFQskHjR10yLT8ffwwNp1tMq6SOE4gVc20EIwaqdgKvvOgzTnm95sGWF PP6g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rKyCzranttTm8XPWZ088AThg9Hdd7C67ToC8/YpFmsA=; b=m5Wdly8vMuz0h/F6ULnWAqaJgsuuQWGQbWdjmcq3GzSNkRb914gdGR9JKDubhRtR0S F+IFH8VHrfExnvKEUq1v1Vzh4yB3vap2uVgNO8fIHQG/5nUfhxGfK2FZ9l8ds4ckGyPg BsDfYFVqocbUVAad+JK8DVjBh3342WmrFsZcDFMT3zNqlILN0Vl3yBpzirWQUH6wFdFN tFgdu7aKYiwB/9QVjr1ZbFQpBcYlk4GUMfOEfx+UkCJJjd/dfRPgeHSnuJmReuqTjVAe NjplvjUztfuzkqDR51vdmAiVSKJvMqGtSL/teo+0/y1F+VfpEDPZXsX57h81lzSEiql9 USVQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b="JoXnXy8/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f5si20103101pgg.19.2019.05.27.09.42.05; Mon, 27 May 2019 09:42:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@endlessm-com.20150623.gappssmtp.com header.s=20150623 header.b="JoXnXy8/"; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726857AbfE0QlB (ORCPT + 99 others); Mon, 27 May 2019 12:41:01 -0400 Received: from mail-qk1-f194.google.com ([209.85.222.194]:45735 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726397AbfE0QlB (ORCPT ); Mon, 27 May 2019 12:41:01 -0400 Received: by mail-qk1-f194.google.com with SMTP id j1so18647948qkk.12 for ; Mon, 27 May 2019 09:41:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=endlessm-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=rKyCzranttTm8XPWZ088AThg9Hdd7C67ToC8/YpFmsA=; b=JoXnXy8/tEruwLfqT68I0PkNoD1cUd9CL7ad86oPqCK6rLiNf/xJoYDiTBVLpt8Q8p Ma/XA/aqqIjPXD6wbPe2lDxoHnYHNhIpWNayaGl6UIGn8LP9CdRo2OO7bm0TyVFTKjlD PPm6skU32u13lfbHtntWF+heqdnsbsqiwIYaky0bYnzL/shrCN0Lz1Qt7m6TMthO2csj lynCL1SekUKP+mmafPD/TMcqSwtNL5hak7H+zimAeb/j3BlJ7HZoRWHqJgpG1vCKDT4f iwk/yVgfBK5hbk3aZy6NcHWDY648CG+ErIfzahLfiKcjB5qWGItSLVTy6gSCNIqdGALP 0PQQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=rKyCzranttTm8XPWZ088AThg9Hdd7C67ToC8/YpFmsA=; b=CzGrwVbmuCMH7L3Lr1b5Ew6wS9e6T0m4E+QB5sT53m9vNOF1u3esRzkfFOJPr9uixi Pf7nzPD3TkfbYj/m6/xDpV6iTHKOv5Ny+J/RaEPDN58DkESMOpyRaNL2u4Lg+YcoqTHG RwNb9eq+BnTeKg3YfZYBAlD6+Xs8AkWHPjk5z2BEMKfQGXZyCWYe1EF9rzf9MBr1pP+U eaKBQ9oxpaGNy8phCcEnCnbZMh/cHezMHuNkNtDCShKk6tWIdcfP1bgvQq3Ht7McsKA/ QC7vjBD7gl40D2Xuap6B1rJKOkjhTtI/KXYRVz7MtiCQJu5dP3WJuqQtaYx/ldRW/9L2 5bEA== X-Gm-Message-State: APjAAAVGurdkC4FU/pEizDx+JJ88g8g2HkYIoqjspwyahI+PJMrodX9K mL1OzJlAnTSSJXq7GB0Ah15vKR5j9zzm2P0Y4MH16w== X-Received: by 2002:ac8:8b2:: with SMTP id v47mr60717451qth.80.1558975260447; Mon, 27 May 2019 09:41:00 -0700 (PDT) MIME-Version: 1.0 References: <20190503072146.49999-1-chiu@endlessm.com> <20190503072146.49999-3-chiu@endlessm.com> In-Reply-To: From: Daniel Drake Date: Mon, 27 May 2019 10:40:49 -0600 Message-ID: Subject: Re: [RFC PATCH 2/2] rtl8xxxu: Add watchdog to update rate mask by signal strength To: Chris Chiu Cc: Jes Sorensen , Kalle Valo , David Miller , linux-wireless , netdev , Linux Kernel , Linux Upstreaming Team , Larry Finger Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 27, 2019 at 12:38 AM Chris Chiu wrote: > The -EBUSY is returned by the ieee80211_check_combinations() in the > ieee80211_check_concurrent_iface() function which is invoked each time > doing ieee80211_open(). > The ieee80211_check_combinations() returns the -EBUSY because of > cfg80211_check_combinations() will iterate all interfaces of different types > then checks the combination is valid or not, which in this case the number > of interface combination accumulated by cfg80211_iter_sum_ifcombos is 0 > when I'm trying to bring up the second station interface. Thanks for clarifying. I see, rtl8xxxu does not provide any iface_combinations so the default is to reject parallel interfaces. Given that we can now confidently say that multiple interfaces are not supported, I think that inside rtl8xxxu_add_interface() you could store a pointer to the vif inside the rtl8xxxu_priv structure (and clear it in rtl8xxxu_remove_interface). Plus for clarity, add a comment pointing out that only a single interface is supported, and make rtl8xxxu_add_interface() acually fail if we already had a non-NULL pointer stored in the priv structure. Then you can simplify the patch to remove the ugly storing of vif inside rtl8xxxu_watchdog. You can store the delayed_work in the main priv struct too, dropping rtl8xxxu_watchdog altogether. Daniel