<feed xmlns='http://www.w3.org/2005/Atom'>
<title>talos-obmc-linux/include/linux/bsg-lib.h, branch dev-4.13-fsi</title>
<subtitle>Talos™ II Linux sources for OpenBMC</subtitle>
<id>https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-4.13-fsi</id>
<link rel='self' href='https://git.raptorcs.com/git/talos-obmc-linux/atom?h=dev-4.13-fsi'/>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/'/>
<updated>2017-08-24T14:22:10+00:00</updated>
<entry>
<title>bsg-lib: fix kernel panic resulting from missing allocation of reply-buffer</title>
<updated>2017-08-24T14:22:10+00:00</updated>
<author>
<name>Benjamin Block</name>
<email>bblock@linux.vnet.ibm.com</email>
</author>
<published>2017-08-23T23:57:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=50b4d485528d1dbe0bd249f2073140e3444f4a7b'/>
<id>urn:sha1:50b4d485528d1dbe0bd249f2073140e3444f4a7b</id>
<content type='text'>
Since we split the scsi_request out of struct request bsg fails to
provide a reply-buffer for the drivers. This was done via the pointer
for sense-data, that is not preallocated anymore.

Failing to allocate/assign it results in illegal dereferences because
LLDs use this pointer unquestioned.

An example panic on s390x, using the zFCP driver, looks like this (I had
debugging on, otherwise NULL-pointer dereferences wouldn't even panic on
s390x):

