public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Tobias Oetiker <tobi@oetiker.ch>,
	allied internet ag- Stefan Priebe <s.priebe@allied-internet.ag>,
	Jon Chelton <jchelton@ffpglobal.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Dave Milter <davemilter@gmail.com>, Jeff Garzik <jeff@garzik.org>,
	Christoph Hellwig <hch@infradead.org>,
	linux-scsi <linux-scsi@vger.kernel.org>,
	David Brownell <dbrownell@users.sourceforge.net>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: gdth new set of patches for 2.6.24 stable
Date: Sun, 17 Feb 2008 11:24:51 -0600	[thread overview]
Message-ID: <1203269091.3082.47.camel@localhost.localdomain> (raw)
In-Reply-To: <47B864CB.4040604@panasas.com>


On Sun, 2008-02-17 at 18:46 +0200, Boaz Harrosh wrote:
> On Thu, Feb 14 2008 at 20:47 +0200, Boaz Harrosh <bharrosh@panasas.com> wrote:
> > Submitted are a new set of patches, that fix lots of problems
> > with the gdth driver.
> > 
> > It fixes the following problems:
> > - scan for drives on hosts. (Already in mainline)
> > - truly fixes the exit/reboot problems but does call flush() before
> >   reboot.
> > - fix crash when accessing array with icpcon management application.
> > - fix crash when doing $ cat /proc/sys/gdth/0.
> >   This one still has the below WARN_ON in messages (see <gdth_info> below)
> >   So there is one more thing hiding in there.
> > - use pci_get_device
> >   One of the testers requested if we can also put the move to pci_get_device 
> >   patch with removal of dependency on PCI_LEGACY, to the stable release.
> > 
> > The patches are for and based on Linux-2.6.24. here is the list of patches:
> >   [PATCH 1/5] gdth: update deprecated pci_find_device
> >   [PATCH 2/5] gdth: scan for scsi devices
> >   [PATCH 3/5] gdth: bugfix for the at-exit problems
> >   [PATCH 4/5] gdth: fix to internal commands execution
> >   [PATCH 5/5] gdth: remove gdth cooked up command accessors
> > 
> > Please all test and report your findings.
> > 
> > Thanks in advance
> > Boaz
> > 
> > ---
> > <gdth_info>
> >   WARNING: at arch/x86/kernel/pci-dma_32.c:66 dma_free_coherent()
> >   Pid: 5501, comm: cat Not tainted 2.6.24 #43
> >    [<c0107137>] dma_free_coherent+0x93/0x95
> >    [<c025ef73>] gdth_ioctl_free+0x4c/0x69
> >    [<c0264a36>] gdth_proc_info+0x165f/0x182c
> >    [<c0111f7a>] update_curr+0xeb/0xf2
> >    [<c01132aa>] task_rq_lock+0x29/0x50
> >    [<c0113706>] try_to_wake_up+0x42/0x342
> >    [<c0113706>] try_to_wake_up+0x42/0x342
> >    [<c0111a9f>] __wake_up_common+0x46/0x6d
> >    [<c0113569>] __wake_up+0x32/0x42
> >    [<c022dad9>] n_tty_receive_buf+0x2e8/0xe97
> >    [<c022dad9>] n_tty_receive_buf+0x2e8/0xe97
> >    [<c0111f0a>] update_curr+0x7b/0xf2
> >    [<c0112625>] enqueue_task_fair+0x27/0x30
> >    [<c0111783>] enqueue_task+0xa/0x14
> >    [<c025e351>] proc_scsi_read+0x29/0x3d
> >    [<c025e328>] proc_scsi_read+0x0/0x3d
> >    [<c0189704>] proc_file_read+0x1c6/0x279
> >    [<c018953e>] proc_file_read+0x0/0x279
> >    [<c0185eca>] proc_reg_read+0x53/0x71
> >    [<c0185e77>] proc_reg_read+0x0/0x71
> >    [<c0159968>] vfs_read+0x85/0x11b
> >    [<c0159d9d>] sys_read+0x41/0x6a
> >    [<c0102822>] sysenter_past_esp+0x5f/0x85
> >  </gdth_info>
> > -
> James hi.
> 
> All my testers have reported back that with these 5 patches applied they can
> now run with a 2.6.24 kernel the same way they ran before. However there is
> that reported issue, with the dma_free_coherent WARN_ON (above). The code was 
> like that from day one and it is a very old issue, however it is a regression 
> because 2.6.24 introduced that new WARN_ON.
> (infamous commit aa24886e379d2b641c5117e178b15ce1d5d366ba)
> >From posts on lkml and even recent one in linux-scsi about the arcmsr driver
> it looks that all a driver can do is work around it with different kernel mechanisms
> and driver rewrites. I'm afraid I need your help here. I'm not sure I understand
> why does the gdth driver uses the pci_{alloc,free}_consistent() API's, and what
> is needed to replace it. Could you please have a look in gdth_proc.c and also in
> gdth.c for all the places that call gdth_ioctl_alloc/gdth_ioctl_free, and advise
> what can I do in it's place. Please bear in mind that we need it for 2.6.24, as
> a bugfix.
> 
> Apart from the above issue, please accept patches 3,4,5 above they have now
> been tested and are reported to bring broken system back to production.
> (Given that you approve off course). And mark them for inclusion to the
> 2.6.24 stable releases. (Or is there some thing that I should do)
> 
> ---
> Meanwhile on x86 systems I understand the WARN_ON is cosmetic, and does not
> pose any harm. Some people have reported stability with temporarily disabling
> it. For testers that want to try, here it is below. At your own risk.

