From: Boaz Harrosh <bharrosh@panasas.com>
To: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>,
James Bottomley <James.Bottomley@steeleye.com>,
Jeff Garzik <jeff@garzik.org>
Cc: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>,
Greg Kroah-Hartman <gregkh@suse.de>,
Alan Stern <stern@rowland.harvard.edu>,
Matthew Dharm <mdharm-usb@one-eyed-alien.net>,
Russell King <rmk@arm.linux.org.uk>,
"David S. Miller" <davem@davemloft.net>,
YOKOTA Hiroshi <yokota@netlab.is.tsukuba.ac.jp>,
linux-scsi <linux-scsi@vger.kernel.org>,
"Maciej W. Rozycki" <macro@linux-mips.org>,
Mark Fortescue <mark@mtfhpc.demon.co.uk>
Subject: Re: [PATCH 24/24] ide-scsi.c: convert to data accessors and !use_sg cleanup
Date: Tue, 18 Sep 2007 10:49:25 +0200 [thread overview]
Message-ID: <46EF9115.5030705@panasas.com> (raw)
In-Reply-To: <200709171304.08503.bzolnier@gmail.com>
On Mon, Sep 17 2007 at 13:04 +0200, Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> wrote:
> On Wednesday 12 September 2007, Boaz Harrosh wrote:
>> - Convert ide-scsi to the new data accessors and cleanup
>> the !use_sg code paths.
>>
>> Inspecting old code I can see places that still assume
>> scsi_cmnd->request_buffer is a linear char pointer. Though I
>> admit this assumption is hidden behind a flag:
>> test_bit(PC_TRANSFORM, &pc->flags).
>
> Sigh... somebody forgot to update ide-scsi.c while making SCSI use
> only sg for REQ_TYPE_BLOCK_PC.
>
>> I have commented out the offending code and put a
>> WARN_ON(1) in it's place. So if there is missing functionality
>
> in idescsi_transform_pc2():
>
> if (drive->media == ide_cdrom || drive->media == ide_optical) {
> ...
> WARN_ON(1) + #if/#endif 0 should be here
> ...
> }
>
> rest of the changes look OK and you can add my ACK after fixing
> idescsi_transform_pc2()
>
>> it will complain but will not crash the kernel.
>
> sr is likely to complain due to scsi_mode_sense() usage :(
>
>> Maintainer of this driver please inspect if this functionality
>> is still needed, if not then please remove the commented code.
>>
>> Thanks
>>
>> Signed-off-by: Boaz Harrosh <bharrosh@panasas.com>
>> ---
Ok I had an hard look on this code and finally understood what is
going on. It looks like the ATAPI devices do not like the short
mode_sense_6" commands and friends, and will translate them to
the xxx_10 variant on the fly. Upper layer like sr still sends
short commands for compatibility with old scsi HW.
This stuff did not work for ages. and was usually bailing out on a NULL
pointer. Though I'm almost sure that there is one potential crash in there
and if Jeff is correct in saying that it gets used, than I do not understand
how it did not trigger.
In any way I have codded a fix. I have based my hack on the assumption that
SENSE INQUIRY and SELECT commands come with sg_count of 1. If not than I
just truncate the command to the first sg. I than do a kmap/kunmap on the
first sg and let the code do what it did before.
Please Note that I did not reference the standard and have not verified
at all the bit keeping in there. I have just converted the old code that
assumed a !use_sg in block pc commands to now assume an sg_count==1.
Please, anyone that can, give it an hard testing with any HW you have
because that change is not trivial.
I will send the patch as reply to the first patch.
Boaz
next prev parent reply other threads:[~2007-09-18 8:49 UTC|newest]
Thread overview: 59+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-09-11 20:23 [patchset 0/24] Lots of the Accessors patches and !use_sg cleanup Boaz Harrosh
2007-09-11 20:50 ` Cameron, Steve
2007-09-11 21:05 ` Boaz Harrosh
2007-09-11 23:49 ` [PATCH 01/24] usb: transport - convert to accessors and !use_sg code path removal Boaz Harrosh
2007-09-11 23:50 ` [PATCH 02/24] usb: protocol.c " Boaz Harrosh
2007-09-11 23:51 ` [PATCH 03/24] usb: shuttle_usbat.c " Boaz Harrosh
2007-09-11 23:51 ` [PATCH 04/24] usb: freecom.c & sddr09.c - convert to accessors and !use_sg cleanup Boaz Harrosh
2007-09-11 23:53 ` [PATCH 05/24] isd200.c: use one-element sg list in issuing commands Boaz Harrosh
2007-09-11 23:54 ` [PATCH 06/24] NCR5380 familly convert to accessors & !use_sg cleanup Boaz Harrosh
2007-09-11 23:55 ` [PATCH 07/24] arm: scsi convert to accessors and " Boaz Harrosh
2007-09-12 7:42 ` Russell King
2007-09-18 15:04 ` Boaz Harrosh
2007-12-15 0:27 ` James Bottomley
2007-12-16 15:28 ` Boaz Harrosh
2008-02-01 20:10 ` Russell King
2008-01-31 18:09 ` James Bottomley
2007-09-11 23:56 ` [PATCH 08/24] nsp_cs.c convert to data " Boaz Harrosh
2007-09-11 23:58 ` [PATCH 09/24] libata-scsi: convert to use the data buffer accessors Boaz Harrosh
2007-09-12 0:09 ` Jeff Garzik
2007-09-12 0:25 ` Boaz Harrosh
2007-09-12 1:40 ` Matthew Dharm
2007-09-12 6:36 ` Boaz Harrosh
2007-09-18 15:46 ` [PATCH ver2 1/2] libata-scsi: Remove !use_sg code paths Boaz Harrosh
2007-09-20 21:12 ` Jeff Garzik
2007-09-18 15:48 ` [PATCH ver2 2/2] libata-scsi: convert to use the data buffer accessors Boaz Harrosh
2007-09-12 0:00 ` [PATCH 10/24] eata_pio.c: convert to accessors and !use_sg cleanup Boaz Harrosh
2007-09-12 0:00 ` [PATCH 11/24] a2091.c: " Boaz Harrosh
2007-09-12 0:01 ` [PATCH 12/24] a3000.c: " Boaz Harrosh
2007-09-12 0:02 ` [PATCH 13/24] aha1542.c: " Boaz Harrosh
2007-09-12 0:03 ` [PATCH 14/24] atp870u.c: " Boaz Harrosh
2007-09-12 0:04 ` [PATCH 15/24] fd_mcs.c: " Boaz Harrosh
2007-09-12 0:05 ` [PATCH 16/24] imm.c: " Boaz Harrosh
2007-09-12 0:06 ` [PATCH 17/24] in2000.c: " Boaz Harrosh
2007-09-12 0:07 ` [PATCH 18/24] ppa.c: " Boaz Harrosh
2007-09-12 0:07 ` [PATCH 19/24] wd33c93.c: " Boaz Harrosh
2007-09-12 0:09 ` Subject: [PATCH 20/24] scsi: esp family " Boaz Harrosh
2007-09-12 0:09 ` [PATCH 21/24] qlogicpti.c: " Boaz Harrosh
2007-10-10 18:25 ` [PATCH 21/24 ver2] " Boaz Harrosh
2007-10-10 22:58 ` David Miller
2007-09-12 0:10 ` Subject: [PATCH 22/24] Remove psi240i driver from kernel Boaz Harrosh
2007-09-12 0:11 ` [PATCH 23/24] wd7000.c - proper fix for boards without sg support Boaz Harrosh
2007-09-12 0:13 ` [PATCH 24/24] ide-scsi.c: convert to data accessors and !use_sg cleanup Boaz Harrosh
2007-09-17 11:04 ` Bartlomiej Zolnierkiewicz
2007-09-18 8:49 ` Boaz Harrosh [this message]
2007-09-18 9:03 ` [PATCH ver2 " Boaz Harrosh
2007-09-18 9:14 ` Christoph Hellwig
2007-09-18 10:24 ` Boaz Harrosh
2007-09-18 10:27 ` [PATCH 24/24 ver3 ] " Boaz Harrosh
2007-09-19 19:59 ` Bartlomiej Zolnierkiewicz
2007-09-12 16:00 ` [patchset 0/24] Lots of the Accessors patches " Maciej W. Rozycki
2007-09-17 10:46 ` Bartlomiej Zolnierkiewicz
2007-09-17 11:36 ` Boaz Harrosh
2007-09-17 13:51 ` James Bottomley
2007-09-17 20:05 ` Bartlomiej Zolnierkiewicz
2007-09-17 20:57 ` Jeff Garzik
2007-09-17 21:00 ` James Bottomley
2007-09-17 21:05 ` Jeff Garzik
2007-10-10 18:24 ` Boaz Harrosh
2007-10-10 19:14 ` Matthew Wilcox
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=46EF9115.5030705@panasas.com \
--to=bharrosh@panasas.com \
--cc=James.Bottomley@steeleye.com \
--cc=bzolnier@gmail.com \
--cc=davem@davemloft.net \
--cc=fujita.tomonori@lab.ntt.co.jp \
--cc=gregkh@suse.de \
--cc=jeff@garzik.org \
--cc=linux-scsi@vger.kernel.org \
--cc=macro@linux-mips.org \
--cc=mark@mtfhpc.demon.co.uk \
--cc=mdharm-usb@one-eyed-alien.net \
--cc=rmk@arm.linux.org.uk \
--cc=stern@rowland.harvard.edu \
--cc=yokota@netlab.is.tsukuba.ac.jp \
/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).