[PATCH] staging/slicoss: Use ethtool_ops instead of module_param.

2015-12-04 Thread Kevin Wern
ethtool_ops has attributes in sub struct ethool_coalesce that
correspond to the parameters intagg_delay and dynamic_intagg. It is
preferable to set these properties with ethtool rather than
module_param, so create these attributes in adapter and set them using
ethtool_coalesce's rx_coalesce_usecs and rx_use_adaptive_coalesce.
(Outlined in TODO file)
---
 drivers/staging/slicoss/slic.h|  2 ++
 drivers/staging/slicoss/slicoss.c | 38 --
 2 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index c95b3ab..cc0afee 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -478,6 +478,8 @@ struct adapter {
u32 max_isr_xmits;
u32 rcv_interrupt_yields;
u32 intagg_period;
+   u32 intagg_delay;
+   u32 dynamic_intagg;
struct inicpm_state*inicpm_info;
void *pinicpm_info;
struct slic_ifevents  if_events;
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index b23a2d1..3f94af46 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -102,8 +102,7 @@ static char *slic_banner = "Alacritech SLIC Technology(tm) 
Server and Storage Ac
 static char *slic_proc_version = "2.0.351  2006/07/14 12:26:00";
 
 static struct base_driver slic_global = { {}, 0, 0, 0, 1, NULL, NULL };
-static int intagg_delay = 100;
-static u32 dynamic_intagg;
+#define DEFAULT_INTAGG_DELAY 100
 static unsigned int rcv_count;
 
 #define DRV_NAME  "slicoss"
@@ -119,11 +118,6 @@ MODULE_AUTHOR(DRV_AUTHOR);
 MODULE_DESCRIPTION(DRV_DESCRIPTION);
 MODULE_LICENSE("Dual BSD/GPL");
 
-module_param(dynamic_intagg, int, 0);
-MODULE_PARM_DESC(dynamic_intagg, "Dynamic Interrupt Aggregation Setting");
-module_param(intagg_delay, int, 0);
-MODULE_PARM_DESC(intagg_delay, "uSec Interrupt Aggregation Delay");
-
 static const struct pci_device_id slic_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ALACRITECH, SLIC_1GB_DEVICE_ID) },
{ PCI_DEVICE(PCI_VENDOR_ID_ALACRITECH, SLIC_2GB_DEVICE_ID) },
@@ -2860,7 +2854,7 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
if (slic_global.dynamic_intagg)
slic_intagg_set(adapter, 0);
else
-   slic_intagg_set(adapter, intagg_delay);
+   slic_intagg_set(adapter, adapter->intagg_delay);
 
/*
 *  Initialize ping status to "ok"
@@ -2881,6 +2875,26 @@ card_init_err:
return status;
 }
 
+static int slic_get_coalesce(struct net_device *dev,
+struct ethtool_coalesce *coalesce)
+{
+   struct adapter *adapter = netdev_priv(dev);
+
+   adapter->intagg_delay = coalesce->rx_coalesce_usecs;
+   adapter->dynamic_intagg = coalesce->use_adaptive_rx_coalesce;
+   return 0;
+}
+
+static int slic_set_coalesce(struct net_device *dev,
+struct ethtool_coalesce *coalesce)
+{
+   struct adapter *adapter = netdev_priv(dev);
+
+   coalesce->rx_coalesce_usecs = adapter->intagg_delay;
+   coalesce->use_adaptive_rx_coalesce = adapter->dynamic_intagg;
+   return 0;
+}
+
 static void slic_init_driver(void)
 {
if (slic_first_init) {
@@ -3069,8 +3083,6 @@ static int slic_entry_probe(struct pci_dev *pcidev,
struct sliccard *card = NULL;
int pci_using_dac = 0;
 
-   slic_global.dynamic_intagg = dynamic_intagg;
-
err = pci_enable_device(pcidev);
 
if (err)
@@ -3118,6 +3130,7 @@ static int slic_entry_probe(struct pci_dev *pcidev,
adapter = netdev_priv(netdev);
adapter->netdev = netdev;
adapter->pcidev = pcidev;
+   slic_global.dynamic_intagg = adapter->dynamic_intagg;
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
 
@@ -3204,5 +3217,10 @@ static void __exit slic_module_cleanup(void)
pci_unregister_driver(&slic_driver);
 }
 
+static struct ethtool_ops slic_ethtool_ops = {
+   .get_coalesce = slic_get_coalesce,
+   .set_coalesce = slic_get_coalesce
+};
+
 module_init(slic_module_init);
 module_exit(slic_module_cleanup);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv6 1/5] drm/dp: add DPCD definitions from DP 1.1

2015-12-04 Thread Enric Balletbo i Serra
Add a number of DPCD definitions from DP 1.1

Signed-off-by: Enric Balletbo i Serra 
---
 include/drm/drm_dp_helper.h | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
index bb9d0de..9b0c990 100644
--- a/include/drm/drm_dp_helper.h
+++ b/include/drm/drm_dp_helper.h
@@ -73,6 +73,7 @@
 # define DP_ENHANCED_FRAME_CAP (1 << 7)
 
 #define DP_MAX_DOWNSPREAD   0x003
+# define DP_PERCENT_DOWNSPREAD_0_5 (1 << 0)
 # define DP_NO_AUX_HANDSHAKE_LINK_TRAINING  (1 << 6)
 
 #define DP_NORP 0x004
@@ -225,6 +226,7 @@
 # define DP_LINK_BW_1_62   0x06
 # define DP_LINK_BW_2_70x0a
 # define DP_LINK_BW_5_40x14/* 1.2 */
+# define DP_LINK_BW_6_75   0x19
 
 #define DP_LANE_COUNT_SET  0x101
 # define DP_LANE_COUNT_MASK0x0f
@@ -354,6 +356,7 @@
 #define DP_PAYLOAD_ALLOCATE_TIME_SLOT_COUNT 0x1c2
 
 #define DP_SINK_COUNT  0x200
+# define DP_SINK_COUNT_MASK0x3f
 /* prior to 1.2 bit 7 was reserved mbz */
 # define DP_GET_SINK_COUNT(x)  x) & 0x80) >> 1) | ((x) & 0x3f))
 # define DP_SINK_CP_READY  (1 << 6)
@@ -399,6 +402,10 @@
 # define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK   0xc0
 # define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT  6
 
+#define DP_SYMBOL_ERROR_COUNT_LANE00x210
+# define DP_ERROR_COUNT_BITS_14_8_MASK 0x7f
+# define DP_ERROR_COUNT_VALID  (1 << 7)
+
 #define DP_TEST_REQUEST0x218
 # define DP_TEST_LINK_TRAINING (1 << 0)
 # define DP_TEST_LINK_VIDEO_PATTERN(1 << 1)
@@ -418,6 +425,8 @@
 #define DP_TEST_CRC_G_Y0x242
 #define DP_TEST_CRC_B_CB   0x244
 
+#define DP_PHY_TEST_PATTERN0x248 /* DPCD >= 1.1 */
+
 #define DP_TEST_SINK_MISC  0x246
 # define DP_TEST_CRC_SUPPORTED (1 << 5)
 # define DP_TEST_COUNT_MASK0xf
@@ -447,6 +456,7 @@
 # define DP_SET_POWER_D00x1
 # define DP_SET_POWER_D30x2
 # define DP_SET_POWER_MASK  0x3
+# define DP_SET_POWER_12_MASK  0x7/* DPCD >= 1.2 */
 
 #define DP_EDP_DPCD_REV0x700/* eDP 1.2 */
 # define DP_EDP_11 0x00
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv6 4/5] devicetree: Add new ANX7814 SlimPort transmitter binding.

2015-12-04 Thread Enric Balletbo i Serra
The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
designed for portable devices.

You can add support to your board with current binding.

Example:

anx7814: anx7814@38 {
compatible = "analogix,anx7814";
reg = <0x38>;
interrupt-parent = <&gpio0>
interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
pd-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
reset-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
v10-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
ports {
anx7814_in: endpoint {
remote-endpoint = <&hdmi0_out>;
};
};
};

Signed-off-by: Enric Balletbo i Serra 
---

Changes since last version (requested by Rob Herring)
- Specify how many ports and how many endpoints for each port
- Simplify to just port (dropping ports)
- For cable det use an interrupt instead (to a gpio controller)

 .../devicetree/bindings/video/bridge/anx7814.txt   | 39 ++
 1 file changed, 39 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/bridge/anx7814.txt

diff --git a/Documentation/devicetree/bindings/video/bridge/anx7814.txt 
b/Documentation/devicetree/bindings/video/bridge/anx7814.txt
new file mode 100644
index 000..4e68789
--- /dev/null
+++ b/Documentation/devicetree/bindings/video/bridge/anx7814.txt
@@ -0,0 +1,39 @@
+Analogix ANX7814 SlimPort (Full-HD Transmitter)
+---
+
+The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
+designed for portable devices.
+
+Required properties:
+
+ - compatible  : "analogix,anx7814"
+ - reg : I2C address of the device
+ - interrupt-parent: Should be the phandle of the interrupt controller
+ that services interrupts for this device
+ - interrupts  : Should contain the cable detection interrupt
+ - pd-gpios: Which GPIO to use for power down
+ - reset-gpios : Which GPIO to use for reset
+
+Optional properties:
+
+ - v10-gpios   : Which GPIO to use for V10 control.
+ - Video port for HDMI output, using the DT bindings defined in [1].
+
+[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
+
+Example:
+
+   anx7814: anx7814@38 {
+   compatible = "analogix,anx7814";
+   reg = <0x38>;
+   interrupt-parent = <&gpio0>
+   interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
+   pd-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
+   reset-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
+   v10-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
+   ports {
+   anx7814_in: endpoint {
+   remote-endpoint = <&hdmi0_out>;
+   };
+   };
+   };
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv6 2/5] hdmi: added functions for MPEG InfoFrames

2015-12-04 Thread Enric Balletbo i Serra
The MPEG Source (MS) InfoFrame is in EIA/CEA-861B. It describes aspects of
the compressed video stream that were used to produce the uncompressed
video.

The patch adds functions to work with MPEG InfoFrames.

Signed-off-by: Enric Balletbo i Serra 
---

Changes since last version (requested by Thierry Redding)
 - hdmi_infoframe_pack: Fix missing break
 - hdmi_mpeg_picture_get_name: return NULL instead of "Reserved"
 - hdmi_mpeg_picture_get_name: use more canonical names "I-Frame", "P-Frame", 
etc
 - hdmi_mpeg_infoframe_unpack: remove braces that aren't needed
 - hdmi_vendor_any_infoframe: s/mpeg/MPEG/

 drivers/video/hdmi.c | 156 +++
 include/linux/hdmi.h |  24 
 2 files changed, 180 insertions(+)

diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index 1626892..47121a6 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -388,6 +388,81 @@ ssize_t hdmi_vendor_infoframe_pack(struct 
hdmi_vendor_infoframe *frame,
 }
 EXPORT_SYMBOL(hdmi_vendor_infoframe_pack);
 
