Re: [PATCHv2 0/3] dma ops and virtio

2015-11-02 Thread Sebastian Ott
Hi,

On Fri, 30 Oct 2015, Christian Borntraeger wrote:

> here is the 2nd version of providing an DMA API for s390.
> 
> There are some attempts to unify the dma ops (Christoph) as well
> as some attempts to make virtio use the dma API (Andy).
> 
> At kernel summit we concluded that we want to use the same code on all
> platforms, whereever possible, so having a dummy dma_op might be the
> easiest solution to keep virtio-ccw as similar as possible to
> virtio-pci.Together with a fixed up patch set from Andy Lutomirski
> this seems to work.  
> 
> We will also need a fixup for powerc and QEMU changes to make virtio
> work with iommu on power and x86.
> 
> TODO:
> - future add-on patches to also fold in x86 no iommu
>   - dma_mask
>   - checking?
> - make compilation of dma-noop dependent on something
> 
> v1->v2:
> - initial testing
> - always use dma_noop_ops if device has no private dma_ops
> - get rid of setup in virtio_ccw,kvm_virtio
> - set CONFIG_HAS_DMA(ATTRS) for virtio (fixes compile for !PCI)
> - rename s390_dma_ops to s390_pci_dma_ops
> 
> Christian Borntraeger (3):
>   Provide simple noop dma ops
>   alpha: use common noop dma ops
>   s390/dma: Allow per device dma ops
> 
>  arch/alpha/kernel/pci-noop.c| 46 ++
>  arch/s390/Kconfig   |  3 +-
>  arch/s390/include/asm/device.h  |  6 ++-
>  arch/s390/include/asm/dma-mapping.h |  6 ++-
>  arch/s390/pci/pci.c |  1 +
>  arch/s390/pci/pci_dma.c |  4 +-
>  include/linux/dma-mapping.h |  2 +
>  lib/Makefile|  2 +-
>  lib/dma-noop.c  | 77 
> +
>  9 files changed, 98 insertions(+), 49 deletions(-)
>  create mode 100644 lib/dma-noop.c
> 
> -- 

I agree with these changes in principle. As long as we don't do MMIO
(writel and friends) on a dummy mapping we're fine.

Regards,
Sebastian

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 3/3] s390/dma: Allow per device dma ops

2015-11-02 Thread Sebastian Ott
On Fri, 30 Oct 2015, Christian Borntraeger wrote:

> As virtio-ccw now has dma ops, we can no longer default to the PCI ones.
> Make use of dev_archdata to keep the dma_ops per device. The pci devices
> now use that to override the default, and the default is changed to use
> the noop ops for everything that is not PCI. To compile without PCI
> support we also have to enable the DMA api with virtio.
> 
> Signed-off-by: Christian Borntraeger <borntrae...@de.ibm.com>

Acked-by: Sebastian Ott <seb...@linux.vnet.ibm.com>

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] s390: Add a mechanism to get the subchannel id.

2012-08-14 Thread Sebastian Ott

On Tue, 7 Aug 2012, Cornelia Huck wrote:
 +/**
 + * ccw_device_get_schid - obtain a subchannel id
 + * @cdev: device to obtain the id for
 + * @schid: where to fill in the values
 + */
 +void ccw_device_get_schid(struct ccw_device *cdev, struct subchannel_id 
 *schid)
 +{
 + *schid = cdev-private-schid;
 +}
 +EXPORT_SYMBOL(ccw_device_get_schid);

After I gave this some thought I like your version of this function
better. But please use the id of the parent subchannel instead of the
copy in cdev-private (since this will be removed soon). I'll do a
cleanup patch to convert the internal users of the old function to use
the one above.

Regards,
Sebastian

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] s390: Add a mechanism to get the subchannel id.

2012-08-14 Thread Sebastian Ott

On Tue, 14 Aug 2012, Cornelia Huck wrote:
 Sebastian Ott seb...@linux.vnet.ibm.com wrote:
  On Tue, 7 Aug 2012, Cornelia Huck wrote:
   +/**
   + * ccw_device_get_schid - obtain a subchannel id
   + * @cdev: device to obtain the id for
   + * @schid: where to fill in the values
   + */
   +void ccw_device_get_schid(struct ccw_device *cdev, struct subchannel_id 
   *schid)
   +{
   + *schid = cdev-private-schid;
   +}
   +EXPORT_SYMBOL(ccw_device_get_schid);
  
  After I gave this some thought I like your version of this function
  better. But please use the id of the parent subchannel instead of the
  copy in cdev-private (since this will be removed soon). I'll do a
  cleanup patch to convert the internal users of the old function to use
  the one above.
 
 Good, will change that (I think we can rely on a ccw device always
 having either a real subchannel or the orphanage pseudo subchannel as
 parent).