Isn't this the correct fix?  pscratch is a permanent address (it's
allocated at boot time and never changes).  All you need the smp lock
for is mediating the scratch in use flag.

James

diff --git a/drivers/scsi/gdth_proc.c b/drivers/scsi/gdth_proc.c
index de57734..ce0228e 100644
--- a/drivers/scsi/gdth_proc.c
+++ b/drivers/scsi/gdth_proc.c
@@ -694,15 +694,13 @@ static void gdth_ioctl_free(gdth_ha_str *ha, int size, char *buf, ulong64 paddr)
 {
     ulong flags;
 
-    spin_lock_irqsave(&ha->smp_lock, flags);
-
     if (buf == ha->pscratch) {
+	spin_lock_irqsave(&ha->smp_lock, flags);
         ha->scratch_busy = FALSE;
+	spin_unlock_irqrestore(&ha->smp_lock, flags);
     } else {
         pci_free_consistent(ha->pdev, size, buf, paddr);
     }
-
-    spin_unlock_irqrestore(&ha->smp_lock, flags);
 }
 
 #ifdef GDTH_IOCTL_PROC



  reply	other threads:[~2008-02-17 17:25 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-14 18:47 gdth new set of patches for 2.6.24 stable Boaz Harrosh
2008-02-14 18:51 ` [PATCH 1/5] gdth: update deprecated pci_find_device Boaz Harrosh
2008-02-14 20:13   ` Jeff Garzik
2008-02-14 20:45     ` James Bottomley
2008-02-14 20:55       ` Jeff Garzik
2008-02-14 18:52 ` [PATCH 2/5] gdth: scan for scsi devices Boaz Harrosh
2008-02-14 18:53 ` [PATCH 3/5] gdth: bugfix for the at-exit problems Boaz Harrosh
2008-02-14 18:55 ` [PATCH 4/5] gdth: fix to internal commands execution Boaz Harrosh
2008-02-14 18:56 ` [PATCH 5/5] gdth: remove gdth cooked up command accessors Boaz Harrosh
2008-02-17 16:46 ` gdth new set of patches for 2.6.24 stable Boaz Harrosh
2008-02-17 17:24   ` James Bottomley [this message]
2008-02-18  9:23     ` Boaz Harrosh
2008-02-18 12:57   ` Andrew Morton
2008-02-18 13:17     ` Boaz Harrosh
2008-02-18 14:02     ` Russell King
2008-02-18 14:51       ` James Bottomley
2008-02-18 15:21     ` Ralf Baechle
2008-02-18 20:27     ` David Brownell
2008-02-19 14:37       ` Ralf Baechle

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=1203269091.3082.47.camel@localhost.localdomain \
    --to=james.bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=bharrosh@panasas.com \
    --cc=davemilter@gmail.com \
    --cc=dbrownell@users.sourceforge.net \
    --cc=gregkh@suse.de \
    --cc=hch@infradead.org \
    --cc=jchelton@ffpglobal.com \
    --cc=jeff@garzik.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=s.priebe@allied-internet.ag \
    --cc=tobi@oetiker.ch \
    /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