+/**
+ * hdmi_mpeg_infoframe_init() - initialize an HDMI MPEG infoframe
+ * @frame: HDMI MPEG infoframe
+ *
+ * Returns 0 on success or a negative error code on failure.
+ */
+int hdmi_mpeg_infoframe_init(struct hdmi_mpeg_infoframe *frame)
+{
+   memset(frame, 0, sizeof(*frame));
+
+   frame->type = HDMI_INFOFRAME_TYPE_MPEG;
+   frame->version = 1;
+   frame->length = HDMI_MPEG_INFOFRAME_SIZE;
+
+   return 0;
+}
+EXPORT_SYMBOL(hdmi_mpeg_infoframe_init);
+
+/**
+ * hdmi_mpeg_infoframe_pack() - write HDMI MPEG infoframe to binary buffer
+ * @frame: HDMI MPEG infoframe
+ * @buffer: destination buffer
+ * @size: size of buffer
+ *
+ * Packs the information contained in the @frame structure into a binary
+ * representation that can be written into the corresponding controller
+ * registers. Also computes the checksum as required by section 5.3.5 of
+ * the HDMI 1.4 specification.
+ *
+ * Returns the number of bytes packed into the binary buffer or a negative
+ * error code on failure.
+ */
+ssize_t hdmi_mpeg_infoframe_pack(struct hdmi_mpeg_infoframe *frame,
+void *buffer, size_t size)
+{
+   u8 *ptr = buffer;
+   size_t length;
+
+   length = HDMI_INFOFRAME_HEADER_SIZE + frame->length;
+
+   if (size < length)
+   return -ENOSPC;
+
+   memset(buffer, 0, size);
+
+   ptr[0] = frame->type;
+   ptr[1] = frame->version;
+   ptr[2] = frame->length;
+   ptr[3] = 0; /* checksum */
+
+   /* start infoframe payload */
+   ptr += HDMI_INFOFRAME_HEADER_SIZE;
+
+   /*
+* The MPEG Bit Rate is stored as a 32-bit number and is expressed in
+* Hertz. MB#0 contains the least significant byte while MB#3 contains
+* the most significant byte. If the MPEG Bit Rate is unknown or this
+* field doesn’t apply, then all of the bits in Data Bytes 1-4 shall
+* be set to 0.
+*/
+   ptr[0] = frame->bitrate & 0x00ff;
+   ptr[1] = (frame->bitrate & 0xff00) >> 8;
+   ptr[2] = (frame->bitrate & 0x00ff) >> 16;
+   ptr[3] = (frame->bitrate & 0xff00) >> 24;
+
+   ptr[4] = frame->frame_type;
+   if (frame->repeated)
+   ptr[4] |= BIT(4);
+
+   hdmi_infoframe_set_checksum(buffer, length);
+
+   return length;
+}
+EXPORT_SYMBOL(hdmi_mpeg_infoframe_pack);
+
 /*
  * hdmi_vendor_any_infoframe_pack() - write a vendor infoframe to binary buffer
  */
@@ -435,6 +510,9 @@ hdmi_infoframe_pack(union hdmi_infoframe *frame, void 
*buffer, size_t size)
length = hdmi_vendor_any_infoframe_pack(&frame->vendor,
buffer, size);
break;
+   case HDMI_INFOFRAME_TYPE_MPEG:
+   length = hdmi_mpeg_infoframe_pack(&frame->mpeg, buffer, size);
+   break;
default:
WARN(1, "Bad infoframe type %d\n", frame->any.type);
length = -EINVAL;
@@ -457,6 +535,8 @@ static const char *hdmi_infoframe_type_get_name(enum 
hdmi_infoframe_type type)
return "Source Product Description (SPD)";
case HDMI_INFOFRAME_TYPE_AUDIO:
return "Audio";
+   case HDMI_INFOFRAME_TYPE_MPEG:
+   return "MPEG";
}
return "Reserved";
 }
@@ -899,6 +979,41 @@ static void hdmi_audio_infoframe_log(const char *level,
frame->downmix_inhibit ? "Yes" : "No");
 }
 
