Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3403674pxk; Mon, 28 Sep 2020 17:16:24 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyl7lxxqOkKJPLIc5voq5on07bONBRlzQXxTFGju2dpmoi6dn2DgEDxHzLuaybKgRSEioLR X-Received: by 2002:a17:906:3ad0:: with SMTP id z16mr1300450ejd.193.1601338584772; Mon, 28 Sep 2020 17:16:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601338584; cv=none; d=google.com; s=arc-20160816; b=Hbape/lqhof5sFTOO63rxAdONjOEg/vT/wlmF2U0Owr9XnB7/L1ikVKk28mXJzVhOv pzgQLROxB+6KLgjHYahDpO0FYJH8yP7DJ0NAOqlYS18c9Lw8aQ/94wcfX4WOhhwd+Xel cmhLhuP1J30bwgt6jGuPeGwC0XhYTPIZ9pXXZwo1SCd8GFyjO69pjEnurd9HQ5mcywmV R/1qZNtd7Xcy/NgvN5K5KfMGgvedsIqZtg+KUliYyrcd15ko7gaqKc1o+9D7utGMLk7h LMoCY7xq8Wkg6EB46SWk/Lgvz8GaEBOwyNjZCWFMRmfmfeRKNDDiT3zzTQBU0i8+kxLS U6xQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from:dkim-signature; bh=IjqKX8Tpz+x5CJIuHogB2gYEP9bHrmFcpxb2113wLDk=; b=KBoB27m4P7i227CVofZaTxdE34YhOzwz7YZI5tmOEbRVxQWfD6qRr4AHz849gwCaHI 9l9GYRsMN6BmjVYa06K1QrKUCGoxg47TexNk8Vy49ZmeCv+tzVhGjo1e96D6x3P6mnY2 DC65R8MH1vtlF9a4rxzdhZRIQwn0OwtYMM/U5Ba6Qoo7om4uqnvLt6ibbIjfCX37QnAV E6Al87N0D50vsZXtq4IGVOZNKFzGXziSEjbo3MseefakiP8GNRl7fsi1a53fARst3Fus BRIstpBpOcNv93lDVRqw2uYL63gZ2oCYac+gOjPJin32bhrlxFSOIa9e6aErL/WzDa2K x8nA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@broadcom.com header.s=google header.b=SiSE5v6T; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k4si1689733edq.351.2020.09.28.17.15.57; Mon, 28 Sep 2020 17:16:24 -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=@broadcom.com header.s=google header.b=SiSE5v6T; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=broadcom.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727277AbgI2ANZ (ORCPT + 99 others); Mon, 28 Sep 2020 20:13:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727269AbgI2ANY (ORCPT ); Mon, 28 Sep 2020 20:13:24 -0400 Received: from mail-pg1-x564.google.com (mail-pg1-x564.google.com [IPv6:2607:f8b0:4864:20::564]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 70CD5C0613D4 for ; Mon, 28 Sep 2020 17:13:24 -0700 (PDT) Received: by mail-pg1-x564.google.com with SMTP id d13so2365808pgl.6 for ; Mon, 28 Sep 2020 17:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=broadcom.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IjqKX8Tpz+x5CJIuHogB2gYEP9bHrmFcpxb2113wLDk=; b=SiSE5v6TYBE/LLuHp8vffz3RiPljdJim6TLrnrJuiqd56jbMLWS3J1NABjLp0ddBTX KaQav19uy1BEKIkMz5hl7W7p+Tpv+jwq+O8VRtwRs67PV4nBlzYrVUeBEjr1+K3CR9gV qJFknoysUUK3Bvdiy6bpz8Zf4hoPneLOmzn7w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=IjqKX8Tpz+x5CJIuHogB2gYEP9bHrmFcpxb2113wLDk=; b=PrxCvjhhdGOb5Ca74jubzxs1p1Z02dEWoZUpybel9pTRfdz3I0bnAQtqRHnbqKfWti OGM866nKZ/CICl7H8+uULPRmi6y1yKUuKrub6+V+wPAory4hKOPKRhTRkIunhPKFD7XU aHacr1vbOX7hQ55puU7XvVkr631VHCCZAVqScBEZKNUl6MTapNKUmNHBRzUMx2NWlLB1 urRhP5ektSHABsFpTjUd9JLv7xbKKJqWy0/sSVz3dKxNi8FjW8eHjGTqbX36co2D9AY6 U65AHU4/yroNtdEhAGMsx9JbCJdrxbnIunU/tZOh9L3T8yAN4RjUWiYA0wGv2sdongtm W4dg== X-Gm-Message-State: AOAM533J1r3s4QmkMfsI08seWCZ7ZyL8UlPAie4ef5tLo0Sr1f4dcG1k a8TUeZjZkDXyHtGjBR66uX6vaEB2y1mKjPlmgkFQfCbSJ3br X-Received: by 2002:a63:4742:: with SMTP id w2mr1171313pgk.258.1601338403886; Mon, 28 Sep 2020 17:13:23 -0700 (PDT) Received: from lbrmn-lnxub113.broadcom.net ([192.19.228.250]) by smtp-relay.gmail.com with ESMTPS id t1sm1047973pjr.8.2020.09.28.17.13.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Sep 2020 17:13:23 -0700 (PDT) X-Relaying-Domain: broadcom.com From: Scott Branden To: Arnd Bergmann , Greg Kroah-Hartman , Scott Branden Cc: Kees Cook , linux-kernel@vger.kernel.org, bcm-kernel-feedback-list@broadcom.com Subject: [PATCH v4 13/16] misc: bcm-vk: add tty irq handler Date: Mon, 28 Sep 2020 17:12:06 -0700 Message-Id: <20200929001209.16393-14-scott.branden@broadcom.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200929001209.16393-1-scott.branden@broadcom.com> References: <20200929001209.16393-1-scott.branden@broadcom.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add irq handler for tty interfaces to VK. If irq not enable poll method will still be used. Signed-off-by: Scott Branden --- drivers/misc/bcm-vk/bcm_vk.h | 2 ++ drivers/misc/bcm-vk/bcm_vk_dev.c | 13 +++++++++++++ 2 files changed, 15 insertions(+) diff --git a/drivers/misc/bcm-vk/bcm_vk.h b/drivers/misc/bcm-vk/bcm_vk.h index 084be53a9518..64894c77759e 100644 --- a/drivers/misc/bcm-vk/bcm_vk.h +++ b/drivers/misc/bcm-vk/bcm_vk.h @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -484,6 +485,7 @@ int bcm_vk_release(struct inode *inode, struct file *p_file); void bcm_vk_release_data(struct kref *kref); irqreturn_t bcm_vk_msgq_irqhandler(int irq, void *dev_id); irqreturn_t bcm_vk_notf_irqhandler(int irq, void *dev_id); +irqreturn_t bcm_vk_tty_irqhandler(int irq, void *dev_id); int bcm_vk_msg_init(struct bcm_vk *vk); void bcm_vk_msg_remove(struct bcm_vk *vk); void bcm_vk_drain_msg_on_reset(struct bcm_vk *vk); diff --git a/drivers/misc/bcm-vk/bcm_vk_dev.c b/drivers/misc/bcm-vk/bcm_vk_dev.c index 76fe58fc98e2..18e11c8633fd 100644 --- a/drivers/misc/bcm-vk/bcm_vk_dev.c +++ b/drivers/misc/bcm-vk/bcm_vk_dev.c @@ -1338,6 +1338,19 @@ static int bcm_vk_probe(struct pci_dev *pdev, const struct pci_device_id *ent) } vk->num_irqs++; + for (i = 0; + (i < VK_MSIX_TTY_MAX) && (vk->num_irqs < irq); + i++, vk->num_irqs++) { + err = devm_request_irq(dev, pci_irq_vector(pdev, vk->num_irqs), + bcm_vk_tty_irqhandler, + IRQF_SHARED, DRV_MODULE_NAME, vk); + if (err) { + dev_err(dev, "failed request tty IRQ %d for MSIX %d\n", + pdev->irq + vk->num_irqs, vk->num_irqs + 1); + goto err_irq; + } + vk->tty[i].irq_enabled = true; + } id = ida_simple_get(&bcm_vk_ida, 0, 0, GFP_KERNEL); if (id < 0) { -- 2.17.1