From patchwork Tue Oct 4 14:00:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gi-Oh Kim X-Patchwork-Id: 9361935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 62BDE60752 for ; Tue, 4 Oct 2016 14:00:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14F791FFD7 for ; Tue, 4 Oct 2016 14:00:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09103287CE; Tue, 4 Oct 2016 14:00:28 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B8F24287E5 for ; Tue, 4 Oct 2016 14:00:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752745AbcJDOAU (ORCPT ); Tue, 4 Oct 2016 10:00:20 -0400 Received: from mail-wm0-f47.google.com ([74.125.82.47]:36476 "EHLO mail-wm0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751884AbcJDOAU (ORCPT ); Tue, 4 Oct 2016 10:00:20 -0400 Received: by mail-wm0-f47.google.com with SMTP id k125so209013740wma.1 for ; Tue, 04 Oct 2016 07:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=mijFNkLiR3vW0WRHvgVK4qka76r9Sct9Xoj6WiGMaaA=; b=O2vVtzrnX/jRsraPGbxTw+bqKZT/QTWPFWrDuELjI1mH19gJS6LhUN4nrPjeJquxNY g8lBePEsZoDjCdzrVfuPIWFXw+Qz+6RVAkckZHpssIFvjs3ePne6weh/QHXZzu+iugJe CViIdgrikxkMb9pQGlz3Aj1H/vnkIDFjkHkt1beygxPTOobdRaR1dw4SyB9SGaROVWPB yWdaBI/g08r2nzu+cfDtbZnSiHMonU24Xb0aovmcjB8pIvCrilRTXy0ojYdc15147DcR bFC7yMASHNZ0ONOHFwcaGLaAPMWp3eLFtVNQpsuAMPvgVhC8RtWdPXgo8kXvhAXFO3fC LoMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=mijFNkLiR3vW0WRHvgVK4qka76r9Sct9Xoj6WiGMaaA=; b=fxjjoQj6S7dafW9B7YS5ZrwHl2GbPAHOi2GZkBFj2iN3KBSr6eIRJUcS8GuHvuBCSP xFQJpozl8xbcbKJMSP66fVmOfcPz9pg3s/fXGgYvR77AJJMpk9lVr1q4gqAQqwHu/FBj vMxGW1/tp/JUwwt4cVTpyUp2gP6R5xlm/yR0AvhN5xhJRAjU8BvTmEchcuxoeiAc46Fo ZF3IntJb3XQ8KmYc+DZ57SG/OOOnfKMl7W94EbIjRvG6vuBYPG4PLaZAcTXTbFLym/6h 2qpijNF2+rWM9sEvteuyFrKtBe0mtexkfHnNBYdpmS2KNME9euINCUTl6tfbwd4v52bK NjoQ== X-Gm-Message-State: AA6/9RkyapF5JJXLh5e9CEdJ2d1OtRawAS8qW5BqkgctVMQAKov0ZHWRFQfKgKVRPvvzk1vc X-Received: by 10.28.132.71 with SMTP id g68mr13884071wmd.20.1475589617844; Tue, 04 Oct 2016 07:00:17 -0700 (PDT) Received: from ws00837.pb.local ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id o5sm4259902wmg.16.2016.10.04.07.00.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 04 Oct 2016 07:00:16 -0700 (PDT) From: Gioh Kim To: bart.vanassche@sandisk.com, dledford@redhat.com, sean.hefty@intel.com, hal.rosenstock@gmail.com Cc: linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org, Gioh Kim Subject: [RFC] IB/srp: export reset-host via sysfs Date: Tue, 4 Oct 2016 16:00:09 +0200 Message-Id: <1475589609-26451-1-git-send-email-gi-oh.kim@profitbricks.com> X-Mailer: git-send-email 2.5.0 Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Standard SCSI device has host_reset sysfs interface. This patch exports the host_reset interface for upper layer. Signed-off-by: Gioh Kim --- drivers/infiniband/ulp/srp/ib_srp.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index 3322ed7..92e6c3f 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c @@ -2628,6 +2628,15 @@ static int srp_reset_device(struct scsi_cmnd *scmnd) return SUCCESS; } +static int srp_scsi_host_reset(struct Scsi_Host *shost, int reset_type) +{ + struct srp_target_port *target = host_to_target(shost); + + shost_printk(KERN_EMERG, target->scsi_host, PFX "SRP reset_host called\n"); + + return srp_reconnect_rport(target->rport); +} + static int srp_reset_host(struct scsi_cmnd *scmnd) { struct srp_target_port *target = host_to_target(scmnd->device->host); @@ -2858,6 +2867,7 @@ static struct scsi_host_template srp_template = { .use_clustering = ENABLE_CLUSTERING, .shost_attrs = srp_host_attrs, .track_queue_depth = 1, + .host_reset = srp_scsi_host_reset, }; static int srp_sdev_count(struct Scsi_Host *host)