+static const char *hdmi_mpeg_picture_get_name(enum hdmi_mpeg_frame_type type)
+{
+   switch (type) {
+   case HDMI_MPEG_UNKNOWN_FRAME:
+   return "Unknown";
+   case HDMI_MPEG_I_FRAME:
+   return "Intra-coded picture";
+   case HDMI_MPEG_B_FRAME:
+   return "Bi-predictive picture";
+   case HDMI_MPEG_P_FRAME:
+   return "Predicted picture";
+   }
+   return NULL;
+}
+
+/**
+ * hdmi_mpeg_infoframe_lo

[PATCHv6 5/5] drm: bridge: anx78xx: Add anx78xx driver support by analogix.

2015-12-04 Thread Enric Balletbo i Serra
At the moment it only supports ANX7814.

The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
designed for portable devices. The ANX7814 transforms the HDMI output of
an application processor to MyDP or DisplayPort.

The driver supports HDMI to DP pass-through mode and works using external
adapters that converts MyDP or DisplayPort to HDMI or DVI.

Signed-off-by: Enric Balletbo i Serra 
---

Changes since last version:
- Fix auto build test ERROR (anx78xx->bridge.of_node = client->dev.of_node)
- Remove more magic numbers and use DP_ defines from hdmi.h
- Use common dp/hdmi defines instead of redefine it.
- Improve a bit the documentation of the driver.
- Improve debug messages.
- Use devm to request the irq.

 drivers/gpu/drm/bridge/Kconfig   |2 +
 drivers/gpu/drm/bridge/Makefile  |1 +
 drivers/gpu/drm/bridge/anx78xx/Kconfig   |5 +
 drivers/gpu/drm/bridge/anx78xx/Makefile  |4 +
 drivers/gpu/drm/bridge/anx78xx/anx78xx.h |   44 +
 drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c|  334 +++
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c | 3210 ++
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h |  110 +
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h |  737 +
 9 files changed, 4447 insertions(+)
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/Kconfig
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/Makefile
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx.h
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h

diff --git a/drivers/gpu/drm/bridge/Kconfig b/drivers/gpu/drm/bridge/Kconfig
index 639..1d92bc1 100644
--- a/drivers/gpu/drm/bridge/Kconfig
+++ b/drivers/gpu/drm/bridge/Kconfig
@@ -41,4 +41,6 @@ config DRM_PARADE_PS8622
---help---
  Parade eDP-LVDS bridge chip driver.
 
+source "drivers/gpu/drm/bridge/anx78xx/Kconfig"
+
 endmenu
diff --git a/drivers/gpu/drm/bridge/Makefile b/drivers/gpu/drm/bridge/Makefile
index d4e28be..0e9fdb4 100644
--- a/drivers/gpu/drm/bridge/Makefile
+++ b/drivers/gpu/drm/bridge/Makefile
@@ -4,3 +4,4 @@ obj-$(CONFIG_DRM_DW_HDMI) += dw_hdmi.o
 obj-$(CONFIG_DRM_DW_HDMI_AHB_AUDIO) += dw_hdmi-ahb-audio.o
 obj-$(CONFIG_DRM_NXP_PTN3460) += nxp-ptn3460.o
 obj-$(CONFIG_DRM_PARADE_PS8622) += parade-ps8622.o
+obj-$(CONFIG_DRM_ANX78XX) += anx78xx/
diff --git a/drivers/gpu/drm/bridge/anx78xx/Kconfig 
b/drivers/gpu/drm/bridge/anx78xx/Kconfig
new file mode 100644
index 000..5be362d
--- /dev/null
+++ b/drivers/gpu/drm/bridge/anx78xx/Kconfig
@@ -0,0 +1,5 @@
+config DRM_ANX78XX
+   tristate "Analogix ANX78XX bridge"
+   help
+ ANX78XX is a HD video transmitter chip over micro-USB
+ connector for smartphone device.
diff --git a/drivers/gpu/drm/bridge/anx78xx/Makefile 
b/drivers/gpu/drm/bridge/anx78xx/Makefile
new file mode 100644
index 000..a843733
--- /dev/null
+++ b/drivers/gpu/drm/bridge/anx78xx/Makefile
@@ -0,0 +1,4 @@
+obj-${CONFIG_DRM_ANX78XX} :=  anx78xx.o
+
+anx78xx-y += anx78xx_main.o
+anx78xx-y += slimport_tx_drv.o
diff --git a/drivers/gpu/drm/bridge/anx78xx/anx78xx.h 
b/drivers/gpu/drm/bridge/anx78xx/anx78xx.h
new file mode 100644
index 000..6548918
--- /dev/null
+++ b/drivers/gpu/drm/bridge/anx78xx/anx78xx.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright(c) 2015, Analogix Semiconductor. All rights reserved.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 2 and
+ * only version 2 as published by the Free Software Foundation.
+ *
+ * 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.
+ *
+ */
+
+#ifndef __ANX78xx_H
+#define __ANX78xx_H
+
+#include 
+#include 
+#include 
+#include 
+#include 
+
+#include 
+
+struct anx78xx_platform_data {
+   struct gpio_desc *gpiod_pd;
+   struct gpio_desc *gpiod_reset;
+   struct gpio_desc *gpiod_v10;
+};
+
+struct anx78xx {
+   struct drm_bridge bridge;
+   struct i2c_client *client;
+   struct anx78xx_platform_data *pdata;
+   struct delayed_work work;
+   struct workqueue_struct *workqueue;
+};
+
+void anx78xx_poweron(struct anx78xx *data);
+void anx78xx_poweroff(struct anx78xx *data);
+bool anx78xx_cable_is_detected(struct anx78xx *anx78xx);
+
+#endif
diff --git a/drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c 
b/drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
new file mode 100644
index 000..0101c23
--- /dev/null
+++ b/drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
@@ -0,0 +1,334 @@
+/*
+ * Copyright(c) 2015, Analogix Semiconductor. All right

[PATCHv6 0/5] Add initial support for slimport anx78xx

2015-12-04 Thread Enric Balletbo i Serra
Hi all,

This is another version of the patch set to introduce the anx7814 transmitter.
Any comments are welcome.

The following series add initial support for the Slimport ANX7814 transmitter, a
ultra-low power Full-HD (1080p60) transmitter designed for portable device.

The driver was originally created and based from the work of Junhua Xia from
Analogix. This driver is a refactor of the original driver and fixes different
coding style lines, and different errors/warnings reported by checkpatch. Also
there were things that I noticed that we need to change like:

 - Convert the numbered GPIO API to the new descriptor based GPIO API.
 - Review the DT binding
 - Add missing MODULE_DEVICE_TABLE(of, ...);
 - Fix Makefiles and Kconfig to build conditionally.
 - Use SIMPLE_DEV_PM_OPS() instead of the deprecated i2c .suspend and
  .resume callbacks.
 - Move to use managed device resources.
 - Remove dead/unused code.
 - And others ...

Changes since last version:
 - Add the revision history within the respective patches (requested by Emil)
 - Add two new patches 01 and 02 as part of the series (requested by Thierry)

Enric Balletbo i Serra (5):
  drm/dp: add DPCD definitions from DP 1.1
  hdmi: added functions for MPEG InfoFrames
  of: Add vendor prefix for Analogix Semiconductor, Inc.
  devicetree: Add new ANX7814 SlimPort transmitter binding.
  drm: bridge: anx78xx: Add anx78xx driver support by analogix.

 .../devicetree/bindings/vendor-prefixes.txt|1 +
 .../devicetree/bindings/video/bridge/anx7814.txt   |   39 +
 drivers/gpu/drm/bridge/Kconfig |2 +
 drivers/gpu/drm/bridge/Makefile|1 +
 drivers/gpu/drm/bridge/anx78xx/Kconfig |5 +
 drivers/gpu/drm/bridge/anx78xx/Makefile|4 +
 drivers/gpu/drm/bridge/anx78xx/anx78xx.h   |   44 +
 drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c  |  334 ++
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c   | 3210 
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h   |  110 +
 drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h   |  737 +
 drivers/video/hdmi.c   |  156 +
 include/drm/drm_dp_helper.h|   10 +
 include/linux/hdmi.h   |   24 +
 14 files changed, 4677 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/video/bridge/anx7814.txt
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/Kconfig
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/Makefile
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx.h
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/anx78xx_main.c
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.c
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_drv.h
 create mode 100644 drivers/gpu/drm/bridge/anx78xx/slimport_tx_reg.h

-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCHv6 3/5] of: Add vendor prefix for Analogix Semiconductor, Inc.

2015-12-04 Thread Enric Balletbo i Serra
Analogix Semiconductor develops analog and mixed-signal devices for digital
media and communications interconnect applications.

Signed-off-by: Enric Balletbo i Serra 
Acked-by: Rob Herring 
---

Changes since last version (requested by Rob Herring)
- Fix alphabetical order.

 Documentation/devicetree/bindings/vendor-prefixes.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt 
b/Documentation/devicetree/bindings/vendor-prefixes.txt
index 55df1d4..201d3e1 100644
--- a/Documentation/devicetree/bindings/vendor-prefixes.txt
+++ b/Documentation/devicetree/bindings/vendor-prefixes.txt
@@ -21,6 +21,7 @@ amlogic   Amlogic, Inc.
 ampire Ampire Co., Ltd.
 amsAMS AG
 amstaosAMS-Taos Inc.
+analogix   Analogix Semiconductor, Inc.
 apmApplied Micro Circuits Corporation (APM)
 aptina Aptina Imaging
 arasan Arasan Chip Systems
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] storvsc: add more logging for error and warning messages

2015-12-04 Thread Joe Perches
On Thu, 2015-12-03 at 19:47 -0800, Long Li wrote:
> Introduce a logging level for storvsc to log certain error/warning
> messages. Those messages are helpful in some environments, e.g.
> Microsoft Azure, for customer support and troubleshooting purposes.
[]
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
[]
> +static inline bool do_logging(int level)
> +{
> + return (logging_level >= level) ? true : false;

The ternary is not necessary

return logging_level >= level;

is enough

> +}
> +
> +
>  struct vmscsi_win8_extension {
>   /*
>    * The following were added in Windows 8
> @@ -1183,7 +1198,7 @@ static void storvsc_command_completion(struct 
> storvsc_cmd_request *cmd_request)
>  
>   scmnd->result = vm_srb->scsi_status;
>  
> - if (scmnd->result) {
> + if (scmnd->result && do_logging(STORVSC_LOGGING_ERROR)) {
>   if (scsi_normalize_sense(scmnd->sense_buffer,
>   SCSI_SENSE_BUFFERSIZE, &sense_hdr))
>   scsi_print_sense_hdr(scmnd->device, "storvsc",

Is it appropriate to make this scsi_normalize_sense call
conditional on do_logging here?

> @@ -1239,12 +1254,25 @@ static void storvsc_on_io_completion(struct hv_device 
> *device,
>   stor_pkt->vm_srb.sense_info_length =
>   vstor_packet->vm_srb.sense_info_length;
>  
> + if (vstor_packet->vm_srb.scsi_status != 0 ||
> + vstor_packet->vm_srb.srb_status != SRB_STATUS_SUCCESS)
> + if (do_logging(STORVSC_LOGGING_WARN))
> + dev_warn(&device->device,
> + "cmd 0x%x scsi status 0x%x srb status 0x%x\n",
> + stor_pkt->vm_srb.cdb[0],
> + vstor_packet->vm_srb.scsi_status,
> + vstor_packet->vm_srb.srb_status);

It might make some sense to use another macro indirection like

#define svc_log_warn(dev, level, fmt, ...)  \
do {\
if (do_logging(STORSVC_LOGGING_##level) \
dev_warn(&(dev)->device, fmt, ##__VA_ARGS__);   \
} while (0)

So a use could be:

if (vstore_packet...)
svc_log_warn(device, WARN, ...);

> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] storvsc: add more logging for error and warning messages

2015-12-04 Thread Vitaly Kuznetsov
Long Li  writes:

> Introduce a logging level for storvsc to log certain error/warning
> messages. Those messages are helpful in some environments,
> e.g. Microsoft Azure, for customer support and troubleshooting
> purposes.

I have an alternative suggestion: let's use dynamic debug! Basically, we
need to convert all non-error logging to using dev_dbg() and this can be
enabled dynamically when needed, even reboot won't be required.

>
> Signed-off-by: Long Li 
> ---
>  drivers/scsi/storvsc_drv.c | 30 +-
>  1 file changed, 29 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> index 40c43ae..afa1647 100644
> --- a/drivers/scsi/storvsc_drv.c
> +++ b/drivers/scsi/storvsc_drv.c
> @@ -164,6 +164,21 @@ static int sense_buffer_size = 
> PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE;
>  */
>  static int vmstor_proto_version;
>
> +#define STORVSC_LOGGING_NONE 0
> +#define STORVSC_LOGGING_ERROR1
> +#define STORVSC_LOGGING_WARN 2
> +
> +static int logging_level = STORVSC_LOGGING_ERROR;
> +module_param(logging_level, int, S_IRUGO|S_IWUSR);
> +MODULE_PARM_DESC(logging_level,
> + "Logging level, 0 - None, 1 - Error (default), 2 - Warning.");
> +
> +static inline bool do_logging(int level)
> +{
> + return (logging_level >= level) ? true : false;
> +}
> +
> +
>  struct vmscsi_win8_extension {
>   /*
>* The following were added in Windows 8
> @@ -1183,7 +1198,7 @@ static void storvsc_command_completion(struct 
> storvsc_cmd_request *cmd_request)
>
>   scmnd->result = vm_srb->scsi_status;
>
> - if (scmnd->result) {
> + if (scmnd->result && do_logging(STORVSC_LOGGING_ERROR)) {
>   if (scsi_normalize_sense(scmnd->sense_buffer,
>   SCSI_SENSE_BUFFERSIZE, &sense_hdr))
>   scsi_print_sense_hdr(scmnd->device, "storvsc",
> @@ -1239,12 +1254,25 @@ static void storvsc_on_io_completion(struct hv_device 
> *device,
>   stor_pkt->vm_srb.sense_info_length =
>   vstor_packet->vm_srb.sense_info_length;
>
> + if (vstor_packet->vm_srb.scsi_status != 0 ||
> + vstor_packet->vm_srb.srb_status != SRB_STATUS_SUCCESS)
> + if (do_logging(STORVSC_LOGGING_WARN))
> + dev_warn(&device->device,
> + "cmd 0x%x scsi status 0x%x srb status 0x%x\n",
> + stor_pkt->vm_srb.cdb[0],
> + vstor_packet->vm_srb.scsi_status,
> + vstor_packet->vm_srb.srb_status);
>
>   if ((vstor_packet->vm_srb.scsi_status & 0xFF) == 0x02) {
>   /* CHECK_CONDITION */
>   if (vstor_packet->vm_srb.srb_status &
>   SRB_STATUS_AUTOSENSE_VALID) {
>   /* autosense data available */
> + if (do_logging(STORVSC_LOGGING_WARN))
> + dev_warn(&device->device,
> + "stor pkt %p autosense data valid - len 
> %d\n",
> + request,
> + vstor_packet->vm_srb.sense_info_length);
>
>   memcpy(request->cmd->sense_buffer,
>  vstor_packet->vm_srb.sense_data,

-- 
  Vitaly
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: skein: macros moved to header file

2015-12-04 Thread Jason Cooper
Oh hell.  :)

Go ahead and try to configure git send-mail, or configure Thunderbird
according to Documentation/email-clients.txt.  If you want, send it to
me off list first to confirm it's not getting mangled like below.

I think you just won the obfuscated C contest...

thx,

Jason.

On Fri, Dec 04, 2015 at 07:09:49AM +, Sanidhya Solanki wrote:
> Staging: Skein:   Moved macros from skein_block.c to header file.
> The original code defined macros in the source code, making it harder toread. 
> Move them to the header file.
> Signed-off-by: Sanidhya Solanki 
> --- drivers/staging/skein/skein_block.c | 321 
> --- drivers/staging/skein/skein_block.h | 323 
>  2 files changed, 323 insertions(+), 321 
> deletions(-)
> diff --git a/drivers/staging/skein/skein_block.c 
> b/drivers/staging/skein/skein_block.cindex 45b4732..9701f95 100644--- 
> a/drivers/staging/skein/skein_block.c+++ 
> b/drivers/staging/skein/skein_block.c@@ -18,327 +18,6 @@ #include 
> "skein_base.h" #include "skein_block.h" -#ifndef SKEIN_USE_ASM-#define 
> SKEIN_USE_ASM   (0) /* default is all C code (no ASM) */-#endif--#ifndef 
> SKEIN_LOOP-#define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 
> 1024 */-#endif--#define BLK_BITS        (WCNT * 64) /* some useful 
> definitions for code here */-#define KW_TWK_BASE     (0)-#define KW_KEY_BASE 
>     (3)-#define ks              (kw + KW_KEY_BASE)-#define ts             
>  (kw + KW_TWK_BASE)--#ifdef SKEIN_DEBUG-#define debug_save_tweak(ctx)       
> \-{                                   \-  ctx->h.tweak[0] = ts[0];   
>  \-   ctx->h.tweak[1] = ts[1];    \-}-#else-#define 
> debug_save_tweak(ctx)-#endif--#if !(SKEIN_USE_ASM & 256)-#undef  RCNT-#define 
> RCNT (SKEIN_256_ROUNDS_TOTAL / 8)-#ifdef SKEIN_LOOP /* configure how much to 
> unroll the loop */-#define SKEIN_UNROLL_256 (((SKEIN_LOOP) / 100) % 
> 10)-#else-#define SKEIN_UNROLL_256 (0)-#endif--#if SKEIN_UNROLL_256-#if (RCNT 
> % SKEIN_UNROLL_256)-#error "Invalid SKEIN_UNROLL_256" /* sanity check on 
> unroll count */-#endif-#endif-#define ROUND256(p0, p1, p2, p3, ROT, r_num)   
>       \-  do {                                         \- X##p0 
> += X##p1;     
>                  \-   X##p1 = rotl_64(X##p1, ROT##_0);     \- 
> X##p1 ^= X##p0; 
>                      \-   X##p2 += X##p3;                      \- 
> X##p3 = 
> rotl_64(X##p3, ROT##_1);     \-   X##p3 ^= X##p2;                 
>      \- } 
> while (0)--#if SKEIN_UNROLL_256 == 0-#define R256(p0, p1, p2, p3, ROT, r_num) 
> /* fully unrolled */ \-   ROUND256(p0, p1, p2, p3, ROT, r_num)--#define 
> I256(R) 
>                                                         \-do {            
>    
>                                              \-   /* inject the 
> key schedule 
> value */                     \-   X0   += ks[((R) + 1) % 5];      
>              
>            \- X1   += ks[((R) + 2) % 5] + ts[((R) + 1) % 3];          
> \-  X2 
>   += ks[((R) + 3) % 5] + ts[((R) + 2) % 3];          \-   X3   += 
> ks[((R) + 4) 
> % 5] + (R) + 1;                    \- } while (0)-#else-/* looping version 
> */-#define R256(p0, p1, p2, p3, ROT, r_num) ROUND256(p0, p1, p2, p3, ROT, 
> r_num)--#define I256(R)                                         \-do {    
>    
>                                      \-   /* inject the key 
> schedule value */ 
>     \-X0 += ks[r + (R) + 0];                  \-  
> X1 += ks[r + (R) + 1] + 
> ts[r + (R) + 0];\-X2 += ks[r + (R) + 2] + ts[r + (R) + 1];\-  
> X3 += ks[r + 
> (R) + 3] + r + (R);        \- /* rotate key schedule */               
> \-ks[r + (R) + 4] = ks[r + (R) - 1];      \-  ts[r + 
> (R) + 2] = ts[r + (R) 
> - 1];      \- } while (0)-#endif-#define R256_8_ROUNDS(R)                     
>            \- do {                                            \-  
> R256(0, 1, 
> 2, 3, R_256_0, 8 * (R) + 1); \-   R256(0, 3, 2, 1, R_256_1, 8 * 
> (R) + 2); 
> \-R256(0, 1, 2, 3, R_256_2, 8 * (R) + 3); \-  R256(0, 
> 3, 2, 1, R_256_3, 8 * 
> (R) + 4); \-  I256(2 * (R));                          \-  
> R256(0, 1, 2, 3, 
> R_256_4, 8 * (R) + 5); \- R256(0, 3, 2, 1, R_256_5, 8 * (R) + 6); 
> \-R256(0, 1, 2, 3, R_256_6, 8 * (R) + 7); \-  R256(0, 
> 3, 2, 1, R_256_7, 8 * 
> (R) + 8); \-  I256(2 * (R) + 1);                      \-  } while 
> (0)--#define 
> R256_UNROLL_R(NN)                     \-  ((SKEIN_UNROLL_256 == 0 &&      
>      
>  \-   SKEIN_256_ROUNDS_TOTAL / 8 > (NN)) || \-(SKEIN_UNROLL_256 > 
> (NN)))--#if 
>  (SKEIN_UNROLL_256 > 14)-#error  "need more unrolling in 
> skein_256_process_block"-#endif-#endif--#if !(SKEIN_

