All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Richter <stefanr@s5r6.in-berlin.de>
To: Andrew de Quincey <adq_dvb@lidskialf.net>
Cc: linux1394-devel@lists.sourceforge.net, linux-scsi@vger.kernel.org
Subject: Re: linux kernel panic when ejecting ieee1394 ipod
Date: Thu, 08 Dec 2005 03:44:42 +0100	[thread overview]
Message-ID: <43979E1A.30801@s5r6.in-berlin.de> (raw)
In-Reply-To: <200512080209.17757.adq_dvb@lidskialf.net>

Andrew de Quincey wrote:
> On Thursday 08 December 2005 01:59, Andrew de Quincey wrote:
>>eject -s sends the following SCSI packet command to the sbp/ipod device:
>>
>>1b 00 00 00 02 00 with a direction of DMA_NONE
>>
>>eject -r results in the same via the CDROMEJECT translator in
>>scsi_cmd_ioctl(), but with a direction of DMA_TO_DEVICE. Thats what crashes
>>it - looks like its trying to set up a DMA transfer for 0 bytes or
>>something. I just added a really horrible hack to the start of
>>sbp2_send_command() to check, as follows:
>>
>>   if (*cmd == 0x1b) {
>>      SCpnt->sc_data_direction = 3;
>>   }
>>
>>Now, eject -r works perfectly. Though thats obviously not a good way to fix
>>it :)

That was a long time ago when sbp2 had to take care of data direction. I 
think we don't want to go back there. :-)

> Possible "proper" patch attached - no idea if its a good way to do this. 
> Basically if it gets a command with a scsi_request_bufflen of zero bytes, it 
> forces dma_dir to DMA_NONE.
> 
> The ipod works perfectly with this now.
...
[in sbp2_create_command_orb]
> +	/* check for duff DMA transfer direction with a zero length buffer */
> +	if (scsi_request_bufflen == 0)
> +		dma_dir = DMA_NONE;

What if you replace WRITE by READ in 
drivers/scsi/scsi_ioctl.c::scsi_cmd_ioctl()::case CDROMEJECT ?

And BTW, can/should this latter case block be converted to use 
scsi_execute() or scsi_execute_req()?
-- 
Stefan Richter
-=====-=-=-= ==-- -=---
http://arcgraph.de/sr/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click

  reply	other threads:[~2005-12-08  2:44 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <200512072358.15398.adq_dvb@lidskialf.net>
2005-12-08  1:17 ` linux kernel panic when ejecting ieee1394 ipod Stefan Richter
2005-12-08  1:57 ` Andrew de Quincey
     [not found] ` <200512080119.48740.adq@lidskialf.net>
2005-12-08  1:59   ` Andrew de Quincey
2005-12-08  2:09     ` Andrew de Quincey
2005-12-08  2:44       ` Stefan Richter [this message]
2005-12-08  3:19         ` Andrew de Quincey
2005-12-08  7:52           ` Stefan Richter
2005-12-08 19:27             ` Stefan Richter
2005-12-08 17:34         ` Patrick Mansfield
2005-12-08 19:25           ` Stefan Richter
2005-12-09 13:37           ` Jens Axboe
2005-12-09 13:42             ` Jens Axboe
2005-12-09 18:39               ` Stefan Richter
2005-12-09 19:35                 ` Stefan Richter
2005-12-09 22:45                   ` James Bottomley
2005-12-10 18:20                     ` Christoph Hellwig
2005-12-13 20:44                     ` Stefan Richter
2005-12-13 20:54                       ` Jens Axboe
2005-12-10  8:48                   ` Jens Axboe
2005-12-10  9:28                     ` Christoph Hellwig
2005-12-10 10:55                       ` Stefan Richter

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=43979E1A.30801@s5r6.in-berlin.de \
    --to=stefanr@s5r6.in-berlin.de \
    --cc=adq_dvb@lidskialf.net \
    --cc=linux-scsi@vger.kernel.org \
    --cc=linux1394-devel@lists.sourceforge.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.