linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Chris Boot <bootc@bootc.net>
Cc: Julian Calaby <julian.calaby@gmail.com>,
	Clemens Ladisch <clemens@ladisch.de>,
	target-devel@vger.kernel.org,
	linux1394-devel@lists.sourceforge.net,
	Boaz Harrosh <bharrosh@panasas.com>,
	Andy Grover <agrover@redhat.com>,
	linux-scsi@vger.kernel.org, lkml <linux-kernel@vger.kernel.org>
Subject: Re: FireWire/SBP2 Target mode
Date: Tue, 7 Feb 2012 20:17:30 +0100	[thread overview]
Message-ID: <20120207201730.1c8cf6a3@stein> (raw)
In-Reply-To: <4F30D4F6.1040802@bootc.net>

On Feb 07 Chris Boot wrote:
> On 06/02/2012 23:09, Chris Boot wrote:
> > On 6 Feb 2012, at 23:00, Julian Calaby wrote:
> >> On Tue, Feb 7, 2012 at 09:28, Chris Boot<bootc@bootc.net>  wrote:
> >>> Waiting until the bus scan is complete isn't actually that great
> >>> as I see the first LOGIN requests often before the fw_node is seen
> >>> at all. I'd have to turn away the requester and hope they try again.

An SBP-2 initiator should be prepared to retry its first login attempt if
it sent it shortly after a bus reset.  The target may still hold
reservations for previously loggend in initiators for up to reconnect_hold
+ 2 seconds after bus reset.

> >>> I'm fairly sure my little tweak in my patch is a simple enough
> >>> solution.

Yep.

> >> Stupid question: Could you use a completion queue or something
> >> equivalent to wait until you have seen the fw_node, *then* process the
> >> LOGIN request?
> >
> > The fw_address_handler callback is called in interrupt context, and
> > I can't sleep from within there. As far as I'm aware I must call
> > fw_send_response() from within the callback and can't defer that until
> > I've scheduled something on a work queue. Please correct me if I'm
> > wrong though, as that might be useful anyway.
> 
> Hmm sorry I've thought about this overnight and clearly I was talking 
> rubbish. Yes, I need to reply in the fw_address_handler but all I tend 
> to do in there is schedule a task to the the main part of the work 
> anyway. As most of the operations require fetching an ORB from the 
> initiator I have to do this from user context.

Technically there are two things to perform:

 1. Finish the inbound IEEE 1394 transaction to the management agent
    register by means of fw_send_response().  As far as I can tell, you
    don't have to do that in the address_callback().  But there is little
    reason not to.

    fw_send_response() ends the lifetime of an fw_request, so read the
    speed code before you respond.

 2. Finish the inbound SBP-2 transaction; here the login.  This and
    everything that leads up to it is definitely easiest to implement in
    a process context, e.g. workqueue item.
-- 
Stefan Richter
-=====-===-- --=- --===
http://arcgraph.de/sr/

  parent reply	other threads:[~2012-02-07 19:17 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-17 14:51 FireWire/SBP2 Target mode Chris Boot
2011-08-17 18:57 ` Stefan Richter
2011-08-18 16:19 ` Clemens Ladisch
2012-02-01 19:50   ` Andy Grover
2012-02-01 21:41     ` Stefan Richter
2012-02-02  9:22       ` Boaz Harrosh
2012-02-02 10:09         ` Clemens Ladisch
2012-02-06 13:13           ` Chris Boot
2012-02-06 14:43             ` Clemens Ladisch
2012-02-06 14:51               ` Chris Boot
2012-02-06 20:26                 ` Stefan Richter
2012-02-06 22:28                   ` Chris Boot
2012-02-06 23:00                     ` Julian Calaby
2012-02-06 23:09                       ` Chris Boot
2012-02-07  7:38                         ` Chris Boot
2012-02-07 10:06                           ` Julian Calaby
2012-02-07 19:17                           ` Stefan Richter [this message]
2012-02-07 19:53                             ` Chris Boot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120207201730.1c8cf6a3@stein \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=agrover@redhat.com \
    --cc=bharrosh@panasas.com \
    --cc=bootc@bootc.net \
    --cc=clemens@ladisch.de \
    --cc=julian.calaby@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    --cc=target-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).