Re: [PATCH] staging: skein: macros moved to header file

2015-12-04 Thread Mathieu Poirier
On 4 December 2015 at 00:09, Sanidhya Solanki  wrote:
> Staging: Skein: Moved macros from skein_block.c to header file.
>
> The original code defined macros in the source code, making it harder to
> read. Move them to the header file.

The patch didn't end up mangled on my side but definitely did not
cleared checkpatch, which may indicate some sort of problem with the
email client (as I assume you did indeed run checkpatch.sh).

It would also be a good idea to update the TODO file to reflect that
some of the macros have now been moved to a header file.

I will review the work when checkpatch is happy.

Thanks,
Mathieu


>
> Signed-off-by: Sanidhya Solanki 
> ---
>  drivers/staging/skein/skein_block.c | 321
> ---
>  drivers/staging/skein/skein_block.h | 323
> 
>  2 files changed, 323 insertions(+), 321 deletions(-)
>
> diff --git a/drivers/staging/skein/skein_block.c
> b/drivers/staging/skein/skein_block.c
> index 45b4732..9701f95 100644
> --- a/drivers/staging/skein/skein_block.c
> +++ b/drivers/staging/skein/skein_block.c
> @@ -18,327 +18,6 @@
>  #include "skein_base.h"
>  #include "skein_block.h"
>
> -#ifndef SKEIN_USE_ASM
> -#define SKEIN_USE_ASM   (0) /* default is all C code (no ASM) */
> -#endif
> -
> -#ifndef SKEIN_LOOP
> -#define SKEIN_LOOP 001 /* default: unroll 256 and 512, but not 1024 */
> -#endif
> -
> -#define BLK_BITS(WCNT * 64) /* some useful definitions for code
> here */
> -#define KW_TWK_BASE (0)
> -#define KW_KEY_BASE (3)
> -#define ks  (kw + KW_KEY_BASE)
> -#define ts  (kw + KW_TWK_BASE)
> -
> -#ifdef SKEIN_DEBUG
> -#define debug_save_tweak(ctx)   \
> -{   \
> - ctx->h.tweak[0] = ts[0];\
> - ctx->h.tweak[1] = ts[1];\
> -}
> -#else
> -#define debug_save_tweak(ctx)
> -#endif
> -
> -#if !(SKEIN_USE_ASM & 256)
> -#undef  RCNT
> -#define RCNT (SKEIN_256_ROUNDS_TOTAL / 8)
> -#ifdef SKEIN_LOOP /* configure how much to unroll the loop */
> -#define SKEIN_UNROLL_256 (((SKEIN_LOOP) / 100) % 10)
> -#else
> -#define SKEIN_UNROLL_256 (0)
> -#endif
> -
> -#if SKEIN_UNROLL_256
> -#if (RCNT % SKEIN_UNROLL_256)
> -#error "Invalid SKEIN_UNROLL_256" /* sanity check on unroll count */
> -#endif
> -#endif
> -#define ROUND256(p0, p1, p2, p3, ROT, r_num) \
> - do { \
> - X##p0 += X##p1;  \
> - X##p1 = rotl_64(X##p1, ROT##_0); \
> - X##p1 ^= X##p0;  \
> - X##p2 += X##p3;  \
> - X##p3 = rotl_64(X##p3, ROT##_1); \
> - X##p3 ^= X##p2;  \
> - } while (0)
> -
> -#if SKEIN_UNROLL_256 == 0
> -#define R256(p0, p1, p2, p3, ROT, r_num) /* fully unrolled */ \
> - ROUND256(p0, p1, p2, p3, ROT, r_num)
> -
> -#define I256(R) \
> - do {\
> - /* inject the key schedule value */ \
> - X0   += ks[((R) + 1) % 5];  \
> - X1   += ks[((R) + 2) % 5] + ts[((R) + 1) % 3];  \
> - X2   += ks[((R) + 3) % 5] + ts[((R) + 2) % 3];  \
> - X3   += ks[((R) + 4) % 5] + (R) + 1;\
> - } while (0)
> -#else
> -/* looping version */
> -#define R256(p0, p1, p2, p3, ROT, r_num) ROUND256(p0, p1, p2, p3, ROT,
> r_num)
> -
> -#define I256(R) \
> - do {\
> - /* inject the key schedule value */ \
> - X0 += ks[r + (R) + 0];  \
> - X1 += ks[r + (R) + 1] + ts[r + (R) + 0];\
> - X2 += ks[r + (R) + 2] + ts[r + (R) + 1];\
> - X3 += ks[r + (R) + 3] + r + (R);\
> - /* rotate key schedule */   \
> - ks[r + (R) + 4] = ks[r + (R) - 1];  \
> - ts[r + (R) + 2] = ts[r + (R) - 1];  \
> - } while (0)
> -#endif
> -#define R256_8_ROUNDS(R)\
> - do {\
> - R256(0, 1, 2, 3, R_256_0, 8 * (R) + 1); \
> - R256(0, 3, 2, 1, R_256_1, 8 * (R) + 2); \
> - R256(0, 1, 2, 3, R_256_2, 8 * (R) + 3); \
> - R256(0, 3, 2, 1, R_256_3, 8 * (R) + 4); \
> - I256(2 * (R));  \
> - R256(0, 1, 2, 3, R_256_4, 8 * (R) + 5); \
> - R256(0, 3, 2, 1, R_256_5, 8 * (R) + 6); \
> - R256(0, 1, 2, 3, R_256_6, 8 * (R) + 7); \
> - R256(0, 3, 2, 1, R_256_7, 8 * (R) + 8); \
> - I256(2 * (R) + 1);  \
> - } while (0)
> -
> -#define R256_UNROLL_R(NN) \
> - ((SKEIN_UNROLL_256 == 0 &&\
> - SKEIN_256_ROUNDS_TOTAL / 8 > (NN)) || \
> - (SKEIN_UNROLL_256 > (NN)))
> -
> -#if  (SKEIN_UNROLL_256 > 14)
> -#error  "need more unrolling in skein_256_process_block"
> -#endif
> -#endif
> -
> -#if !(SKEIN_USE_ASM & 512)
> -#undef  RCNT
> -#define RCNT  (SKEIN_512_ROUNDS_TOTAL/8)
> -
> -#ifdef SKEIN_LOOP /* configure how much to unroll the loop */
> -#define SKEIN_UNROLL_512 (

[PATCH] Staging: speakup: kobjects: Return the error type to caller

2015-12-04 Thread Saurabh Sengar
Inorder to notify the user that value is not successfuly set in sys
entry, error should be returned from store function instead of count

Signed-off-by: Saurabh Sengar 
---
 drivers/staging/speakup/kobjects.c | 5 -
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/speakup/kobjects.c 
b/drivers/staging/speakup/kobjects.c
index fdfeb42..b3a83fb 100644
--- a/drivers/staging/speakup/kobjects.c
+++ b/drivers/staging/speakup/kobjects.c
@@ -640,7 +640,8 @@ ssize_t spk_var_store(struct kobject *kobj, struct 
kobj_attribute *attr,
len = E_INC;
else
len = E_SET;
-   if (kstrtol(cp, 10, &value) == 0)
+   ret = kstrtol(cp, 10, &value);
+   if (!ret)
ret = spk_set_num_var(value, param, len);
else
pr_warn("overflow or parsing error has occurred");
@@ -688,6 +689,8 @@ ssize_t spk_var_store(struct kobject *kobj, struct 
kobj_attribute *attr,
 
if (ret == -ERESTART)
pr_info("%s reset to default value\n", param->name);
+   else if (ret < 0)
+   return ret;
return count;
 }
 EXPORT_SYMBOL_GPL(spk_var_store);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCHv6 4/5] devicetree: Add new ANX7814 SlimPort transmitter binding.