Unable to handle kernel pointer dereference in virtual kernel address space
Failing address: 6b6b6b6b6b6b6000 TEID: 6b6b6b6b6b6b6403
Fault in home space mode while using kernel ASCE.
AS:0000000001590007 R3:0000000000000024
Oops: 0038 ilc:2 [#1] PREEMPT SMP DEBUG_PAGEALLOC
Modules linked in: &lt;Long List&gt;
CPU: 2 PID: 0 Comm: swapper/2 Not tainted 4.12.0-bsg-regression+ #3
Hardware name: IBM 2964 N96 702 (z/VM 6.4.0)
task: 0000000065cb0100 task.stack: 0000000065cb4000
Krnl PSW : 0704e00180000000 000003ff801e4156 (zfcp_fc_ct_els_job_handler+0x16/0x58 [zfcp])
           R:0 T:1 IO:1 EX:1 Key:0 M:1 W:0 P:0 AS:3 CC:2 PM:0 RI:0 EA:3
Krnl GPRS: 0000000000000001 000000005fa9d0d0 000000005fa9d078 0000000000e16866
           000003ff00000290 6b6b6b6b6b6b6b6b 0000000059f78f00 000000000000000f
           00000000593a0958 00000000593a0958 0000000060d88800 000000005ddd4c38
           0000000058b50100 07000000659cba08 000003ff801e8556 00000000659cb9a8
Krnl Code: 000003ff801e4146: e31020500004        lg      %r1,80(%r2)
           000003ff801e414c: 58402040           l       %r4,64(%r2)
          #000003ff801e4150: e35020200004       lg      %r5,32(%r2)
          &gt;000003ff801e4156: 50405004           st      %r4,4(%r5)
           000003ff801e415a: e54c50080000       mvhi    8(%r5),0
           000003ff801e4160: e33010280012       lt      %r3,40(%r1)
           000003ff801e4166: a718fffb           lhi     %r1,-5
           000003ff801e416a: 1803               lr      %r0,%r3
Call Trace:
([&lt;000003ff801e8556&gt;] zfcp_fsf_req_complete+0x726/0x768 [zfcp])
 [&lt;000003ff801ea82a&gt;] zfcp_fsf_reqid_check+0x102/0x180 [zfcp]
 [&lt;000003ff801eb980&gt;] zfcp_qdio_int_resp+0x230/0x278 [zfcp]
 [&lt;00000000009b91b6&gt;] qdio_kick_handler+0x2ae/0x2c8
 [&lt;00000000009b9e3e&gt;] __tiqdio_inbound_processing+0x406/0xc10
 [&lt;00000000001684c2&gt;] tasklet_action+0x15a/0x1d8
 [&lt;0000000000bd28ec&gt;] __do_softirq+0x3ec/0x848
 [&lt;00000000001675a4&gt;] irq_exit+0x74/0xf8
 [&lt;000000000010dd6a&gt;] do_IRQ+0xba/0xf0
 [&lt;0000000000bd19e8&gt;] io_int_handler+0x104/0x2d4
 [&lt;00000000001033b6&gt;] enabled_wait+0xb6/0x188
([&lt;000000000010339e&gt;] enabled_wait+0x9e/0x188)
 [&lt;000000000010396a&gt;] arch_cpu_idle+0x32/0x50
 [&lt;0000000000bd0112&gt;] default_idle_call+0x52/0x68
 [&lt;00000000001cd0fa&gt;] do_idle+0x102/0x188
 [&lt;00000000001cd41e&gt;] cpu_startup_entry+0x3e/0x48
 [&lt;0000000000118c64&gt;] smp_start_secondary+0x11c/0x130
 [&lt;0000000000bd2016&gt;] restart_int_handler+0x62/0x78
 [&lt;0000000000000000&gt;]           (null)
INFO: lockdep is turned off.
Last Breaking-Event-Address:
 [&lt;000003ff801e41d6&gt;] zfcp_fc_ct_job_handler+0x3e/0x48 [zfcp]

Kernel panic - not syncing: Fatal exception in interrupt

This patch moves bsg-lib to allocate and setup struct bsg_job ahead of
time, including the allocation of a buffer for the reply-data.

This means, struct bsg_job is not allocated separately anymore, but as part
of struct request allocation - similar to struct scsi_cmd. Reflect this in
the function names that used to handle creation/destruction of struct
bsg_job.

Reported-by: Steffen Maier &lt;maier@linux.vnet.ibm.com&gt;
Suggested-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Christoph Hellwig &lt;hch@lst.de&gt;
Signed-off-by: Benjamin Block &lt;bblock@linux.vnet.ibm.com&gt;
Fixes: 82ed4db499b8 ("block: split scsi_request out of struct request")
Cc: &lt;stable@vger.kernel.org&gt; #4.11+
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block/bsg: move queue creation into bsg_setup_queue</title>
<updated>2017-01-27T22:08:35+00:00</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2017-01-03T12:25:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=8ae94eb65be9425af4d57a4f4cfebfdf03081e93'/>
<id>urn:sha1:8ae94eb65be9425af4d57a4f4cfebfdf03081e93</id>
<content type='text'>
Simply the boilerplate code needed for bsg nodes a bit.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Reviewed-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Signed-off-by: Jens Axboe &lt;axboe@fb.com&gt;
</content>
</entry>
<entry>
<title>scsi: fc: move FC transport's bsg code to bsg-lib</title>
<updated>2016-11-18T01:15:26+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>jthumshirn@suse.de</email>
</author>
<published>2016-11-17T09:31:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=a0f4bd7f2a5be485747aa438cea38f69e3ae8962'/>
<id>urn:sha1:a0f4bd7f2a5be485747aa438cea38f69e3ae8962</id>
<content type='text'>
Now that all conversions are done, move the FibreChannel bsg code over
to the bsg library.

This patch is derived from work done by Mike Christie in 2011 [1] but
only the iscsi parts got merged back then.

[1] http://marc.info/?l=linux-scsi&amp;m=131149780921009&amp;w=2

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>block: add bsg_job_put() and bsg_job_get()</title>
<updated>2016-11-18T01:15:26+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>jthumshirn@suse.de</email>
</author>
<published>2016-11-17T09:31:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=fb6f7c8d8a19e5543d5b4d44c58e2c4e5a82bb12'/>
<id>urn:sha1:fb6f7c8d8a19e5543d5b4d44c58e2c4e5a82bb12</id>
<content type='text'>
Add bsg_job_put() and bsg_job_get() so don't need to export
bsg_destroy_job() any more.

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fc: use bsg_softirq_done</title>
<updated>2016-11-18T01:15:26+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>jthumshirn@suse.de</email>
</author>
<published>2016-11-17T09:31:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=6aa858cd335a94e2824ed542140ac9704c0a64e2'/>
<id>urn:sha1:6aa858cd335a94e2824ed542140ac9704c0a64e2</id>
<content type='text'>
bsg_softirq_done() and fc_bsg_softirq_done() are copies of each other, so
ditch the fc specific one.

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>scsi: fc: Use bsg_destroy_job</title>
<updated>2016-11-18T01:15:25+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>jthumshirn@suse.de</email>
</author>
<published>2016-11-17T09:31:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=c00da4c90ffd066cdfe7f53ff3529c8ab4a35db0'/>
<id>urn:sha1:c00da4c90ffd066cdfe7f53ff3529c8ab4a35db0</id>
<content type='text'>
fc_destroy_bsgjob() and bsg_destroy_job() are now 1:1 copies, so use the
latter. As bsg_destroy_job() comes from bsg-lib we need to select it in
Kconfig once CONFOG_SCSI_FC_ATTRS is active.

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>block: add reference counting for struct bsg_job</title>
<updated>2016-11-18T01:15:25+00:00</updated>
<author>
<name>Johannes Thumshirn</name>
<email>jthumshirn@suse.de</email>
</author>
<published>2016-11-17T09:31:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=bf0f2d380f15f1fa05254b000ddeeb560dfb8638'/>
<id>urn:sha1:bf0f2d380f15f1fa05254b000ddeeb560dfb8638</id>
<content type='text'>
Add reference counting to 'struct bsg_job' so we can implement a reuqest
timeout handler for bsg_jobs, which is needed for Fibre Channel.

Signed-off-by: Johannes Thumshirn &lt;jthumshirn@suse.de&gt;
Reviewed-by: Hannes Reinecke &lt;hare@suse.com&gt;
Signed-off-by: Martin K. Petersen &lt;martin.petersen@oracle.com&gt;
</content>
</entry>
<entry>
<title>bsg: Remove unused function bsg_goose_queue()</title>
<updated>2012-12-06T13:33:02+00:00</updated>
<author>
<name>Bart Van Assche</name>
<email>bvanassche@acm.org</email>
</author>
<published>2012-11-28T12:47:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=80729beb3326fd682543f4f4ea534df47ab48967'/>
<id>urn:sha1:80729beb3326fd682543f4f4ea534df47ab48967</id>
<content type='text'>
The function bsg_goose_queue() does not have any in-tree callers,
so let's remove it.

Signed-off-by: Bart Van Assche &lt;bvanassche@acm.org&gt;
Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: drop custom queue draining used by scsi_transport_{iscsi|fc}</title>
<updated>2012-06-25T09:53:48+00:00</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2012-06-05T03:40:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=86072d8112595ea1b6beeb33f578e7c2839e014e'/>
<id>urn:sha1:86072d8112595ea1b6beeb33f578e7c2839e014e</id>
<content type='text'>
iscsi_remove_host() uses bsg_remove_queue() which implements custom
queue draining.  fc_bsg_remove() open-codes mostly identical logic.

The draining logic isn't correct in that blk_stop_queue() doesn't
prevent new requests from being queued - it just stops processing, so
nothing prevents new requests to be queued after the logic determines
that the queue is drained.

blk_cleanup_queue() now implements proper queue draining and these
custom draining logics aren't necessary.  Drop them and use
bsg_unregister_queue() + blk_cleanup_queue() instead.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Reviewed-by: Mike Christie &lt;michaelc@cs.wisc.edu&gt;
Acked-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: James Smart &lt;james.smart@emulex.com&gt;
Signed-off-by: Jens Axboe &lt;axboe@kernel.dk&gt;
</content>
</entry>
<entry>
<title>block: add bsg helper library</title>
<updated>2011-07-31T20:05:09+00:00</updated>
<author>
<name>Mike Christie</name>
<email>michaelc@cs.wisc.edu</email>
</author>
<published>2011-07-31T20:05:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.raptorcs.com/git/talos-obmc-linux/commit/?id=aa387cc895672b00f807ad7c734a2defaf677712'/>
<id>urn:sha1:aa387cc895672b00f807ad7c734a2defaf677712</id>
<content type='text'>
This moves the FC classes bsg code to the block layer and
makes it a lib so that other classes like iscsi and SAS can use it.

It is helpful because working with the request queue, bios,
creating scatterlists, etc are a pain that the LLD does not
have to worry about with normal IOs and should not have to
worry about for bsg requests.

Signed-off-by: Mike Christie &lt;michaelc@cs.wisc.edu&gt;
Signed-off-by: Jens Axboe &lt;jaxboe@fusionio.com&gt;
</content>
</entry>
</feed>