Yes you can rely on that.

 
 Small taste question: EXPORT_SYMBOL vs EXPORT_SYMBOL_GPL?

get_subchannel_id was EXPORT_SYMBOL_GPL since its going to replace this
let's use the _GPL variant.

Regards,
Sebastian

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 2/4] s390: Add a mechanism to get the subchannel id.

2012-08-13 Thread Sebastian Ott
On Tue, 7 Aug 2012, Cornelia Huck wrote:
 This will be needed by the new virtio-ccw transport.

We already have ccw_device_get_subchannel_id which is currently used by
qdio only and thus buried in an internal header file. So it would be
better to just clean up this one and make it available to virtio-ccw.
The function looks a little different to what you suggested by it should
do the trick.

---
 arch/s390/include/asm/ccwdev.h |2 ++
 drivers/s390/cio/device.c  |   11 ---
 drivers/s390/cio/device.h  |2 --
 drivers/s390/cio/device_ops.c  |   13 +
 4 files changed, 15 insertions(+), 13 deletions(-)

--- a/arch/s390/include/asm/ccwdev.h
+++ b/arch/s390/include/asm/ccwdev.h
@@ -10,6 +10,7 @@
 
 #include linux/device.h
 #include linux/mod_devicetable.h
+#include asm/schid.h
 #include asm/fcx.h
 #include asm/irq.h
 
@@ -226,5 +227,6 @@ int ccw_device_siosl(struct ccw_device *
 // FIXME: these have to go
 extern int _ccw_device_get_subchannel_number(struct ccw_device *);
 
+extern struct subchannel_id ccw_device_get_subchannel_id(struct ccw_device *);
 extern void *ccw_device_get_chp_desc(struct ccw_device *, int);
 #endif /* _S390_CCWDEV_H_ */
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -2037,16 +2037,6 @@ void ccw_driver_unregister(struct ccw_dr
driver_unregister(cdriver-driver);
 }
 
-/* Helper func for qdio. */
-struct subchannel_id
-ccw_device_get_subchannel_id(struct ccw_device *cdev)
-{
-   struct subchannel *sch;
-
-   sch = to_subchannel(cdev-dev.parent);
-   return sch-schid;
-}
-
 static void ccw_device_todo(struct work_struct *work)
 {
struct ccw_device_private *priv;
@@ -2139,4 +2129,3 @@ EXPORT_SYMBOL(ccw_device_set_offline);
 EXPORT_SYMBOL(ccw_driver_register);
 EXPORT_SYMBOL(ccw_driver_unregister);
 EXPORT_SYMBOL(get_ccwdev_by_busid);
-EXPORT_SYMBOL_GPL(ccw_device_get_subchannel_id);
--- a/drivers/s390/cio/device.h
+++ b/drivers/s390/cio/device.h
@@ -142,9 +142,7 @@ int ccw_device_notify(struct ccw_device 
 void ccw_device_set_disconnected(struct ccw_device *cdev);
 void ccw_device_set_notoper(struct ccw_device *cdev);
 
-/* qdio needs this. */
 void ccw_device_set_timeout(struct ccw_device *, int);
-extern struct subchannel_id ccw_device_get_subchannel_id(struct ccw_device *);
 
 /* Channel measurement facility related */
 void retry_set_schib(struct ccw_device *cdev);
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -763,6 +763,19 @@ _ccw_device_get_subchannel_number(struct
return cdev-private-schid.sch_no;
 }
 
+/**
+ * ccw_device_get_subchannel_id - obtain a subchannel id
+ * @cdev: device to obtain the id for
+ * Return struct subchannel_id of the parent subchannel.
+ */
+struct subchannel_id ccw_device_get_subchannel_id(struct ccw_device *cdev)
+{
+   struct subchannel *sch;
+
+   sch = to_subchannel(cdev-dev.parent);
+   return sch-schid;
+}
+EXPORT_SYMBOL_GPL(ccw_device_get_subchannel_id);
 
 MODULE_LICENSE(GPL);
 EXPORT_SYMBOL(ccw_device_set_options_mask);

--
To unsubscribe from this list: send the line unsubscribe kvm in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html