2015-12-04 Thread Rob Herring
On Fri, Dec 04, 2015 at 09:35:06AM +0100, Enric Balletbo i Serra wrote:
> The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
> designed for portable devices.
> 
> You can add support to your board with current binding.
> 
> Example:
> 
>   anx7814: anx7814@38 {
>   compatible = "analogix,anx7814";
>   reg = <0x38>;
>   interrupt-parent = <&gpio0>
>   interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
>   pd-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
>   reset-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
>   v10-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
>   ports {

This and the example below should be just "port" I think. Otherwise:

Acked-by: Rob Herring 


>   anx7814_in: endpoint {
>   remote-endpoint = <&hdmi0_out>;
>   };
>   };
>   };
> 
> Signed-off-by: Enric Balletbo i Serra 
> ---
> 
> Changes since last version (requested by Rob Herring)
> - Specify how many ports and how many endpoints for each port
> - Simplify to just port (dropping ports)
> - For cable det use an interrupt instead (to a gpio controller)
> 
>  .../devicetree/bindings/video/bridge/anx7814.txt   | 39 
> ++
>  1 file changed, 39 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/video/bridge/anx7814.txt
> 
> diff --git a/Documentation/devicetree/bindings/video/bridge/anx7814.txt 
> b/Documentation/devicetree/bindings/video/bridge/anx7814.txt
> new file mode 100644
> index 000..4e68789
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/video/bridge/anx7814.txt
> @@ -0,0 +1,39 @@
> +Analogix ANX7814 SlimPort (Full-HD Transmitter)
> +---
> +
> +The ANX7814 is an ultra-low power Full-HD (1080p60) SlimPort transmitter
> +designed for portable devices.
> +
> +Required properties:
> +
> + - compatible: "analogix,anx7814"
> + - reg   : I2C address of the device
> + - interrupt-parent  : Should be the phandle of the interrupt controller
> +   that services interrupts for this device
> + - interrupts: Should contain the cable detection interrupt
> + - pd-gpios  : Which GPIO to use for power down
> + - reset-gpios   : Which GPIO to use for reset
> +
> +Optional properties:
> +
> + - v10-gpios : Which GPIO to use for V10 control.
> + - Video port for HDMI output, using the DT bindings defined in [1].
> +
> +[1]: Documentation/devicetree/bindings/media/video-interfaces.txt
> +
> +Example:
> +
> + anx7814: anx7814@38 {
> + compatible = "analogix,anx7814";
> + reg = <0x38>;
> + interrupt-parent = <&gpio0>
> + interrupts = <1 IRQ_TYPE_LEVEL_HIGH>;
> + pd-gpios = <&gpio0 2 GPIO_ACTIVE_HIGH>;
> + reset-gpios = <&gpio0 3 GPIO_ACTIVE_HIGH>;
> + v10-gpios = <&gpio0 4 GPIO_ACTIVE_HIGH>;
> + ports {
> + anx7814_in: endpoint {
> + remote-endpoint = <&hdmi0_out>;
> + };
> + };
> + };
> -- 
> 2.1.0
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH RESEND] staging/slicoss: Use ethtool_ops instead of module_param.

2015-12-04 Thread Kevin Wern
ethtool_ops has attributes in sub struct ethool_coalesce that
correspond to the parameters intagg_delay and dynamic_intagg. It is
preferable to set these properties with ethtool rather than
module_param, so create these attributes in adapter and set them using
ethtool_coalesce's rx_coalesce_usecs and rx_use_adaptive_coalesce.
(Outlined in TODO file)

Signed-off-by: Kevin Wern 
---

Forgot signed-off-by line

 drivers/staging/slicoss/slic.h|  2 ++
 drivers/staging/slicoss/slicoss.c | 38 --
 2 files changed, 30 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
