From patchwork Mon Oct 12 15:20:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 54779 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f197.google.com (mail-wi0-f197.google.com [209.85.212.197]) by patches.linaro.org (Postfix) with ESMTPS id 571C323001 for ; Mon, 12 Oct 2015 15:05:58 +0000 (UTC) Received: by wijq8 with SMTP id q8sf35548706wij.1 for ; Mon, 12 Oct 2015 08:05:57 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-type:sender:precedence :list-id:x-original-sender:x-original-authentication-results :mailing-list:list-post:list-help:list-archive:list-unsubscribe; bh=/GCveiGrk8xpH/DBrfrFKlMNJ6orEdO+XoQ0SmWBM4g=; b=cileJS1pUhldJWkZy9G8mfafAPtdbr2cIpbjx7cpeiV0I6rkwmdeeX2FuokEVNpsX5 CybMa9gp0qcRUCxZU9kYyVw25GmHwVj6UMcg1ZQuPIPUPCk5przbqvfsXDwPIu23SUuE 8Ih+r/2AGVUGwBsCUc/+CqQcjU24de2f/Q+FMZ8jwvUGvXvJKJmCY+rkiWye/HzvQ62j Z/4kUtWgrBi8mZeZgp4Gke4ELw+WB8/p56Ygst2eIu2JqelM0JRX7pqU6HkpoUVNSuD3 ul+y0dKXLzEBgoQdWo7TBl3J46Bw+aSVcY9LVzARMRck5e2XVJZOGKGh1jn/8v01oHWM ohEA== X-Gm-Message-State: ALoCoQm95EINXSn8CSyN6bXdh2slY2h0Da6M3zG/0bPH63PGubrbp7kesMwlIdyqDs/maKx7Zovd X-Received: by 10.194.240.230 with SMTP id wd6mr5792870wjc.0.1444662357720; Mon, 12 Oct 2015 08:05:57 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.25.207.195 with SMTP id f186ls140092lfg.32.gmail; Mon, 12 Oct 2015 08:05:57 -0700 (PDT) X-Received: by 10.112.17.34 with SMTP id l2mr12505977lbd.117.1444662357487; Mon, 12 Oct 2015 08:05:57 -0700 (PDT) Received: from mail-lb0-f176.google.com (mail-lb0-f176.google.com. [209.85.217.176]) by mx.google.com with ESMTPS id l20si5297906lfi.62.2015.10.12.08.05.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 12 Oct 2015 08:05:57 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) client-ip=209.85.217.176; Received: by lbcao8 with SMTP id ao8so146198588lbc.3 for ; Mon, 12 Oct 2015 08:05:57 -0700 (PDT) X-Received: by 10.112.180.230 with SMTP id dr6mr12732829lbc.72.1444662357363; Mon, 12 Oct 2015 08:05:57 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.59.35 with SMTP id w3csp1599451lbq; Mon, 12 Oct 2015 08:05:56 -0700 (PDT) X-Received: by 10.60.43.105 with SMTP id v9mr15986537oel.6.1444662341178; Mon, 12 Oct 2015 08:05:41 -0700 (PDT) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id no3si9004018oeb.29.2015.10.12.08.05.40 for ; Mon, 12 Oct 2015 08:05:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752091AbbJLPFi (ORCPT ); Mon, 12 Oct 2015 11:05:38 -0400 Received: from szxga02-in.huawei.com ([119.145.14.65]:11911 "EHLO szxga02-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752067AbbJLPFh (ORCPT ); Mon, 12 Oct 2015 11:05:37 -0400 Received: from 172.24.1.49 (EHLO szxeml432-hub.china.huawei.com) ([172.24.1.49]) by szxrg02-dlp.huawei.com (MOS 4.3.7-GA FastPath queued) with ESMTP id CUB61537; Mon, 12 Oct 2015 23:05:18 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by szxeml432-hub.china.huawei.com (10.82.67.209) with Microsoft SMTP Server id 14.3.235.1; Mon, 12 Oct 2015 23:05:04 +0800 From: John Garry To: CC: , , , , , , , , , John Garry Subject: [PATCH 19/25] scsi: hisi_sas: add bcast interrupt handler Date: Mon, 12 Oct 2015 23:20:31 +0800 Message-ID: <1444663237-238302-20-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1444663237-238302-1-git-send-email-john.garry@huawei.com> References: <1444663237-238302-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: john.garry@huawei.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.176 as permitted sender) smtp.mailfrom=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , This is for expander broadcast event. Signed-off-by: John Garry --- drivers/scsi/hisi_sas/hisi_sas_v1_hw.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c index 2de54a7..2ad2ffa 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v1_hw.c @@ -1370,6 +1370,35 @@ end: return res; } +static irqreturn_t int_bcast_v1_hw(int irq, void *p) +{ + struct hisi_sas_phy *phy = p; + struct hisi_hba *hisi_hba = phy->hisi_hba; + u32 irq_value; + irqreturn_t res = IRQ_HANDLED; + struct asd_sas_phy *sas_phy = &phy->sas_phy; + int phy_no = sas_phy->id; + struct sas_ha_struct *sha = &hisi_hba->sha; + struct device *dev = &hisi_hba->pdev->dev; + + irq_value = hisi_sas_phy_read32(hisi_hba, phy_no, CHL_INT2); + + if (!(irq_value & CHL_INT2_SL_RX_BC_ACK_MSK)) { + dev_err(dev, "bcast: irq_value = %x not set enable bit", + irq_value); + res = IRQ_NONE; + goto end; + } + + sha->notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); + +end: + hisi_sas_phy_write32(hisi_hba, phy_no, CHL_INT2, + CHL_INT2_SL_RX_BC_ACK_MSK); + + return res; +} + static irqreturn_t int_abnormal_v1_hw(int irq, void *p) { struct hisi_sas_phy *phy = p; @@ -1478,6 +1507,7 @@ static irqreturn_t cq_interrupt_v1_hw(int irq, void *p) } static const char phy_int_names[HISI_SAS_PHY_INT_NR][32] = { + {"Bcast"}, {"Phy Up"}, {"Abnormal"}, }; @@ -1485,6 +1515,7 @@ static const char phy_int_names[HISI_SAS_PHY_INT_NR][32] = { static const char cq_int_name[32] = "cq"; static irq_handler_t phy_interrupts[HISI_SAS_PHY_INT_NR] = { + int_bcast_v1_hw, int_phyup_v1_hw, int_abnormal_v1_hw };