lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 07 Feb 2012 19:53:21 +0000
From:	Chris Boot <bootc@...tc.net>
To:	Stefan Richter <stefanr@...6.in-berlin.de>
CC:	Julian Calaby <julian.calaby@...il.com>,
	Clemens Ladisch <clemens@...isch.de>,
	target-devel@...r.kernel.org,
	linux1394-devel@...ts.sourceforge.net,
	Boaz Harrosh <bharrosh@...asas.com>,
	Andy Grover <agrover@...hat.com>, linux-scsi@...r.kernel.org,
	lkml <linux-kernel@...r.kernel.org>
Subject: Re: FireWire/SBP2 Target mode

On 07/02/2012 19:17, Stefan Richter wrote:
> 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:
>>>> 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.

Yep I do exactly that - I save the speed then schedule_work() inside the 
address callback, then call fw_send_response() still within the 
callback. The work callback uses fw_run_transaction() to fetch the ORB 
and deal with it.

Cheers,
Chris

-- 
Chris Boot
bootc@...tc.net
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