index c95b3ab..cc0afee 100644
--- a/drivers/staging/slicoss/slic.h
+++ b/drivers/staging/slicoss/slic.h
@@ -478,6 +478,8 @@ struct adapter {
u32 max_isr_xmits;
u32 rcv_interrupt_yields;
u32 intagg_period;
+   u32 intagg_delay;
+   u32 dynamic_intagg;
struct inicpm_state*inicpm_info;
void *pinicpm_info;
struct slic_ifevents  if_events;
diff --git a/drivers/staging/slicoss/slicoss.c 
b/drivers/staging/slicoss/slicoss.c
index b23a2d1..3f94af46 100644
--- a/drivers/staging/slicoss/slicoss.c
+++ b/drivers/staging/slicoss/slicoss.c
@@ -102,8 +102,7 @@ static char *slic_banner = "Alacritech SLIC Technology(tm) 
Server and Storage Ac
 static char *slic_proc_version = "2.0.351  2006/07/14 12:26:00";
 
 static struct base_driver slic_global = { {}, 0, 0, 0, 1, NULL, NULL };
-static int intagg_delay = 100;
-static u32 dynamic_intagg;
+#define DEFAULT_INTAGG_DELAY 100
 static unsigned int rcv_count;
 
 #define DRV_NAME  "slicoss"
@@ -119,11 +118,6 @@ MODULE_AUTHOR(DRV_AUTHOR);
 MODULE_DESCRIPTION(DRV_DESCRIPTION);
 MODULE_LICENSE("Dual BSD/GPL");
 
-module_param(dynamic_intagg, int, 0);
-MODULE_PARM_DESC(dynamic_intagg, "Dynamic Interrupt Aggregation Setting");
-module_param(intagg_delay, int, 0);
-MODULE_PARM_DESC(intagg_delay, "uSec Interrupt Aggregation Delay");
-
 static const struct pci_device_id slic_pci_tbl[] = {
{ PCI_DEVICE(PCI_VENDOR_ID_ALACRITECH, SLIC_1GB_DEVICE_ID) },
{ PCI_DEVICE(PCI_VENDOR_ID_ALACRITECH, SLIC_2GB_DEVICE_ID) },
@@ -2860,7 +2854,7 @@ static int slic_card_init(struct sliccard *card, struct 
adapter *adapter)
if (slic_global.dynamic_intagg)
slic_intagg_set(adapter, 0);
else
-   slic_intagg_set(adapter, intagg_delay);
+   slic_intagg_set(adapter, adapter->intagg_delay);
 
/*
 *  Initialize ping status to "ok"
@@ -2881,6 +2875,26 @@ card_init_err:
return status;
 }
 
+static int slic_get_coalesce(struct net_device *dev,
+struct ethtool_coalesce *coalesce)
+{
+   struct adapter *adapter = netdev_priv(dev);
+
+   adapter->intagg_delay = coalesce->rx_coalesce_usecs;
+   adapter->dynamic_intagg = coalesce->use_adaptive_rx_coalesce;
+   return 0;
+}
+
+static int slic_set_coalesce(struct net_device *dev,
+struct ethtool_coalesce *coalesce)
+{
+   struct adapter *adapter = netdev_priv(dev);
+
+   coalesce->rx_coalesce_usecs = adapter->intagg_delay;
+   coalesce->use_adaptive_rx_coalesce = adapter->dynamic_intagg;
+   return 0;
+}
+
 static void slic_init_driver(void)
 {
if (slic_first_init) {
@@ -3069,8 +3083,6 @@ static int slic_entry_probe(struct pci_dev *pcidev,
struct sliccard *card = NULL;
int pci_using_dac = 0;
 
-   slic_global.dynamic_intagg = dynamic_intagg;
-
err = pci_enable_device(pcidev);
 
if (err)
@@ -3118,6 +3130,7 @@ static int slic_entry_probe(struct pci_dev *pcidev,
adapter = netdev_priv(netdev);
adapter->netdev = netdev;
adapter->pcidev = pcidev;
+   slic_global.dynamic_intagg = adapter->dynamic_intagg;
if (pci_using_dac)
netdev->features |= NETIF_F_HIGHDMA;
 
@@ -3204,5 +3217,10 @@ static void __exit slic_module_cleanup(void)
pci_unregister_driver(&slic_driver);
 }
 
+static struct ethtool_ops slic_ethtool_ops = {
+   .get_coalesce = slic_get_coalesce,
+   .set_coalesce = slic_get_coalesce
+};
+
 module_init(slic_module_init);
 module_exit(slic_module_cleanup);
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] storvsc: add more logging for error and warning messages

2015-12-04 Thread Long Li
> -Original Message-
> From: Vitaly Kuznetsov [mailto:vkuzn...@redhat.com]
> Sent: Friday, December 4, 2015 1:53 AM
> To: Long Li 
> Cc: KY Srinivasan ; Haiyang Zhang
> ; James E.J. Bottomley ;
> de...@linuxdriverproject.org; linux-ker...@vger.kernel.org; linux-
> s...@vger.kernel.org
> Subject: Re: [PATCH] storvsc: add more logging for error and warning
> messages
> 
> Long Li  writes:
> 
> > Introduce a logging level for storvsc to log certain error/warning
> > messages. Those messages are helpful in some environments, e.g.
> > Microsoft Azure, for customer support and troubleshooting purposes.
> 
> I have an alternative suggestion: let's use dynamic debug! Basically, we need
> to convert all non-error logging to using dev_dbg() and this can be enabled
> dynamically when needed, even reboot won't be required.

This is great idea for debugging!

I think the messages (srb errors) we want to log in this patch are real errors. 
They are not for debugging, but for customer support in production environment.

Those errors can be ignored in certain specific storage configurations due to 
some quirks. They are real errors on Azure, so we want to always log them.
 
> 
> >
> > Signed-off-by: Long Li 
> > ---
> >  drivers/scsi/storvsc_drv.c | 30 +-
> >  1 file changed, 29 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
> > index 40c43ae..afa1647 100644
> > --- a/drivers/scsi/storvsc_drv.c
> > +++ b/drivers/scsi/storvsc_drv.c
> > @@ -164,6 +164,21 @@ static int sense_buffer_size =
> > PRE_WIN8_STORVSC_SENSE_BUFFER_SIZE;
> >  */
> >  static int vmstor_proto_version;
> >
> > +#define STORVSC_LOGGING_NONE   0
> > +#define STORVSC_LOGGING_ERROR  1
> > +#define STORVSC_LOGGING_WARN   2
> > +
> > +static int logging_level = STORVSC_LOGGING_ERROR;
> > +module_param(logging_level, int, S_IRUGO|S_IWUSR);
> > +MODULE_PARM_DESC(logging_level,
> > +   "Logging level, 0 - None, 1 - Error (default), 2 - Warning.");
> > +
> > +static inline bool do_logging(int level) {
> > +   return (logging_level >= level) ? true : false; }
> > +
> > +
> >  struct vmscsi_win8_extension {
> > /*
> >  * The following were added in Windows 8 @@ -1183,7 +1198,7 @@
> > static void storvsc_command_completion(struct storvsc_cmd_request
> > *cmd_request)
> >
> > scmnd->result = vm_srb->scsi_status;
> >
> > -   if (scmnd->result) {
> > +   if (scmnd->result && do_logging(STORVSC_LOGGING_ERROR)) {
> > if (scsi_normalize_sense(scmnd->sense_buffer,
> > SCSI_SENSE_BUFFERSIZE, &sense_hdr))
> > scsi_print_sense_hdr(scmnd->device, "storvsc", @@
> -1239,12
> > +1254,25 @@ static void storvsc_on_io_completion(struct hv_device
> *device,
> > stor_pkt->vm_srb.sense_info_length =
> > vstor_packet->vm_srb.sense_info_length;
> >
> > +   if (vstor_packet->vm_srb.scsi_status != 0 ||
> > +   vstor_packet->vm_srb.srb_status != SRB_STATUS_SUCCESS)
> > +   if (do_logging(STORVSC_LOGGING_WARN))
> > +   dev_warn(&device->device,
> > +   "cmd 0x%x scsi status 0x%x srb status
> 0x%x\n",
> > +   stor_pkt->vm_srb.cdb[0],
> > +   vstor_packet->vm_srb.scsi_status,
> > +   vstor_packet->vm_srb.srb_status);
> >
> > if ((vstor_packet->vm_srb.scsi_status & 0xFF) == 0x02) {
> > /* CHECK_CONDITION */
> > if (vstor_packet->vm_srb.srb_status &
> > SRB_STATUS_AUTOSENSE_VALID) {
> > /* autosense data available */
> > +   if (do_logging(STORVSC_LOGGING_WARN))
> > +   dev_warn(&device->device,
> > +   "stor pkt %p autosense data valid -
> len %d\n",
> > +   request,
> > +   vstor_packet-
> >vm_srb.sense_info_length);
> >
> > memcpy(request->cmd->sense_buffer,
> >vstor_packet->vm_srb.sense_data,
> 
> --
>   Vitaly
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: wilc1000: fix double mutex_unlock on failure path in wilc_wlan_cleanup()

2015-12-04 Thread Alexey Khoroshilov
If hif_read_reg() or hif_write_reg() fail in wilc_wlan_cleanup(),
it calls release_bus() and continues execution. But it leads to double
release_bus() call that means double unlock of g_linux_wlan->hif_cs mutex.

The patch adds return in case of failure.

Found by Linux Driver Verification project (linuxtesting.org).

Signed-off-by: Alexey Khoroshilov 
---
 drivers/staging/wilc1000/wilc_wlan.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/staging/wilc1000/wilc_wlan.c 
b/drivers/staging/wilc1000/wilc_wlan.c
index c02665747705..cd7f52a51173 100644
--- a/drivers/staging/wilc1000/wilc_wlan.c
+++ b/drivers/staging/wilc1000/wilc_wlan.c
@@ -1703,12 +1703,14 @@ void wilc_wlan_cleanup(struct net_device *dev)
if (!ret) {
PRINT_ER("Error while reading reg\n");
release_bus(RELEASE_ALLOW_SLEEP);
+   return;
}
PRINT_ER("Writing ABORT reg\n");
ret = p->hif_func.hif_write_reg(WILC_GP_REG_0, (reg | ABORT_INT));
if (!ret) {
PRINT_ER("Error while writing reg\n");
release_bus(RELEASE_ALLOW_SLEEP);
+   return;
}
release_bus(RELEASE_ALLOW_SLEEP);
/**
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/lustre: remove IOC_LIBCFS_PING_TEST ioctl

2015-12-04 Thread green
From: James Simmons 

The ioctl IOC_LIBCFS_PING_TEST has not been used in
ages. The recent nidstring changes which moved all
the nidstring operations from libcfs to the LNet
layer but this ioctl code was still using an
nidstring operation that was causing a circular
dependency loop between libcfs and LNet.

Signed-off-by: James Simmons 
Signed-off-by: Oleg Drokin 
---
Would be great to have this accepted to fix the ugly
circular dependency error Lustre is still causing in the Linus'
tree when enabled.

 .../staging/lustre/include/linux/libcfs/libcfs_ioctl.h  |  1 -
 drivers/staging/lustre/lustre/libcfs/module.c   | 17 -
 2 files changed, 18 deletions(-)

diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h 
b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
index f5d741f..485ab26 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_ioctl.h
@@ -110,7 +110,6 @@ struct libcfs_ioctl_handler {
 #define IOC_LIBCFS_CLEAR_DEBUG  _IOWR('e', 31, long)
 #define IOC_LIBCFS_MARK_DEBUG_IOWR('e', 32, long)
 #define IOC_LIBCFS_MEMHOG_IOWR('e', 36, long)
-#define IOC_LIBCFS_PING_TEST  _IOWR('e', 37, long)
 /* lnet ioctls */
 #define IOC_LIBCFS_GET_NI_IOWR('e', 50, long)
 #define IOC_LIBCFS_FAIL_NID_IOWR('e', 51, long)
diff --git a/drivers/staging/lustre/lustre/libcfs/module.c 
b/drivers/staging/lustre/lustre/libcfs/module.c
index 07a6859..e7c2b26 100644
--- a/drivers/staging/lustre/lustre/libcfs/module.c
+++ b/drivers/staging/lustre/lustre/libcfs/module.c
@@ -274,23 +274,6 @@ static int libcfs_ioctl_int(struct cfs_psdev_file *pfile, 
unsigned long cmd,
}
break;
 
-   case IOC_LIBCFS_PING_TEST: {
-   extern void (kping_client)(struct libcfs_ioctl_data *);
-   void (*ping)(struct libcfs_ioctl_data *);
-
-   CDEBUG(D_IOCTL, "doing %d pings to nid %s (%s)\n",
-  data->ioc_count, libcfs_nid2str(data->ioc_nid),
-  libcfs_nid2str(data->ioc_nid));
-   ping = symbol_get(kping_client);
-   if (!ping)
-   CERROR("symbol_get failed\n");
-   else {
-   ping(data);
-   symbol_put(kping_client);
-   }
-   return 0;
-   }
-
default: {
struct libcfs_ioctl_handler *hand;
 
-- 
2.1.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 6/7] drivers:hv: Define the channel type of Hyper-V PCI Express pass-through

2015-12-04 Thread jakeo
From: Jake Oshins 

This defines the channel type for PCI front-ends in Hyper-V VMs.

Signed-off-by: Jake Oshins 
---
 include/linux/hyperv.h | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 24d0b65..c9a9eed 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -1141,6 +1141,17 @@ u64 hv_do_hypercall(u64 control, void *input, void 
*output);
}
 
 /*
+ * PCI Express Pass Through
+ * {44C4F61D--4400-9D52-802E27EDE19F}
+ */
+
+#define HV_PCIE_GUID \
+   .guid = { \
+   0x1D, 0xF6, 0xC4, 0x44, 0x44, 0x44, 0x00, 0x44, \
+   0x9D, 0x52, 0x80, 0x2E, 0x27, 0xED, 0xE1, 0x9F \
+   }
+
+/*
  * Common header for Hyper-V ICs
  */
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 2/7] drivers:hv: Export hv_do_hypercall()

2015-12-04 Thread jakeo
From: Jake Oshins 

This patch exposes the function that hv_vmbus.ko uses to make hypercalls.
This is necessary for retargeting an interrupt when it is given a new
affinity and vector.

Signed-off-by: Jake Oshins 
---
 drivers/hv/hv.c   | 20 ++--
 drivers/hv/hyperv_vmbus.h |  2 +-
 include/linux/hyperv.h|  1 +
 3 files changed, 12 insertions(+), 11 deletions(-)

diff --git a/drivers/hv/hv.c b/drivers/hv/hv.c
index 6341be8..7a06933 100644
--- a/drivers/hv/hv.c
+++ b/drivers/hv/hv.c
@@ -89,9 +89,9 @@ static int query_hypervisor_info(void)
 }
 
 /*
- * do_hypercall- Invoke the specified hypercall
+ * hv_do_hypercall- Invoke the specified hypercall
  */
-static u64 do_hypercall(u64 control, void *input, void *output)
+u64 hv_do_hypercall(u64 control, void *input, void *output)
 {
u64 input_address = (input) ? virt_to_phys(input) : 0;
u64 output_address = (output) ? virt_to_phys(output) : 0;
@@ -132,6 +132,7 @@ static u64 do_hypercall(u64 control, void *input, void 
*output)
return hv_status_lo | ((u64)hv_status_hi << 32);
 #endif /* !x86_64 */
 }
+EXPORT_SYMBOL_GPL(hv_do_hypercall);
 
 #ifdef CONFIG_X86_64
 static cycle_t read_hv_clock_tsc(struct clocksource *arg)
@@ -315,7 +316,7 @@ int hv_post_message(union hv_connection_id connection_id,
 {
 
struct hv_input_post_message *aligned_msg;
-   u16 status;
+   u64 status;
 
if (payload_size > HV_MESSAGE_PAYLOAD_BYTE_COUNT)
return -EMSGSIZE;
@@ -329,11 +330,10 @@ int hv_post_message(union hv_connection_id connection_id,
aligned_msg->payload_size = payload_size;
memcpy((void *)aligned_msg->payload, payload, payload_size);
 
-   status = do_hypercall(HVCALL_POST_MESSAGE, aligned_msg, NULL)
-   & 0x;
+   status = hv_do_hypercall(HVCALL_POST_MESSAGE, aligned_msg, NULL);
 
put_cpu();
-   return status;
+   return status & 0x;
 }
 
 
@@ -343,13 +343,13 @@ int hv_post_message(union hv_connection_id connection_id,
  *
  * This involves a hypercall.
  */
-u16 hv_signal_event(void *con_id)
+int hv_signal_event(void *con_id)
 {
-   u16 status;
+   u64 status;
 
-   status = (do_hypercall(HVCALL_SIGNAL_EVENT, con_id, NULL) & 0x);
+   status = hv_do_hypercall(HVCALL_SIGNAL_EVENT, con_id, NULL);
 
-   return status;
+   return status & 0x;
 }
 
 static int hv_ce_set_next_event(unsigned long delta,
diff --git a/drivers/hv/hyperv_vmbus.h b/drivers/hv/hyperv_vmbus.h
index 3782636..cc2fb53 100644
--- a/drivers/hv/hyperv_vmbus.h
+++ b/drivers/hv/hyperv_vmbus.h
@@ -582,7 +582,7 @@ extern int hv_post_message(union hv_connection_id 
connection_id,
 enum hv_message_type message_type,
 void *payload, size_t payload_size);
 
-extern u16 hv_signal_event(void *con_id);
+extern int hv_signal_event(void *con_id);
 
 extern int hv_synic_alloc(void);
 
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index fddb3e0..24d0b65 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -984,6 +984,7 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
bool fb_overlap_ok);
 
 int vmbus_cpu_number_to_vp_number(int cpu_number);
+u64 hv_do_hypercall(u64 control, void *input, void *output);
 
 /**
  * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 0/7] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs

2015-12-04 Thread jakeo
From: Jake Oshins 

This version of the patch series incorporates feedback from Gerry Liu.

First, export functions that allow correlating Hyper-V virtual processors
and Linux cpus, along with the means for invoking a hypercall that targets
interrupts at chosen vectors on specific cpus.

Second, mark various parts of IRQ domain related code as exported, so that
this PCI front-end can implement an IRQ domain as part of a module.  (The
alternative would be to pull all tyhis into the kernel, which would pull
in a lot of other Hyper-V related code, as this IRQ domain depends on
vmbus.ko.)

Third, modify PCI so that new root PCI buses can be marked with an associated
fwnode_handle, and so that root PCI buses can look up their associated IRQ
domain by that handle.

Fourth, introduce a new driver, hv_pcifront, which exposes root PCI buses in
a Hyper-V VM.  These root PCI buses expose real PCIe device, or PCI Virtual
Functions.

Jake Oshins (7):
  drivers:hv: Export a function that maps Linux CPU num onto Hyper-V
proc num
  drivers:hv: Export hv_do_hypercall()
  PCI: Make it possible to implement a PCI MSI IRQ Domain in a module.
  PCI: Add fwnode_handle to pci_sysdata
  PCI: irqdomain: Look up IRQ domain by fwnode_handle
  drivers:hv: Define the channel type of Hyper-V PCI Express
pass-through
  PCI: hv: New paravirtual PCI front-end for Hyper-V VMs

 MAINTAINERS|1 +
 arch/x86/include/asm/msi.h |6 +
 arch/x86/include/asm/pci.h |   15 +
 arch/x86/kernel/apic/msi.c |8 +-
 arch/x86/kernel/apic/vector.c  |2 +
 drivers/hv/hv.c|   20 +-
 drivers/hv/hyperv_vmbus.h  |2 +-
 drivers/hv/vmbus_drv.c |   17 +
 drivers/pci/Kconfig|7 +
 drivers/pci/host/Makefile  |1 +
 drivers/pci/host/hv_pcifront.c | 2241 
 drivers/pci/msi.c  |4 +
 drivers/pci/probe.c|   14 +
 include/asm-generic/pci.h  |4 +
 include/linux/hyperv.h |   14 +
 kernel/irq/chip.c  |1 +
 kernel/irq/irqdomain.c |4 +
 17 files changed, 2347 insertions(+), 14 deletions(-)
 create mode 100644 drivers/pci/host/hv_pcifront.c

-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 5/7] PCI: irqdomain: Look up IRQ domain by fwnode_handle

2015-12-04 Thread jakeo
From: Jake Oshins 

This patch adds a second way of finding an IRQ domain associated with
a root PCI bus.  After looking to see if one can be found through
the OF tree, it attempts to look up the IRQ domain through an
fwnode_handle stored in the pci_sysdata struct.

Signed-off-by: Jake Oshins 
---
 drivers/pci/probe.c | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index edb1984..8f3d056 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -673,6 +673,20 @@ static struct irq_domain 
*pci_host_bridge_msi_domain(struct pci_bus *bus)
 */
d = pci_host_bridge_of_msi_domain(bus);
 
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+   /*
+* If no IRQ domain was found via the OF tree, try looking it up
+* directly through the fwnode_handle.
+*/
+   if (!d) {
+   struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
+
+   if (fwnode)
+   d = irq_find_matching_fwnode(fwnode,
+DOMAIN_BUS_PCI_MSI);
+   }
+#endif
+
return d;
 }
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 3/7] PCI: Make it possible to implement a PCI MSI IRQ Domain in a module.

2015-12-04 Thread jakeo
From: Jake Oshins 

The Linux kernel already has the concpet of IRQ domain, wherein a
component can expose a set of IRQs which are managed by a particular
interrupt controller chip or other subsystem. The PCI driver exposes
the notion of an IRQ domain for Message-Signaled Interrupts (MSI) from
PCI Express devices. This patch exposes the functions which are
necessary for making an MSI IRQ domain within a module.

Signed-off-by: Jake Oshins 
---
 arch/x86/include/asm/msi.h| 6 ++
 arch/x86/kernel/apic/msi.c| 8 +---
 arch/x86/kernel/apic/vector.c | 2 ++
 drivers/pci/msi.c | 4 
 kernel/irq/chip.c | 1 +
 kernel/irq/irqdomain.c| 4 
 6 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/asm/msi.h b/arch/x86/include/asm/msi.h
index 93724cc..eb4b09b 100644
--- a/arch/x86/include/asm/msi.h
+++ b/arch/x86/include/asm/msi.h
@@ -1,7 +1,13 @@
 #ifndef _ASM_X86_MSI_H
 #define _ASM_X86_MSI_H
 #include 
+#include 
 
 typedef struct irq_alloc_info msi_alloc_info_t;
 
+int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
+   msi_alloc_info_t *arg);
+
+void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc);
+
 #endif /* _ASM_X86_MSI_H */
diff --git a/arch/x86/kernel/apic/msi.c b/arch/x86/kernel/apic/msi.c
index 5f1feb6..ade2532 100644
--- a/arch/x86/kernel/apic/msi.c
+++ b/arch/x86/kernel/apic/msi.c
@@ -96,8 +96,8 @@ static irq_hw_number_t pci_msi_get_hwirq(struct 
msi_domain_info *info,
return arg->msi_hwirq;
 }
 
-static int pci_msi_prepare(struct irq_domain *domain, struct device *dev,
-  int nvec, msi_alloc_info_t *arg)
+int pci_msi_prepare(struct irq_domain *domain, struct device *dev, int nvec,
+   msi_alloc_info_t *arg)
 {
struct pci_dev *pdev = to_pci_dev(dev);
struct msi_desc *desc = first_pci_msi_entry(pdev);
@@ -113,11 +113,13 @@ static int pci_msi_prepare(struct irq_domain *domain, 
struct device *dev,
 
return 0;
 }
+EXPORT_SYMBOL_GPL(pci_msi_prepare);
 
-static void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
+void pci_msi_set_desc(msi_alloc_info_t *arg, struct msi_desc *desc)
 {
arg->msi_hwirq = pci_msi_domain_calc_hwirq(arg->msi_dev, desc);
 }
+EXPORT_SYMBOL_GPL(pci_msi_set_desc);
 
 static struct msi_domain_ops pci_msi_domain_ops = {
.get_hwirq  = pci_msi_get_hwirq,
diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c
index 861bc59..908cb37 100644
--- a/arch/x86/kernel/apic/vector.c
+++ b/arch/x86/kernel/apic/vector.c
@@ -29,6 +29,7 @@ struct apic_chip_data {
 };
 
 struct irq_domain *x86_vector_domain;
+EXPORT_SYMBOL_GPL(x86_vector_domain);
 static DEFINE_RAW_SPINLOCK(vector_lock);
 static cpumask_var_t vector_cpumask;
 static struct irq_chip lapic_controller;
@@ -66,6 +67,7 @@ struct irq_cfg *irqd_cfg(struct irq_data *irq_data)
 
return data ? &data->cfg : NULL;
 }
+EXPORT_SYMBOL_GPL(irqd_cfg);
 
 struct irq_cfg *irq_cfg(unsigned int irq)
 {
diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
index 53e4632..3915a99 100644
--- a/drivers/pci/msi.c
+++ b/drivers/pci/msi.c
@@ -257,6 +257,7 @@ void pci_msi_mask_irq(struct irq_data *data)
 {
msi_set_mask_bit(data, 1);
 }
+EXPORT_SYMBOL_GPL(pci_msi_mask_irq);
 
 /**
  * pci_msi_unmask_irq - Generic irq chip callback to unmask PCI/MSI interrupts
@@ -266,6 +267,7 @@ void pci_msi_unmask_irq(struct irq_data *data)
 {
msi_set_mask_bit(data, 0);
 }
+EXPORT_SYMBOL_GPL(pci_msi_unmask_irq);
 
 void default_restore_msi_irqs(struct pci_dev *dev)
 {
@@ -1126,6 +1128,7 @@ struct pci_dev *msi_desc_to_pci_dev(struct msi_desc *desc)
 {
return to_pci_dev(desc->dev);
 }
+EXPORT_SYMBOL(msi_desc_to_pci_dev);
 
 void *msi_desc_to_pci_sysdata(struct msi_desc *desc)
 {
@@ -1285,6 +1288,7 @@ struct irq_domain *pci_msi_create_irq_domain(struct 
fwnode_handle *fwnode,
domain->bus_token = DOMAIN_BUS_PCI_MSI;
return domain;
 }
+EXPORT_SYMBOL_GPL(pci_msi_create_irq_domain);
 
 /**
  * pci_msi_domain_alloc_irqs - Allocate interrupts for @dev in @domain
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c
index 05e29de..5797909 100644
--- a/kernel/irq/chip.c
+++ b/kernel/irq/chip.c
@@ -950,6 +950,7 @@ void irq_chip_ack_parent(struct irq_data *data)
data = data->parent_data;
data->chip->irq_ack(data);
 }
+EXPORT_SYMBOL_GPL(irq_chip_ack_parent);
 
 /**
  * irq_chip_mask_parent - Mask the parent interrupt
diff --git a/kernel/irq/irqdomain.c b/kernel/irq/irqdomain.c
index 22aa961..aa6ac44 100644
--- a/kernel/irq/irqdomain.c
+++ b/kernel/irq/irqdomain.c
@@ -60,6 +60,7 @@ struct fwnode_handle *irq_domain_alloc_fwnode(void *data)
fwid->fwnode.type = FWNODE_IRQCHIP;
return &fwid->fwnode;
 }
+EXPORT_SYMBOL_GPL(irq_domain_alloc_fwnode);
 
 /**
  * irq_domain_free_fwnode - Free a non-OF-backed fwnode_handle
@@ -77,6 +78,7 @@ void irq_domain_free_fwnode(struct fwnode_

[PATCH v7 4/7] PCI: Add fwnode_handle to pci_sysdata

2015-12-04 Thread jakeo
From: Jake Oshins 

This patch adds an fwnode_handle to struct pci_sysdata, which is
used by the next patch in the series when trying to locate an
IRQ domain associated with a root PCI bus.

Signed-off-by: Jake Oshins 
---
 arch/x86/include/asm/pci.h | 15 +++
 include/asm-generic/pci.h  |  4 
 2 files changed, 19 insertions(+)

diff --git a/arch/x86/include/asm/pci.h b/arch/x86/include/asm/pci.h
index 4625943..6fc3c7c 100644
--- a/arch/x86/include/asm/pci.h
+++ b/arch/x86/include/asm/pci.h
@@ -20,6 +20,9 @@ struct pci_sysdata {
 #ifdef CONFIG_X86_64
void*iommu; /* IOMMU private data */
 #endif
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+   void*fwnode;/* IRQ domain for MSI assignment */
+#endif
 };
 
 extern int pci_routeirq;
@@ -32,6 +35,7 @@ extern int noioapicreroute;
 static inline int pci_domain_nr(struct pci_bus *bus)
 {
struct pci_sysdata *sd = bus->sysdata;
+
return sd->domain;
 }
 
@@ -41,6 +45,17 @@ static inline int pci_proc_domain(struct pci_bus *bus)
 }
 #endif
 
+#ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
+static inline void *_pci_root_bus_fwnode(struct pci_bus *bus)
+{
+   struct pci_sysdata *sd = bus->sysdata;
+
+   return sd->fwnode;
+}
+
+#define pci_root_bus_fwnode_pci_root_bus_fwnode
+#endif
+
 /* Can be used to override the logic in pci_scan_bus for skipping
already-configured bus numbers - to be used for buggy BIOSes
or architectures with incomplete PCI setup by the loader */
diff --git a/include/asm-generic/pci.h b/include/asm-generic/pci.h
index f24bc51..4092886 100644
--- a/include/asm-generic/pci.h
+++ b/include/asm-generic/pci.h
@@ -21,4 +21,8 @@ static inline int pci_get_legacy_ide_irq(struct pci_dev *dev, 
int channel)
 #define PCI_DMA_BUS_IS_PHYS(1)
 #endif
 
+#ifndef pci_root_bus_fwnode
+#define pci_root_bus_fwnode(bus)   ((void)(bus), NULL)
+#endif
+
 #endif /* _ASM_GENERIC_PCI_H */
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 1/7] drivers:hv: Export a function that maps Linux CPU num onto Hyper-V proc num

