help regarding PnP SCSI
Hi all, is kernel 2.6.8 support plug and play on SCSI devices? I want to use FC-HBA on PCI Express and want to attach SCSI at FC end, but i am sure whether SCSI support pnp at this end or not. and in which thing the PnP SCSI is dependent. Thanks in advance for resolving my confusion. ~~~ Thanks and Best Regards Bhupesh Kumar Pandey __ _ / / (_)__ __ __ / /__/ / _ \/ // /\ \/ / //_/_//_/\___/ /_/\_\ - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: return value warnings about scsi_add_host, anything in progre ss?
On Monday, February 07, 2005 4:40 AM, Alex wrote: is anything going to happen with the below listed locations? (Some are part of the USB system, one is in block device, rest is SCSI.) Note that a few locations do still lack the XXX comment. I am asking because i am seeing ther respective warning anytime when i am checking the quality of a new linux kernel. And now i am wondering if there is already some work in progress or already pending in the queue for submitting to bitkeeper. Hi Alex, Can you please elaborate the issue and what you'd expect from it? Thanks, Seokmann LSI Logic Corporation. -Original Message- From: Alexander Stohr [mailto:[EMAIL PROTECTED] Sent: Monday, February 07, 2005 4:40 AM To: linux-scsi@vger.kernel.org Subject: return value warnings about scsi_add_host, anything in progress? Hello, is anything going to happen with the below listed locations? (Some are part of the USB system, one is in block device, rest is SCSI.) Note that a few locations do still lack the XXX comment. I am asking because i am seeing ther respective warning anytime when i am checking the quality of a new linux kernel. And now i am wondering if there is already some work in progress or already pending in the queue for submitting to bitkeeper. -Alex. PS: i am not subscribed to that list, so please CC me on replys. Hunting answers via the list archives is not always successful. ./drivers/usb/image/hpusbscsi.c:112:scsi_add_host(new-host, intf-dev); /* XXX handle failure */ ./drivers/usb/image/microtek.c:812: scsi_add_host(new_desc-host, NULL); /* XXX handle failure */ ./drivers/scsi/arm/ecoscsi.c:208: scsi_add_host(host, NULL); /* XXX handle failure */ ./drivers/scsi/megaraid.c:4890: error = scsi_add_host(host, pdev-dev); ./drivers/scsi/aic7xxx/aic7xxx_osm.c:1732: scsi_add_host(host, (ahc-dev_softc ? ahc-dev_softc-dev : NULL)); /* XXX handle failure */ ./drivers/scsi/aic7xxx/aic79xx_osm.c:2068: scsi_add_host(host, ahd-dev_softc-dev); /* XXX handle failure */ ./drivers/scsi/pcmcia/fdomain_stub.c:226:scsi_add_host(host, NULL); /* XXX handle failure */ ./drivers/scsi/pcmcia/nsp_cs.c:1908:scsi_add_host (host, NULL); ./drivers/scsi/mac53c94.c:506: scsi_add_host(host, mdev-ofdev.dev); ./drivers/scsi/nsp32.c:2891:scsi_add_host (host, PCIDEV-dev); ./drivers/scsi/mesh.c:1963: scsi_add_host(mesh_host, mdev- ofdev.dev); ./drivers/scsi/aha1740.c:645: scsi_add_host (shpnt, dev); /* XXX handle failure */ ./drivers/scsi/BusLogic.c:2299: scsi_add_host(Host, NULL); ./drivers/block/cciss_scsi.c:709: scsi_add_host(sh, hba[ctlr]-pdev-dev); /* XXX handle failure * -- DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen! AKTION Kein Einrichtungspreis nutzen: http://www.gmx.net/de/go/dsl - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: return value warnings about scsi_add_host, anything in progre ss?
On Mon, Feb 07, 2005 at 08:47:36AM -0500, Ju, Seokmann wrote: On Monday, February 07, 2005 4:40 AM, Alex wrote: is anything going to happen with the below listed locations? (Some are part of the USB system, one is in block device, rest is SCSI.) Note that a few locations do still lack the XXX comment. I am asking because i am seeing ther respective warning anytime when i am checking the quality of a new linux kernel. And now i am wondering if there is already some work in progress or already pending in the queue for submitting to bitkeeper. Hi Alex, Can you please elaborate the issue and what you'd expect from it? include/scsi/scsi_host.h:extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *); If you have gcc 3.4 or higher, __must_check is defined as: include/linux/compiler-gcc3.h:#define __must_check __attribute__((warn_unused_result)) `warn_unused_result' The `warn_unused_result' attribute causes a warning to be emitted if a caller of the function with this attribute does not use its return value. This is useful for functions where not checking the result is either a security problem or always a bug, such as `realloc'. ie these drivers need to be fixed to use the return value from scsi_add_host(). I'm not sure why returning the result doesn't count as a use of the result (in the case of megaraid). Thanks, Seokmann LSI Logic Corporation. -Original Message- From: Alexander Stohr [mailto:[EMAIL PROTECTED] Sent: Monday, February 07, 2005 4:40 AM To: linux-scsi@vger.kernel.org Subject: return value warnings about scsi_add_host, anything in progress? Hello, is anything going to happen with the below listed locations? (Some are part of the USB system, one is in block device, rest is SCSI.) Note that a few locations do still lack the XXX comment. I am asking because i am seeing ther respective warning anytime when i am checking the quality of a new linux kernel. And now i am wondering if there is already some work in progress or already pending in the queue for submitting to bitkeeper. -Alex. PS: i am not subscribed to that list, so please CC me on replys. Hunting answers via the list archives is not always successful. ./drivers/usb/image/hpusbscsi.c:112:scsi_add_host(new-host, intf-dev); /* XXX handle failure */ ./drivers/usb/image/microtek.c:812: scsi_add_host(new_desc-host, NULL); /* XXX handle failure */ ./drivers/scsi/arm/ecoscsi.c:208: scsi_add_host(host, NULL); /* XXX handle failure */ ./drivers/scsi/megaraid.c:4890: error = scsi_add_host(host, pdev-dev); ./drivers/scsi/aic7xxx/aic7xxx_osm.c:1732: scsi_add_host(host, (ahc-dev_softc ? ahc-dev_softc-dev : NULL)); /* XXX handle failure */ ./drivers/scsi/aic7xxx/aic79xx_osm.c:2068: scsi_add_host(host, ahd-dev_softc-dev); /* XXX handle failure */ ./drivers/scsi/pcmcia/fdomain_stub.c:226:scsi_add_host(host, NULL); /* XXX handle failure */ ./drivers/scsi/pcmcia/nsp_cs.c:1908:scsi_add_host (host, NULL); ./drivers/scsi/mac53c94.c:506: scsi_add_host(host, mdev-ofdev.dev); ./drivers/scsi/nsp32.c:2891:scsi_add_host (host, PCIDEV-dev); ./drivers/scsi/mesh.c:1963: scsi_add_host(mesh_host, mdev- ofdev.dev); ./drivers/scsi/aha1740.c:645: scsi_add_host (shpnt, dev); /* XXX handle failure */ ./drivers/scsi/BusLogic.c:2299: scsi_add_host(Host, NULL); ./drivers/block/cciss_scsi.c:709: scsi_add_host(sh, hba[ctlr]-pdev-dev); /* XXX handle failure * -- DSL Komplett von GMX +++ Supergünstig und stressfrei einsteigen! AKTION Kein Einrichtungspreis nutzen: http://www.gmx.net/de/go/dsl - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html -- Next the statesmen will invent cheap lies, putting the blame upon the nation that is attacked, and every man will be glad of those conscience-soothing falsities, and will diligently study them, and refuse to examine any refutations of them; and thus he will by and by convince himself that the war is just, and will thank God for the better sleep he enjoys after this process of grotesque self-deception. -- Mark Twain - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: return value warnings about scsi_add_host, anything in progre ss?
On Monday, February 07, 2005 11:29 AM, Matthew wrote: I don't get a warning from this line, using gcc 3.4.4 20041218 (prerelease) (Debian 3.4.3-7): drivers/scsi/megaraid.c: In function `megadev_ioctl': drivers/scsi/megaraid.c:3626: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result Were you confused with that warning? Thank you for your comment. The driver being referred here is pretty old version and it's been quite while since LSI move forward to 2.10.9.x for 2.4 kernel support. Please upgrade the driver to 2.10.9.x. Thanks, - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[RFC][PATCH 2.6.11-rc2] Linux SCSI hotplug infrastructure
Below is a patch to add some hotplug infrastructure to the Linux SCSI subsystem. New files: include/scsi/scsi_hotplug.h drivers/scsi/scsi_hotplug.c implements a new exported function: extern int scsi_topology_hctl_action(struct Scsi_Host *shost, unsigned int channel, unsigned int id, unsigned int lun, enum scsi_topology_action action); which invokes kobject_hotplug() on a temporary scsi_topology device. This device represents a target that exists on a topology (i.e. was just inserted into a hot plug enclosure, or was just created by a RAID controller management application) but is not yet hooked into the kernel. Modified files: drivers/scsi/Kconfig drivers/scsi/Makefile drivers/scsi/megaraid/megaraid_mbox.c (will follow in a separate patch) is the user of this new function. In addition, two more infrastructure pieces are necessary: udev-050-scsi_topology.patch - adds the subsystem name scsi_topology to the list of devices *not* to wait for the creation of files in sysfs for - scsi_topology devices aren't to be registered in sysfs. /etc/hotplug/scsi_topology.agent handles the hotplug call, and invokes /sys/class/scsi_host/hostX/scan and /sys/class/scsi_device/H:C:T:L:/device/delete as appropriate. The flow is as follows: # echo 2 /sys/class/scsi_host/host2/logical_drive_created (to be done by a management application that knows it just created logical drive #2 on the controller) megaraid_mbox.c sysfs method converts logical drive number to HCTL value, calls scsi_topology_hctl_action(). scsi_topology_hctl_action() invokes kobject_hotplug() with a scsi_topology subsystem device. kobject_hotplug() calls /sbin/hotplug or /sbin/udevsend (more likely the latter), which invokes /etc/hotplug/scsi_topology.agent with the ACTION={add,remove}. scsi_topology.agent invokes /sys/class/scsi_host/hostX/scan or /sys/class/scsi_device/H:C:T:L:/device/delete as appropriate. From this point, we're back into known territory, with the device being made known, or deleted from, the kernel's view. Thoughts? Signed-off-by: Matt Domsch [EMAIL PROTECTED] -- Matt Domsch Software Architect Dell Linux Solutions linux.dell.com www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com = drivers/scsi/Kconfig 1.95 vs edited = --- 1.95/drivers/scsi/Kconfig 2005-01-28 11:14:29 -06:00 +++ edited/drivers/scsi/Kconfig 2005-02-05 13:58:45 -06:00 @@ -185,6 +185,16 @@ there should be no noticeable performance impact as long as you have logging turned off. +config SCSI_HOTPLUG + bool Hot Plug SCSI devices + depends on SCSI EXPERIMENTAL + default y + help + If your driver or management applications know about + device hot plugging (insertion/removal of physical disks in + a topology, or creation/deletion of logical disks on a RAID + controller), say Y here. Otherwise, say N. + menu SCSI Transport Attributes depends on SCSI = drivers/scsi/Makefile 1.72 vs edited = --- 1.72/drivers/scsi/Makefile 2004-11-20 14:26:17 -06:00 +++ edited/drivers/scsi/Makefile2005-02-05 13:58:15 -06:00 @@ -147,6 +147,7 @@ scsi_devinfo.o scsi_mod-$(CONFIG_SYSCTL) += scsi_sysctl.o scsi_mod-$(CONFIG_SCSI_PROC_FS)+= scsi_proc.o +scsi_mod-$(CONFIG_SCSI_HOTPLUG)+= scsi_hotplug.o sd_mod-objs:= sd.o sr_mod-objs:= sr.o sr_ioctl.o sr_vendor.o --- /dev/null Thu Apr 11 09:25:15 2002 +++ include/scsi/scsi_hotplug.h Sun Feb 6 23:29:51 2005 @@ -0,0 +1,41 @@ +/* + * SCSI Hotplug + * + * Copyright (c) 2005 Dell, Inc [EMAIL PROTECTED] + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ +#ifndef _SCSI_SCSI_HOTPLUG_H +#define _SCSI_SCSI_HOTPLUG_H + +#include linux/config.h +#include scsi/scsi_host.h +#include scsi/scsi_device.h + +enum scsi_topology_action { + SCSI_TOPOLOGY_ADDED= 1, /* device added in the topology */ + SCSI_TOPOLOGY_REMOVED = 2, /* device removed from the topology */ +}; + +#if defined (CONFIG_SCSI_HOTPLUG) || defined(CONFIG_SCSI_HOTPLUG_MODULE) +extern int scsi_topology_hctl_action(struct Scsi_Host *shost, unsigned int channel, + unsigned int id, unsigned int lun, enum
Re: [RFC][PATCH 2.6.11-rc2] Linux SCSI hotplug infrastructure
On Mon, Feb 07, 2005 at 12:27:53PM -0600, Matt Domsch wrote: Modified files: drivers/scsi/megaraid/megaraid_mbox.c (will follow in a separate patch) is the user of this new function. For example. I will rework this to follow the patch submitted last week by LSI to accomplish something similar in their driver. -- Matt Domsch Software Architect Dell Linux Solutions linux.dell.com www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com = drivers/scsi/megaraid/megaraid_mbox.c 1.12 vs edited = --- 1.12/drivers/scsi/megaraid/megaraid_mbox.c 2005-01-31 00:33:46 -06:00 +++ edited/drivers/scsi/megaraid/megaraid_mbox.c2005-02-06 23:35:08 -06:00 @@ -70,6 +70,7 @@ * For history of changes, see Documentation/ChangeLog.megaraid */ +#include scsi/scsi_hotplug.h #include megaraid_mbox.h static int megaraid_init(void); @@ -455,6 +456,100 @@ /* + * sysfs class device support + * creates three files: + * /sys/class/scsi_host + * |-- host0 + * | |-- logical_drive_created + * | |-- logical_drive_destroyed + * + * These make the midlayer invoke /sbin/hotplug, which then calls back into sysfs + * /sys/class/scsi_host + * |-- host0 + * | |-- scan + * + * and + * + * /sys/devices/pci:0x/:0x:0x.0/host0 + * |-- 0:0:0:0 + * | |-- delete + * + * respectively. This allows userspace applications to work + * using their logical drive number, and lets the driver translate + * that into host, channel, id, and lun values which the other + * mechanisms require. This is similar to how hot plug CPU works. + */ + +/** + * lda_to_hcil() + * @adapter + * @lda - logical drive address + * @host_no + * @channel + * @id + * @lun + * + * converts a logical drive address into a host, channel id, lun tuple. + */ + +static inline int megaraid_lda_to_hcil(struct Scsi_Host *shost, u32 lda, + u32 *host_no, u32 *channel, u32 *id, u32 *lun) +{ + if (lda MAX_LOGICAL_DRIVES_40LD) + return -EINVAL; + *host_no = shost-host_no; + *channel = shost-max_channel; + *id = (lda shost-this_id) ? lda : lda + 1; + *lun = 0; + return 0; +} + +static int megaraid_host_store(struct class_device *class_dev, const char *buf, size_t count, + enum scsi_topology_action action) +{ +struct Scsi_Host *shost = class_to_shost(class_dev); + int fields=0, rc=-EINVAL; + u32 lda=0, host_no=0, channel=0, id=0, lun=0; + fields = sscanf(buf, %u, lda); + if (fields != 1) + return rc; + if (lda MAX_LOGICAL_DRIVES_40LD) + return rc; + rc = megaraid_lda_to_hcil(shost, lda, host_no, channel, id, lun); + if (rc) + return rc; + + rc = scsi_topology_hctl_action(shost, channel, id, lun, action); + + if (rc) + return rc; + return count; +} + +static ssize_t megaraid_host_store_ld_created(struct class_device *class_dev, const char *buf, size_t count) +{ + return megaraid_host_store(class_dev, buf, count, SCSI_TOPOLOGY_ADDED); +} +static ssize_t megaraid_host_store_ld_destroyed(struct class_device *class_dev, const char *buf, size_t count) +{ + return megaraid_host_store(class_dev, buf, count, SCSI_TOPOLOGY_REMOVED); +} + + +#define MEGARAID_HOST_WOATTR(_name,_store) \ +CLASS_DEVICE_ATTR(_name, S_IWUSR|S_IWGRP, NULL, _store) + +static MEGARAID_HOST_WOATTR(logical_drive_created, megaraid_host_store_ld_created); +static MEGARAID_HOST_WOATTR(logical_drive_destroyed, megaraid_host_store_ld_destroyed); + +/* Host attributes initializer */ +static struct class_device_attribute *megaraid_host_attrs[] = { + class_device_attr_logical_drive_created, + class_device_attr_logical_drive_destroyed, + NULL, +}; + +/* * Scsi host template for megaraid unified driver */ static struct scsi_host_template megaraid_template_g = { @@ -467,6 +562,7 @@ .eh_bus_reset_handler = megaraid_reset_handler, .eh_host_reset_handler = megaraid_reset_handler, .use_clustering = ENABLE_CLUSTERING, + .shost_attrs= megaraid_host_attrs, }; - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 2.6.11-rc2] Linux SCSI hotplug infrastructure
On Mon, Feb 07, 2005 at 12:27:53PM -0600, Matt Domsch wrote: In addition, two more infrastructure pieces are necessary: udev-050-scsi_topology.patch - adds the subsystem name scsi_topology to the list of devices *not* to wait for the creation of files in sysfs for - scsi_topology devices aren't to be registered in sysfs. Patch follows. Signed-off-by: Matt Domsch [EMAIL PROTECTED] -- Matt Domsch Software Architect Dell Linux Solutions linux.dell.com www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com --- udev-050/udev_sysfs.c.~1~ 2004-12-17 23:53:07.0 -0600 +++ udev-050/udev_sysfs.c 2005-02-07 10:58:45.0 -0600 @@ -56,6 +56,7 @@ { .subsystem = fc_host, .file = port_id }, { .subsystem = spi_transport, .file = width }, { .subsystem = spi_host, .file = width }, + { .subsystem = scsi_topology, .file = NULL }, { NULL, NULL } }; - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [RFC][PATCH 2.6.11-rc2] Linux SCSI hotplug infrastructure
On Mon, Feb 07, 2005 at 12:27:53PM -0600, Matt Domsch wrote: /etc/hotplug/scsi_topology.agent handles the hotplug call, and invokes /sys/class/scsi_host/hostX/scan and /sys/class/scsi_device/H:C:T:L:/device/delete as appropriate. And here's scsi_topology.agent. Signed-off-by: Matt Domsch [EMAIL PROTECTED] -- Matt Domsch Software Architect Dell Linux Solutions linux.dell.com www.dell.com/linux Linux on Dell mailing lists @ http://lists.us.dell.com #!/bin/bash # # SCSI Topology hotplug agent. # Copyright (C) 2005 Dell, Inc. [EMAIL PROTECTED] # # This is invoked when a device, not currently known to the system, is # added or removed from a SCSI topology. This includes creation of a # logical drive on a RAID controller, or manually inserting a disk # into a SCSI disk enclosure. This script then invokes the scan # method of the scsi_host, or the delete method of the scsi_device, to # inform the kernel of the change made on the topology. # # SCSI_TOPOLOGY_EVENT_HCTL is used to know that the data to pass to # scan is a Host:Controller:Target ID:LUN tuple. This is to provide # for future SCSI implmentations that may use a native addressing # scheme rather than only HCTL. [ ${SCSI_TOPOLOGY_EVENT} != 1 ] exit [ ${SCSI_TOPOLOGY_EVENT_HCTL} != 1 ] exit if [ ${ACTION} = add ]; then MYPATH=/sys/class/scsi_host/host${SCSI_HOST}/scan [ -f ${MYPATH} ] echo ${SCSI_CHANNEL} ${SCSI_ID} ${SCSI_LUN} ${MYPATH} fi if [ ${ACTION} = remove ]; then MYPATH=/sys/class/scsi_device/${SCSI_HOST}:${SCSI_CHANNEL}:${SCSI_ID}:${SCSI_LUN}/device/delete [ -f ${MYPATH} ] echo 1 ${MYPATH} fi - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: return value warnings about scsi_add_host, anything in progre ss?
On Mon, Feb 07, 2005 at 04:10:22PM +, Matthew Wilcox wrote: I'm not sure why returning the result doesn't count as a use of the result (in the case of megaraid). From: Alexander Stohr [mailto:[EMAIL PROTECTED] ./drivers/scsi/megaraid.c:4890: error = scsi_add_host(host, pdev-dev); I don't get a warning from this line, using gcc 3.4.4 20041218 (prerelease) (Debian 3.4.3-7): drivers/scsi/megaraid.c: In function `megadev_ioctl': drivers/scsi/megaraid.c:3626: warning: ignoring return value of `copy_to_user', declared with attribute warn_unused_result Were you confused with that warning? My main concern was the adaptec aic7 and aic9 series, and i am aware that a one-time loading device should have good chances to succeed, i dont call it critical for my particular application case (some few Gigs main memory). But as the very same problem exists all over the place, even in USB devices - which can be plugged and unplugged any now and then. Producing a memory leak of a few 10 to 100 kB on every plug and remove is nothing really acceptable for a system that is expected to have longer uptimes. So if there are some solutions out there for getting the return value interpreted and in the error case the device registering canceled, then i asked if the respective coders and maintainers could pop up for getting thoses messages removed from the compiler`s output. Can you please? I just dont want to duplicate any works here, or much worser code something that no one with a better understanding would ever integrate into the kernel. -Alex. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
EBDA Question
EBDA - Extended Bios Data Area Does Linux and various boot loaders(lilo/grub/etc) having any restrictions on where and how big memory allocated in EBDA is? Is this handled for 2.4/2.6 Kernels? Reason I ask is we are considering having BIOS(for a SCSI HBA Controller) allocating memory in EBDA for Firmware use. We are concerned whether Linux would be writing over this region of memory during the handoff of BIOS to scsi lower layer driver loading. Eric Moore LSI Logic - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
RE: [PATCH] Convert megaraid2 to compat_ioctl
On Tuesday, January 18, 2005 6:17 AM, Andi wrote: Convert megaraid2 driver to new compat_ioctl entry points. I don't have easy access to hardware, so only compile tested. Hi, I've applied your patch to the driver and getting compilation error as follow. /var/lib/dkms/megaraid/v2.20.4.6/build/megaraid_mm.c:74: error: unknown field `compat_ioctl' specified in initializer /var/lib/dkms/megaraid/v2.20.4.6/build/megaraid_mm.c:74: warning: initialization from incompatible pointer type The kernel that I'm using is 2.6.9 and there is NO entry 'compat_ioctl' on file_operations structure which is defined in linux/fs.h. Please correct me know if there is anything that I've missed. Thanks, Seokmann LSI Logic Corporation. -Original Message- From: Andi Kleen [mailto:[EMAIL PROTECTED] Sent: Tuesday, January 18, 2005 6:17 AM To: [EMAIL PROTECTED]; linux-scsi@vger.kernel.org Subject: [PATCH] Convert megaraid2 to compat_ioctl Convert megaraid2 driver to new compat_ioctl entry points. I don't have easy access to hardware, so only compile tested. Signed-off-by: Andi Kleen [EMAIL PROTECTED] diff -u linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o linux- 2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c --- linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c-o 2005-01- 04 12:13:06.0 +0100 +++ linux-2.6.11-rc1-bk4/drivers/scsi/megaraid/megaraid_mm.c 2005-01- 18 06:28:34.0 +0100 @@ -16,6 +16,7 @@ */ #include megaraid_mm.h +#include linux/smp_lock.h // Entry points for char node driver @@ -43,8 +44,7 @@ static void mraid_mm_teardown_dma_pools(mraid_mmadp_t *); #ifdef CONFIG_COMPAT -static int mraid_mm_compat_ioctl(unsigned int, unsigned int, unsigned long, - struct file *); +static long mraid_mm_compat_ioctl(struct file *, unsigned int, unsigned long); #endif MODULE_AUTHOR(LSI Logic Corporation); @@ -70,6 +70,9 @@ static struct file_operations lsi_fops = { .open = mraid_mm_open, .ioctl = mraid_mm_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = mraid_mm_compat_ioctl, +#endif .owner = THIS_MODULE, }; @@ -1180,8 +1183,6 @@ INIT_LIST_HEAD(adapters_list_g); - register_ioctl32_conversion(MEGAIOCCMD, mraid_mm_compat_ioctl); - return 0; } @@ -1190,13 +1191,15 @@ * mraid_mm_compat_ioctl : 32bit to 64bit ioctl conversion routine */ #ifdef CONFIG_COMPAT -static int -mraid_mm_compat_ioctl(unsigned int fd, unsigned int cmd, - unsigned long arg, struct file *filep) -{ - struct inode *inode = filep-f_dentry-d_inode; - - return mraid_mm_ioctl(inode, filep, cmd, arg); +static long +mraid_mm_compat_ioctl(struct file *filep, unsigned int cmd, + unsigned long arg) +{ + int err; + lock_kernel(); + err = mraid_mm_ioctl(NULL, filep, cmd, arg); + unlock_kernel(); + return err; } #endif @@ -1209,7 +1212,6 @@ con_log(CL_DLEVEL1 , (exiting common mod\n)); unregister_chrdev(majorno, megadev); - unregister_ioctl32_conversion(MEGAIOCCMD); } module_init(mraid_mm_init); - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: Fw: [Bugme-new] [Bug 4166] New: BUG: using smp_processor_id() in preemptible [00000001] code: nfsd/2783
Andrew Vasquez [EMAIL PROTECTED] wrote: On Mon, 07 Feb 2005, Andrew Morton wrote: Andrew Vasquez [EMAIL PROTECTED] wrote: - if (smp_processor_id() == ha-last_irq_cpu || was_empty) + if (_smp_processor_id() == ha-last_irq_cpu || was_empty) Am I correct in assuming that if we are preempted, and if _smp_processor_id() returns the wrong number, the driver will continue to function correctly? And that we simply missed a little optimisation opportunity? Yes, the driver will continue to operate correctly. Another suggestion made was to explicitly disable/enable preemption around the 'if' statement. The s/smp_processor_id/_smp_processor_id/ seemed like the least intrusive option in the interim... It makes perfect sense. James, I'll add this to this evening's patchbatch. - To unsubscribe from this list: send the line unsubscribe linux-scsi in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html