Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp542599ybt; Mon, 6 Jul 2020 16:05:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxc8GJazf+s6SY49EbHj6gfS6dROkoYpxIPND6ncTwe+rzCpdgZj4gKrBJEMFLwdHs+pKQc X-Received: by 2002:a50:9b5d:: with SMTP id a29mr55786411edj.68.1594076750968; Mon, 06 Jul 2020 16:05:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594076750; cv=none; d=google.com; s=arc-20160816; b=Dti+bWa3sNOjENPAPAXEI5h3EzFQ55wtv3lsUFWWcbRFvorQ4ld8smeR3T/4oH2nFd nhbM64Z8RDd+RjHiOwWbzJ++sozOmiwwM4BlTrrBG7Sh0X3n6Vm4ftclqr5V2uxdpwO9 gcQaB4zMPVR2xJqecKYinc9Xd0nteSfpClH8xmL9t8VUunUuenOqkjBPRUHYct2xeIl0 d2x1dUodTeSUvFBxF5q/AqM0obRY3LMDDtbJVpv0cMYBqPtT16C+Q6vok0XdOZDpVKhz B/arzN0GcW7eUaLXIGbiLuuUe7lxVc/jYDFQC/Ykr6FA8DDY4cx6eqpMGO5XrHACH4Vd b3aQ== 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=zwvSRzBV5C3IE502UBXn+gfuwgJFq0fNK7XpsiBlD8s=; b=QSQx9PiMXuPGP2Oynlv5Yf6BoulTugfUXbrgllN50qVcxwUl7Ewd8vlXsr/Un4jpel gZacTBVErrrckUsaCfka5gN1dGS3YRm+cdxao4V4m4go2C86CODQxsPprGQuac67HNtK ZB/812E4uibV0RvCNygfuDyO4L/7rzvLITHdcVKRhLzHZCQ85WlmRqmyVIdbtdatte4v 53c2qUAODugl/Jxt2rQKvo2OQnA+2ZS0TPAGK4pmT6yiuk9/pnGFq3AoDrhroI+BDv+u sdyGBbxg0vGoa86NN5xqYt2x8T/b2bykDIqHMBtHQTMMT25DPi1Ry0LLObDymfpsUFbD /Hqw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WzaHXK1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p25si13912896edx.347.2020.07.06.16.05.28; Mon, 06 Jul 2020 16:05:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WzaHXK1l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727844AbgGFXFC (ORCPT + 99 others); Mon, 6 Jul 2020 19:05:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727058AbgGFXFC (ORCPT ); Mon, 6 Jul 2020 19:05:02 -0400 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 29D0CC061755; Mon, 6 Jul 2020 16:05:02 -0700 (PDT) Received: by mail-il1-x144.google.com with SMTP id x9so34425428ila.3; Mon, 06 Jul 2020 16:05:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zwvSRzBV5C3IE502UBXn+gfuwgJFq0fNK7XpsiBlD8s=; b=WzaHXK1l7TYOc9cDqHVz5wusSgSV3aGBLLbf+jhU4PvIF/NGvXoe8U2GtAf91GHxQA HlRUf24MOUWi23HaIhJUBXnoa9rFrjNECWA6tmeYXdK/YT7DYVV3O2sTedBfKvJm5aZ/ TPT8cLo0Wvy5BLxTAg1dG8cyagz61B1VENl53gHA2zan5D6vaFbGxJAFn+LaLanJ8tL3 I+1k4A6tvrjQR13B96md8ieI0n6oiz9ece0tj9E8sZEp+cWOlHd7DkEGKOf5yg7ubker BgfVuoN+nHwyEJTw8j5EN0qHyRFNWjM24Vuhwqt0N/pC01mx2AhaQGbWVtbao8v7BjHC 5Dig== 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=zwvSRzBV5C3IE502UBXn+gfuwgJFq0fNK7XpsiBlD8s=; b=O54mxq+SyjKBH1h8EUaMPXAhxzvcxw+q1MB+GPQ0TtUpswZUkQvpFo7hhTS4+suErx 9ey1WL8E71+qTXLjmtOug5bvhJssppY84QzF0wDpozMbPp3BACJ1RJQf+hHabXFJDt8y sF78TowUcAY1ZU3autuFZTtKflmOO7dBqWY1nq7YhGKkKVu7VDgLeh7rICFBqPX/Wvqp 041LGpYRlgWtJMaH2dlsn5DE11EudDSL4HDlmvgetigodCCbqqo4wxiaiLEPer7KmlXi iInuXr+UVqmCBATWPSbsdftHIMaK/CksPnt4l0AuVHyq1zJd5PAV4pfzGtDwCERHNzF5 wPYw== X-Gm-Message-State: AOAM530CWhDAMdKZ5FYp6QCUTxX0RWxpUYBWDcZwxTmsX7z9Lcc+BMdj 4UpSxughWYJxmEg15yh/C6F4jF3LPziMqkopdJ9/V0YO0og= X-Received: by 2002:a92:aa92:: with SMTP id p18mr32591747ill.199.1594076701537; Mon, 06 Jul 2020 16:05:01 -0700 (PDT) MIME-Version: 1.0 References: <20200706204224.GW1551@shell.armlinux.org.uk> In-Reply-To: <20200706204224.GW1551@shell.armlinux.org.uk> From: Chris Healy Date: Mon, 6 Jul 2020 16:04:50 -0700 Message-ID: Subject: Re: [PATCH] net: sfp: Unique GPIO interrupt names To: Russell King - ARM Linux admin Cc: Andrew Lunn , Florian Fainelli , Heiner Kallweit , "David S. Miller" , kuba@kernel.org, netdev , linux-kernel 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, Jul 6, 2020 at 1:42 PM Russell King - ARM Linux admin wrote: > > On Mon, Jul 06, 2020 at 12:38:37PM -0700, Chris Healy wrote: > > Dynamically generate a unique GPIO interrupt name, based on the > > device name and the GPIO name. For example: > > > > 103: 0 sx1503q 12 Edge sff2-los > > 104: 0 sx1503q 13 Edge sff3-los > > > > The sffX indicates the SFP the loss of signal GPIO is associated with. > > > > Signed-off-by: Chris Healy > > This doesn't work in all cases. > > > --- > > drivers/net/phy/sfp.c | 6 +++++- > > 1 file changed, 5 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/net/phy/sfp.c b/drivers/net/phy/sfp.c > > index 73c2969f11a4..9b03c7229320 100644 > > --- a/drivers/net/phy/sfp.c > > +++ b/drivers/net/phy/sfp.c > > @@ -220,6 +220,7 @@ struct sfp { > > struct phy_device *mod_phy; > > const struct sff_data *type; > > u32 max_power_mW; > > + char sfp_irq_name[32]; > > > > unsigned int (*get_state)(struct sfp *); > > void (*set_state)(struct sfp *, unsigned int); > > @@ -2349,12 +2350,15 @@ static int sfp_probe(struct platform_device *pdev) > > continue; > > } > > > > + snprintf(sfp->sfp_irq_name, sizeof(sfp->sfp_irq_name), > > + "%s-%s", dev_name(sfp->dev), gpio_of_names[i]); > > sfp_irq_name will be overwritten for each GPIO IRQ claimed, which means > all IRQs for a particular cage will end up with the same name. > sfp_irq_name[] therefore needs to be an array of names, one per input. Good point. I'll add the necessary support to deal with this case and test on my side with a hacked up devicetree file providing some additional GPIOs and include this in the next version of the patch. > > Thanks. > > -- > RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ > FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last!