2015-12-04 Thread jakeo
From: Jake Oshins 

This patch exposes the mapping between Linux CPU number and Hyper-V
virtual processor number. This is necessary because the hypervisor needs
to know which virtual processor to target when making a mapping in the
Interrupt Redirection Table in the I/O MMU.

Signed-off-by: Jake Oshins 
---
 drivers/hv/vmbus_drv.c | 17 +
 include/linux/hyperv.h |  2 ++
 2 files changed, 19 insertions(+)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index f19b6f7..c89d0e5 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1191,6 +1191,23 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
 }
 EXPORT_SYMBOL_GPL(vmbus_allocate_mmio);
 
+/**
+ * vmbus_cpu_number_to_vp_number() - Map CPU to VP.
+ * @cpu_number: CPU number in Linux terms
+ *
+ * This function returns the mapping between the Linux processor
+ * number and the hypervisor's virtual processor number, useful
+ * in making hypercalls and such that talk about specific
+ * processors.
+ *
+ * Return: Virtual processor number in Hyper-V terms
+ */
+int vmbus_cpu_number_to_vp_number(int cpu_number)
+{
+   return hv_context.vp_index[cpu_number];
+}
+EXPORT_SYMBOL_GPL(vmbus_cpu_number_to_vp_number);
+
 static int vmbus_acpi_add(struct acpi_device *device)
 {
acpi_status result;
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 8fdc17b..fddb3e0 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -983,6 +983,8 @@ int vmbus_allocate_mmio(struct resource **new, struct 
hv_device *device_obj,
resource_size_t size, resource_size_t align,
bool fb_overlap_ok);
 
+int vmbus_cpu_number_to_vp_number(int cpu_number);
+
 /**
  * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device
  *
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v7 7/7] PCI: hv: New paravirtual PCI front-end for Hyper-V VMs

2015-12-04 Thread jakeo
From: Jake Oshins 

This patch introduces a new driver which exposes a root PCI bus whenever a
PCI Express device is passed through to a guest VM under Hyper-V. The
device can be single- or multi-function. The interrupts for the devices
are managed by an IRQ domain, implemented within the driver.

Signed-off-by: Jake Oshins 
---
 MAINTAINERS|1 +
 drivers/pci/Kconfig|7 +
 drivers/pci/host/Makefile  |1 +
 drivers/pci/host/hv_pcifront.c | 2241 
 4 files changed, 2250 insertions(+)
 create mode 100644 drivers/pci/host/hv_pcifront.c

diff --git a/MAINTAINERS b/MAINTAINERS
index f3de001..9fd37fc 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -5126,6 +5126,7 @@ F:arch/x86/kernel/cpu/mshyperv.c
 F: drivers/hid/hid-hyperv.c
 F: drivers/hv/
 F: drivers/input/serio/hyperv-keyboard.c
+F: drivers/pci/host/hv_pcifront.c
 F: drivers/net/hyperv/
 F: drivers/scsi/storvsc_drv.c
 F: drivers/video/fbdev/hyperv_fb.c
diff --git a/drivers/pci/Kconfig b/drivers/pci/Kconfig
index 73de4ef..9b82d93 100644
--- a/drivers/pci/Kconfig
+++ b/drivers/pci/Kconfig
@@ -118,4 +118,11 @@ config PCI_LABEL
def_bool y if (DMI || ACPI)
select NLS
 
+config HYPERV_VPCI
+tristate "Hyper-V PCI Frontend"
+depends on PCI && X86 && HYPERV && PCI_MSI && PCI_MSI_IRQ_DOMAIN
+help
+  The PCI device frontend driver allows the kernel to import arbitrary
+  PCI devices from a PCI backend to support PCI driver domains.
+
 source "drivers/pci/host/Kconfig"
diff --git a/drivers/pci/host/Makefile b/drivers/pci/host/Makefile
index 9d4d3c6..d9abd2a 100644
--- a/drivers/pci/host/Makefile
+++ b/drivers/pci/host/Makefile
@@ -2,6 +2,7 @@ obj-$(CONFIG_PCIE_DW) += pcie-designware.o
 obj-$(CONFIG_PCI_DRA7XX) += pci-dra7xx.o
 obj-$(CONFIG_PCI_EXYNOS) += pci-exynos.o
 obj-$(CONFIG_PCI_IMX6) += pci-imx6.o
+obj-$(CONFIG_HYPERV_VPCI) += hv_pcifront.o
 obj-$(CONFIG_PCI_MVEBU) += pci-mvebu.o
 obj-$(CONFIG_PCI_TEGRA) += pci-tegra.o
 obj-$(CONFIG_PCI_RCAR_GEN2) += pci-rcar-gen2.o
diff --git a/drivers/pci/host/hv_pcifront.c b/drivers/pci/host/hv_pcifront.c
new file mode 100644
index 000..6023dea
--- /dev/null
+++ b/drivers/pci/host/hv_pcifront.c
@@ -0,0 +1,2241 @@
+/*
+ * Copyright (c) Microsoft Corporation.
+ *
+ * Author:
+ *   Jake Oshins 
+ *
+ * This program is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 as published
+ * by the Free Software Foundation.
+ *
+ * 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, GOOD TITLE or
+ * NON INFRINGEMENT.  See the GNU General Public License for more
+ * details.
+ *
+ */
+
+#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
+
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+#include 
+
+/*
+ * Protocol versions. The low word is the minor version, the high word the 
major
+ * version.
+ */
+
+#define PCI_MAKE_VERSION(major, minor) ((__u32)(((major) << 16) | (major)))
+#define PCI_MAJOR_VERSION(version) ((__u32)(version) >> 16)
+#define PCI_MINOR_VERSION(version) ((__u32)(version) & 0xff)
+
+enum {
+   PCI_PROTOCOL_VERSION_1_1 = PCI_MAKE_VERSION(1, 1),
+   PCI_PROTOCOL_VERSION_CURRENT = PCI_PROTOCOL_VERSION_1_1
+};
+
+#define PCI_CONFIG_MMIO_LENGTH 0x2000
+#define MAX_SUPPORTED_MSI_MESSAGES 0x400
+
+/*
+ * Message Types
+ */
+
+enum pci_message_type {
+   /*
+* Version 1.1
+*/
+   PCI_MESSAGE_BASE= 0x4249,
+   PCI_BUS_RELATIONS   = PCI_MESSAGE_BASE + 0,
+   PCI_QUERY_BUS_RELATIONS = PCI_MESSAGE_BASE + 1,
+   PCI_POWER_STATE_CHANGE  = PCI_MESSAGE_BASE + 4,
+   PCI_QUERY_RESOURCE_REQUIREMENTS = PCI_MESSAGE_BASE + 5,
+   PCI_QUERY_RESOURCE_RESOURCES= PCI_MESSAGE_BASE + 6,
+   PCI_BUS_D0ENTRY = PCI_MESSAGE_BASE + 7,
+   PCI_BUS_D0EXIT  = PCI_MESSAGE_BASE + 8,
+   PCI_READ_BLOCK  = PCI_MESSAGE_BASE + 9,
+   PCI_WRITE_BLOCK = PCI_MESSAGE_BASE + 0xA,
+   PCI_EJECT   = PCI_MESSAGE_BASE + 0xB,
+   PCI_QUERY_STOP  = PCI_MESSAGE_BASE + 0xC,
+   PCI_REENABLE= PCI_MESSAGE_BASE + 0xD,
+   PCI_QUERY_STOP_FAILED   = PCI_MESSAGE_BASE + 0xE,
+   PCI_EJECTION_COMPLETE   = PCI_MESSAGE_BASE + 0xF,
+   PCI_RESOURCES_ASSIGNED  = PCI_MESSAGE_BASE + 0x10,
+   PCI_RESOURCES_RELEASED  = PCI_MESSAGE_BASE + 0x11,
+   PCI_INVALIDATE_BLOCK= PCI_MESSAGE_BASE + 0x12,
+   PCI_QUERY_PROTOCOL_VERSION  = PCI_MESSAGE_BASE + 0x13,
+   PCI_CREATE_INTERRUPT_MESSAGE= PCI_MESSAGE_BASE + 0x14,
+   PCI_DELETE_INTERRUPT_MESSAGE= 

Re: [PATCH V2] goldfish: add goldfish match node for dt driver probe

2015-12-04 Thread Sebastian Reichel
Hi,

On Fri, Nov 06, 2015 at 03:12:40PM +0800, yalin wang wrote:
> qemu use device tree to bootup linux kernel,
> we need add device node match table to plaftorm driver,
> so that can probe the goldfish driver correctly.
> test by this qemu:
> git clone https://android.googlesource.com/platform/external/qemu

Your patch is missing the DT binding documentation part and should
be splitted into multiple patches, at least one per kernel
subsystem. Please read Documentation/SubmittingPatches and
Documentation/devicetree/bindings/submitting-patches.txt

-- Sebastian


signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v7 5/7] PCI: irqdomain: Look up IRQ domain by fwnode_handle

2015-12-04 Thread kbuild test robot
Hi Jake,

[auto build test ERROR on pci/next]
[also build test ERROR on v4.4-rc3 next-20151203]

url:
https://github.com/0day-ci/linux/commits/jakeo-microsoft-com/PCI-hv-New-paravirtual-PCI-front-end-for-Hyper-V-VMs/20151205-083943
base:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git next
config: arm64-defconfig (attached as .config)
reproduce:
wget 
https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross
 -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# save the attached .config to linux build tree
make.cross ARCH=arm64 

All error/warnings (new ones prefixed by >>):

   drivers/pci/probe.c: In function 'pci_host_bridge_msi_domain':
>> drivers/pci/probe.c:682:10: error: implicit declaration of function 
>> 'pci_root_bus_fwnode' [-Werror=implicit-function-declaration]
  struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
 ^
>> drivers/pci/probe.c:682:34: warning: initialization makes pointer from 
>> integer without a cast
  struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
 ^
>> drivers/pci/probe.c:685:4: error: implicit declaration of function 
>> 'irq_find_matching_fwnode' [-Werror=implicit-function-declaration]
   d = irq_find_matching_fwnode(fwnode,
   ^
>> drivers/pci/probe.c:686:12: error: 'DOMAIN_BUS_PCI_MSI' undeclared (first 
>> use in this function)
   DOMAIN_BUS_PCI_MSI);
   ^
   drivers/pci/probe.c:686:12: note: each undeclared identifier is reported 
only once for each function it appears in
   cc1: some warnings being treated as errors

vim +/pci_root_bus_fwnode +682 drivers/pci/probe.c

   676  #ifdef CONFIG_PCI_MSI_IRQ_DOMAIN
   677  /*
   678   * If no IRQ domain was found via the OF tree, try looking it up
   679   * directly through the fwnode_handle.
   680   */
   681  if (!d) {
 > 682  struct fwnode_handle *fwnode = pci_root_bus_fwnode(bus);
   683  
   684  if (fwnode)
 > 685  d = irq_find_matching_fwnode(fwnode,
 > 686   
 > DOMAIN_BUS_PCI_MSI);
   687  }
   688  #endif
   689  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: Binary data
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel