From: Christoph Hellwig <hch@infradead.org>
To: "Salyzyn, Mark" <mark_salyzyn@adaptec.com>
Cc: linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: [PATCH] dpt_i2o changes for 2.6.2 kernel in support of 64 bit and bitrot (part 1)
Date: Tue, 10 Feb 2004 21:21:57 +0000 [thread overview]
Message-ID: <20040210212157.A10734@infradead.org> (raw)
In-Reply-To: <547AF3BD0F3F0B4CBDC379BAC7E4189F255013@otce2k03.adaptec.com>; from mark_salyzyn@adaptec.com on Tue, Feb 10, 2004 at 03:53:06PM -0500
+#if (defined(__x86_64__))
+# include <asm-x86_64/ioctl32.h>
+#endif
This is broken. Please use the generic ioctl32 facilities.
-static struct i2o_sys_tbl *sys_tbl = NULL;
+static struct i2o_sys_tbl *sys_tbl_va = NULL;
No need to NULL-initialize this..
+// If this is driver is embedded in the kernel this define
+// should be moved to include/linux/proc_fs.h as an emumerated type
+#define PROC_SCSI_DPT_I2O 0
+struct proc_dir_entry proc_scsi_dptI2O = {
+ PROC_SCSI_DPT_I2O, 7, DPT_DRIVER,
+ S_IFDIR | S_IRUGO | S_IXUGO, 2,
+ 0, 0, 0, NULL, NULL, NULL, NULL, NULL, NULL, NULL
+};
This seems unused, and if it wasn't it would be a bug.
PINFO("Detecting Adaptec I2O RAID controllers...\n");
- /* search for all Adatpec I2O RAID cards */
- while ((pDev = pci_find_device( PCI_DPT_VENDOR_ID, PCI_ANY_ID, pDev))) {
- if(pDev->device == PCI_DPT_DEVICE_ID ||
- pDev->device == PCI_DPT_RAPTOR_DEVICE_ID){
+ /* search for all Adaptec I2O RAID cards */
+ while ((pDev = pci_find_device( dptids[0].vendor, PCI_ANY_ID, pDev))) {
+ if(pDev->device == dptids[0].device ||
+ pDev->device == dptids[1].device){
This screams for using a proper pci_driver interface..
+ /*
+ * We are called before the host & host lock has been
+ * assigned, and may be called with, or without, the host lock
+ * held. We need to free the lock, if held, before going
+ * to sleep.
+ */
+ if ((pHba->host != NULL) /* Sad */
+ && (spin_is_locked(pHba->host->host_lock))) {
This is bogus as hell. Who said you took the lock?
+ case DPT_TARGET_BUSY & 0xFFFF:
+ case DPT_TARGET_BUSY:
+ {
+ TARGET_BUSY_T busy;
+ struct adpt_device* d;
+
+ if (copy_from_user((void*)&busy, (void*)arg, sizeof(TARGET_BUSY_T))) {
+ return -EFAULT;
+ }
+
+ d = adpt_find_device(pHba, busy.channel, busy.id, busy.lun);
+ if(d == NULL){
+ return -ENODEV;
+ }
+ busy.isBusy = ((d->pScsi_dev)
+ && (d->pScsi_dev->device_busy /* Imperfect */
+ || test_bit(SHOST_RECOVERY, &pHba->host->shost_state)));
+ if (copy_to_user ((char*)arg, &busy, sizeof(busy))) {
+ return -EFAULT;
+ }
+ break;
+ }
This ioctl was removed because it's broken. Don't readd it.
+ shost_for_each_device(d, pHba->host) {
+ unsigned long flags;
+ spin_lock_irqsave(&d->list_lock, flags);
+ list_for_each_entry(cmd, &d->cmd_list, list) {
+ if (((u32)cmd->serial_number == context)
+ || ((u32)cmd->serial_number_at_timeout == context)) {
+ spin_unlock_irqrestore(&d->list_lock, flags);
+ return cmd;
Where do release the reference to the scsi_device again?
next prev parent reply other threads:[~2004-02-10 21:21 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-10 20:53 [PATCH] dpt_i2o changes for 2.6.2 kernel in support of 64 bit and bitrot (part 1) Salyzyn, Mark
2004-02-10 21:21 ` Christoph Hellwig [this message]
-- strict thread matches above, loose matches on Subject: below --
2004-02-10 21:47 Salyzyn, Mark
2004-04-05 17:56 Salyzyn, Mark
2004-04-05 20:47 ` Christoph Hellwig
2004-04-05 22:23 Salyzyn, Mark
2004-04-06 5:20 ` Christoph Hellwig
2004-04-06 14:48 ` Matthew Wilcox
2004-04-06 14:03 Salyzyn, Mark
2004-04-06 14:17 ` Christoph Hellwig
2004-04-06 14:47 Salyzyn, Mark
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=20040210212157.A10734@infradead.org \
--to=hch@infradead.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mark_salyzyn@adaptec.com \
/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