Re: [PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
On Sun, Jul 29, 2012 at 8:32 PM, Benjamin Herrenschmidt wrote: > On Wed, 2012-07-18 at 18:49 +0200, o...@aepfle.de wrote: >> From: Olaf Hering >> >> The driver is named ibmvscsic, at runtime it its name is advertised as >> ibmvscsi. For this reason mkinitrd wont pickup the driver properly. >> Reported by IBM during SLES11 beta testing: >> >> https://bugzilla.novell.com/show_bug.cgi?id=459933 >> LTC50724 > > So while this would work, I do wonder however whether we could instead > fix it by simplifying the whole thing as follow since iSeries is now > gone and so we don't need split backends anymore: > > scsi/ibmvscsi: Remove backend abstraction > > Now that the iSeries code is gone the backend abstraction > in this driver is no longer necessary, which allows us to > consolidate the driver in one file. > > The side effect is that the module name is now ibmvscsi.ko > which matches the driver hotplug name and fixes auto-load > issues. > > Signed-off-by: Benjamin Herrenschmidt ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
On Tue, Jul 31, 2012 at 11:20 AM, Brian King wrote: > On 07/30/2012 10:08 PM, Benjamin Herrenschmidt wrote: > > On Mon, 2012-07-30 at 21:06 +0200, Olaf Hering wrote: > >>> So while this would work, I do wonder however whether we could > >> instead > >>> fix it by simplifying the whole thing as follow since iSeries is now > >>> gone and so we don't need split backends anymore: > >>> > >>> scsi/ibmvscsi: Remove backend abstraction > >> > >> I cant that these things myself anymore. > > > > Brian, can somebody from your side own these ? > > I talked to Rob and he will be picking this up. Rob - can you submit > a patch to the maintainers file, adding yourself as the ibmvscsi > maintainer? > Submitted a patch for the MAINTAINERS file and I'll take a look at these patches to verify them as well. Thanks. --Rob Jennings ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
On Tue, Jul 31, 2012 at 11:20 AM, Brian King wrote: > > On 07/30/2012 10:08 PM, Benjamin Herrenschmidt wrote: > > On Mon, 2012-07-30 at 21:06 +0200, Olaf Hering wrote: > >>> So while this would work, I do wonder however whether we could > >> instead > >>> fix it by simplifying the whole thing as follow since iSeries is now > >>> gone and so we don't need split backends anymore: > >>> > >>> scsi/ibmvscsi: Remove backend abstraction > >> > >> I cant that these things myself anymore. > > > > Brian, can somebody from your side own these ? > > I talked to Rob and he will be picking this up. Rob - can you submit > a patch to the maintainers file, adding yourself as the ibmvscsi > maintainer? I've submitted a patch for the MAINTAINERS file and I'll take a look at these patches to verify them as well. Thanks. --Rob Jennings ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
On 07/30/2012 10:08 PM, Benjamin Herrenschmidt wrote: > On Mon, 2012-07-30 at 21:06 +0200, Olaf Hering wrote: >>> So while this would work, I do wonder however whether we could >> instead >>> fix it by simplifying the whole thing as follow since iSeries is now >>> gone and so we don't need split backends anymore: >>> >>> scsi/ibmvscsi: Remove backend abstraction >> >> I cant that these things myself anymore. > > Brian, can somebody from your side own these ? I talked to Rob and he will be picking this up. Rob - can you submit a patch to the maintainers file, adding yourself as the ibmvscsi maintainer? Thanks, Brian -- Brian King Power Linux I/O IBM Linux Technology Center ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
On Mon, 2012-07-30 at 21:06 +0200, Olaf Hering wrote: > > So while this would work, I do wonder however whether we could > instead > > fix it by simplifying the whole thing as follow since iSeries is now > > gone and so we don't need split backends anymore: > > > > scsi/ibmvscsi: Remove backend abstraction > > I cant that these things myself anymore. Brian, can somebody from your side own these ? Cheers, Ben. ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
On Mon, Jul 30, Benjamin Herrenschmidt wrote: > On Wed, 2012-07-18 at 18:49 +0200, o...@aepfle.de wrote: > > From: Olaf Hering > > > > The driver is named ibmvscsic, at runtime it its name is advertised as > > ibmvscsi. For this reason mkinitrd wont pickup the driver properly. > > Reported by IBM during SLES11 beta testing: > > > > https://bugzilla.novell.com/show_bug.cgi?id=459933 > > LTC50724 > > So while this would work, I do wonder however whether we could instead > fix it by simplifying the whole thing as follow since iSeries is now > gone and so we don't need split backends anymore: > > scsi/ibmvscsi: Remove backend abstraction I cant that these things myself anymore. Olaf ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev
Re: [PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
On Wed, 2012-07-18 at 18:49 +0200, o...@aepfle.de wrote: > From: Olaf Hering > > The driver is named ibmvscsic, at runtime it its name is advertised as > ibmvscsi. For this reason mkinitrd wont pickup the driver properly. > Reported by IBM during SLES11 beta testing: > > https://bugzilla.novell.com/show_bug.cgi?id=459933 > LTC50724 So while this would work, I do wonder however whether we could instead fix it by simplifying the whole thing as follow since iSeries is now gone and so we don't need split backends anymore: scsi/ibmvscsi: Remove backend abstraction Now that the iSeries code is gone the backend abstraction in this driver is no longer necessary, which allows us to consolidate the driver in one file. The side effect is that the module name is now ibmvscsi.ko which matches the driver hotplug name and fixes auto-load issues. Signed-off-by: Benjamin Herrenschmidt --- --- drivers/scsi/ibmvscsi/Makefile|6 +- drivers/scsi/ibmvscsi/ibmvscsi.c | 348 +-- drivers/scsi/ibmvscsi/ibmvscsi.h | 22 --- drivers/scsi/ibmvscsi/rpa_vscsi.c | 368 - 4 files changed, 330 insertions(+), 414 deletions(-) delete mode 100644 drivers/scsi/ibmvscsi/rpa_vscsi.c diff --git a/drivers/scsi/ibmvscsi/Makefile b/drivers/scsi/ibmvscsi/Makefile index ff5b5c5..cb150d1 100644 --- a/drivers/scsi/ibmvscsi/Makefile +++ b/drivers/scsi/ibmvscsi/Makefile @@ -1,7 +1,3 @@ -obj-$(CONFIG_SCSI_IBMVSCSI)+= ibmvscsic.o - -ibmvscsic-y+= ibmvscsi.o -ibmvscsic-$(CONFIG_PPC_PSERIES)+= rpa_vscsi.o - +obj-$(CONFIG_SCSI_IBMVSCSI)+= ibmvscsi.o obj-$(CONFIG_SCSI_IBMVSCSIS) += ibmvstgt.o obj-$(CONFIG_SCSI_IBMVFC) += ibmvfc.o diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 3a6c474..d2bd2c0 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -93,13 +93,13 @@ static int max_requests = IBMVSCSI_MAX_REQUESTS_DEFAULT; static int max_events = IBMVSCSI_MAX_REQUESTS_DEFAULT + 2; static int fast_fail = 1; static int client_reserve = 1; +static char partition_name[97] = "UNKNOWN"; +static unsigned int partition_number = -1; static struct scsi_transport_template *ibmvscsi_transport_template; #define IBMVSCSI_VERSION "1.5.9" -static struct ibmvscsi_ops *ibmvscsi_ops; - MODULE_DESCRIPTION("IBM Virtual SCSI"); MODULE_AUTHOR("Dave Boutcher"); MODULE_LICENSE("GPL"); @@ -118,6 +118,315 @@ MODULE_PARM_DESC(fast_fail, "Enable fast fail. [Default=1]"); module_param_named(client_reserve, client_reserve, int, S_IRUGO ); MODULE_PARM_DESC(client_reserve, "Attempt client managed reserve/release"); +static void ibmvscsi_handle_crq(struct viosrp_crq *crq, + struct ibmvscsi_host_data *hostdata); + +/* + * Routines for managing the command/response queue + */ +/** + * ibmvscsi_handle_event: - Interrupt handler for crq events + * @irq: number of irq to handle, not used + * @dev_instance: ibmvscsi_host_data of host that received interrupt + * + * Disables interrupts and schedules srp_task + * Always returns IRQ_HANDLED + */ +static irqreturn_t ibmvscsi_handle_event(int irq, void *dev_instance) +{ + struct ibmvscsi_host_data *hostdata = + (struct ibmvscsi_host_data *)dev_instance; + vio_disable_interrupts(to_vio_dev(hostdata->dev)); + tasklet_schedule(&hostdata->srp_task); + return IRQ_HANDLED; +} + +/** + * release_crq_queue: - Deallocates data and unregisters CRQ + * @queue: crq_queue to initialize and register + * @host_data: ibmvscsi_host_data of host + * + * Frees irq, deallocates a page for messages, unmaps dma, and unregisters + * the crq with the hypervisor. + */ +static void ibmvscsi_release_crq_queue(struct crq_queue *queue, + struct ibmvscsi_host_data *hostdata, + int max_requests) +{ + long rc = 0; + struct vio_dev *vdev = to_vio_dev(hostdata->dev); + free_irq(vdev->irq, (void *)hostdata); + tasklet_kill(&hostdata->srp_task); + do { + if (rc) + msleep(100); + rc = plpar_hcall_norets(H_FREE_CRQ, vdev->unit_address); + } while ((rc == H_BUSY) || (H_IS_LONG_BUSY(rc))); + dma_unmap_single(hostdata->dev, +queue->msg_token, +queue->size * sizeof(*queue->msgs), DMA_BIDIRECTIONAL); + free_page((unsigned long)queue->msgs); +} + +/** + * crq_queue_next_crq: - Returns the next entry in message queue + * @queue: crq_queue to use + * + * Returns pointer to next entry in queue, or NULL if there are no new + * entried in the CRQ. + */ +static struct viosrp_crq *crq_queue_next_crq(struct crq_queue *queue) +{ + struct viosrp_crq *crq; + unsigned long flags; + + spin_lock_irqsave(&queue->lock,
[PATCH] scsi/ibmvscsi: add module alias for ibmvscsic
From: Olaf Hering The driver is named ibmvscsic, at runtime it its name is advertised as ibmvscsi. For this reason mkinitrd wont pickup the driver properly. Reported by IBM during SLES11 beta testing: https://bugzilla.novell.com/show_bug.cgi?id=459933 LTC50724 Signed-off-by: Olaf Hering diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index 3a6c474..e580aa4 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -100,6 +100,9 @@ static struct scsi_transport_template *ibmvscsi_transport_template; static struct ibmvscsi_ops *ibmvscsi_ops; +/* The driver is named ibmvscsic, map ibmvscsi to module name */ +#define IBMVSCSI_NAME "ibmvscsi" +MODULE_ALIAS(IBMVSCSI_NAME); MODULE_DESCRIPTION("IBM Virtual SCSI"); MODULE_AUTHOR("Dave Boutcher"); MODULE_LICENSE("GPL"); @@ -1796,7 +1799,7 @@ static struct device_attribute *ibmvscsi_attrs[] = { static struct scsi_host_template driver_template = { .module = THIS_MODULE, .name = "IBM POWER Virtual SCSI Adapter " IBMVSCSI_VERSION, - .proc_name = "ibmvscsi", + .proc_name = IBMVSCSI_NAME, .queuecommand = ibmvscsi_queuecommand, .eh_abort_handler = ibmvscsi_eh_abort_handler, .eh_device_reset_handler = ibmvscsi_eh_device_reset_handler, @@ -1936,7 +1939,7 @@ static int ibmvscsi_probe(struct vio_dev *vdev, const struct vio_device_id *id) } hostdata->work_thread = kthread_run(ibmvscsi_work, hostdata, "%s_%d", - "ibmvscsi", host->host_no); + IBMVSCSI_NAME, host->host_no); if (IS_ERR(hostdata->work_thread)) { dev_err(&vdev->dev, "couldn't initialize kthread. rc=%ld\n", @@ -2061,7 +2064,7 @@ static struct vio_driver ibmvscsi_driver = { .probe = ibmvscsi_probe, .remove = ibmvscsi_remove, .get_desired_dma = ibmvscsi_get_desired_dma, - .name = "ibmvscsi", + .name = IBMVSCSI_NAME, .pm = &ibmvscsi_pm_ops, }; -- 1.7.10.4 ___ Linuxppc-dev mailing list Linuxppc-dev@lists.ozlabs.org https://lists.ozlabs.org/listinfo/linuxppc-dev