Linux Input/HID development
 help / color / mirror / Atom feed
* Re: [PATCH 1/7] Input: libps2 - attach ps2dev instances as serio port's drvdata
From: Raul E Rangel @ 2023-05-18 17:20 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
In-Reply-To: <20230511185252.386941-2-dmitry.torokhov@gmail.com>

On Thu, May 11, 2023 at 11:52:41AM -0700, Dmitry Torokhov wrote:
> In preparation of having unified interrupt handler for PS/2 devices,
> instead of attaching instances of psmouse and atkbd structures as serio's
> driver data, switch to attaching ps2dev instances.
> 
> Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
> ---
>  drivers/input/keyboard/atkbd.c     | 23 +++++++++++++-------
>  drivers/input/mouse/psmouse-base.c | 35 +++++++++++++++++-------------
>  drivers/input/mouse/psmouse.h      |  2 ++
>  drivers/input/mouse/synaptics.c    | 10 ++++-----
>  drivers/input/mouse/trackpoint.c   |  2 +-
>  drivers/input/serio/libps2.c       |  1 +
>  6 files changed, 44 insertions(+), 29 deletions(-)
> 
> diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c
> index 246958795f60..2fb2ad73e796 100644
> --- a/drivers/input/keyboard/atkbd.c
> +++ b/drivers/input/keyboard/atkbd.c
> @@ -309,12 +309,19 @@ static ssize_t atkbd_show_function_row_physmap(struct atkbd *atkbd, char *buf)
>  	return vivaldi_function_row_physmap_show(&atkbd->vdata, buf);
>  }
>  
> +static struct atkbd *atkbd_from_serio(struct serio *serio)
> +{
> +	struct ps2dev *ps2dev = serio_get_drvdata(serio);
> +
> +	return container_of(ps2dev, struct atkbd, ps2dev);
> +}
> +
>  static umode_t atkbd_attr_is_visible(struct kobject *kobj,
>  				struct attribute *attr, int i)
>  {
>  	struct device *dev = kobj_to_dev(kobj);
>  	struct serio *serio = to_serio_port(dev);
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  
>  	if (attr == &atkbd_attr_function_row_physmap.attr &&
>  	    !atkbd->vdata.num_function_row_keys)
> @@ -399,7 +406,7 @@ static unsigned int atkbd_compat_scancode(struct atkbd *atkbd, unsigned int code
>  static irqreturn_t atkbd_interrupt(struct serio *serio, unsigned char data,
>  				   unsigned int flags)
>  {
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  	struct input_dev *dev = atkbd->dev;
>  	unsigned int code = data;
>  	int scroll = 0, hscroll = 0, click = -1;
> @@ -909,7 +916,7 @@ static int atkbd_reset_state(struct atkbd *atkbd)
>  
>  static void atkbd_cleanup(struct serio *serio)
>  {
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  
>  	atkbd_disable(atkbd);
>  	ps2_command(&atkbd->ps2dev, NULL, ATKBD_CMD_RESET_DEF);
> @@ -922,7 +929,7 @@ static void atkbd_cleanup(struct serio *serio)
>  
>  static void atkbd_disconnect(struct serio *serio)
>  {
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  
>  	atkbd_disable(atkbd);
>  
> @@ -1188,7 +1195,7 @@ static void atkbd_set_device_attrs(struct atkbd *atkbd)
>  
>  static void atkbd_parse_fwnode_data(struct serio *serio)
>  {
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  	struct device *dev = &serio->dev;
>  	int n;
>  
> @@ -1295,7 +1302,7 @@ static int atkbd_connect(struct serio *serio, struct serio_driver *drv)
>  
>  static int atkbd_reconnect(struct serio *serio)
>  {
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  	struct serio_driver *drv = serio->drv;
>  	int retval = -1;
>  
> @@ -1389,7 +1396,7 @@ static ssize_t atkbd_attr_show_helper(struct device *dev, char *buf,
>  				ssize_t (*handler)(struct atkbd *, char *))
>  {
>  	struct serio *serio = to_serio_port(dev);
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  
>  	return handler(atkbd, buf);
>  }
> @@ -1398,7 +1405,7 @@ static ssize_t atkbd_attr_set_helper(struct device *dev, const char *buf, size_t
>  				ssize_t (*handler)(struct atkbd *, const char *, size_t))
>  {
>  	struct serio *serio = to_serio_port(dev);
> -	struct atkbd *atkbd = serio_get_drvdata(serio);
> +	struct atkbd *atkbd = atkbd_from_serio(serio);
>  	int retval;
>  
>  	retval = mutex_lock_interruptible(&atkbd->mutex);
> diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c
> index c9a7e87b273e..ed5376099fba 100644
> --- a/drivers/input/mouse/psmouse-base.c
> +++ b/drivers/input/mouse/psmouse-base.c
> @@ -116,6 +116,13 @@ static DEFINE_MUTEX(psmouse_mutex);
>  
>  static struct workqueue_struct *kpsmoused_wq;
>  
> +struct psmouse *psmouse_from_serio(struct serio *serio)
> +{
> +	struct ps2dev *ps2dev = serio_get_drvdata(serio);
> +
> +	return container_of(ps2dev, struct psmouse, ps2dev);
> +}
> +
>  void psmouse_report_standard_buttons(struct input_dev *dev, u8 buttons)
>  {
>  	input_report_key(dev, BTN_LEFT,   buttons & BIT(0));
> @@ -336,7 +343,7 @@ static void psmouse_handle_oob_data(struct psmouse *psmouse, u8 data)
>  static irqreturn_t psmouse_interrupt(struct serio *serio,
>  				     u8 data, unsigned int flags)
>  {
> -	struct psmouse *psmouse = serio_get_drvdata(serio);
> +	struct psmouse *psmouse = psmouse_from_serio(serio);
>  
>  	if (psmouse->state == PSMOUSE_IGNORE)
>  		goto out;
> @@ -1344,7 +1351,7 @@ static void psmouse_resync(struct work_struct *work)
>  		goto out;
>  
>  	if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
> -		parent = serio_get_drvdata(serio->parent);
> +		parent = psmouse_from_serio(serio->parent);
>  		psmouse_deactivate(parent);
>  	}
>  
> @@ -1428,13 +1435,13 @@ static void psmouse_resync(struct work_struct *work)
>   */
>  static void psmouse_cleanup(struct serio *serio)
>  {
> -	struct psmouse *psmouse = serio_get_drvdata(serio);
> +	struct psmouse *psmouse = psmouse_from_serio(serio);
>  	struct psmouse *parent = NULL;
>  
>  	mutex_lock(&psmouse_mutex);
>  
>  	if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
> -		parent = serio_get_drvdata(serio->parent);
> +		parent = psmouse_from_serio(serio->parent);
>  		psmouse_deactivate(parent);
>  	}
>  
> @@ -1476,7 +1483,7 @@ static void psmouse_cleanup(struct serio *serio)
>   */
>  static void psmouse_disconnect(struct serio *serio)
>  {
> -	struct psmouse *psmouse = serio_get_drvdata(serio);
> +	struct psmouse *psmouse = psmouse_from_serio(serio);
>  	struct psmouse *parent = NULL;
>  
>  	mutex_lock(&psmouse_mutex);
> @@ -1489,7 +1496,7 @@ static void psmouse_disconnect(struct serio *serio)
>  	mutex_lock(&psmouse_mutex);
>  
>  	if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
> -		parent = serio_get_drvdata(serio->parent);
> +		parent = psmouse_from_serio(serio->parent);
>  		psmouse_deactivate(parent);
>  	}
>  
> @@ -1588,7 +1595,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
>  	 * connected to this port can be successfully identified
>  	 */
>  	if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
> -		parent = serio_get_drvdata(serio->parent);
> +		parent = psmouse_from_serio(serio->parent);
>  		psmouse_deactivate(parent);
>  	}
>  
> @@ -1604,8 +1611,6 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
>  
>  	psmouse_set_state(psmouse, PSMOUSE_INITIALIZING);
>  
> -	serio_set_drvdata(serio, psmouse);
> -
>  	error = serio_open(serio, drv);
>  	if (error)
>  		goto err_clear_drvdata;
> @@ -1676,7 +1681,7 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv)
>  
>  static int __psmouse_reconnect(struct serio *serio, bool fast_reconnect)
>  {
> -	struct psmouse *psmouse = serio_get_drvdata(serio);
> +	struct psmouse *psmouse = psmouse_from_serio(serio);
>  	struct psmouse *parent = NULL;
>  	int (*reconnect_handler)(struct psmouse *);
>  	enum psmouse_type type;
> @@ -1695,7 +1700,7 @@ static int __psmouse_reconnect(struct serio *serio, bool fast_reconnect)
>  	}
>  
>  	if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
> -		parent = serio_get_drvdata(serio->parent);
> +		parent = psmouse_from_serio(serio->parent);
>  		psmouse_deactivate(parent);
>  	}
>  
> @@ -1794,7 +1799,7 @@ ssize_t psmouse_attr_show_helper(struct device *dev, struct device_attribute *de
>  {
>  	struct serio *serio = to_serio_port(dev);
>  	struct psmouse_attribute *attr = to_psmouse_attr(devattr);
> -	struct psmouse *psmouse = serio_get_drvdata(serio);
> +	struct psmouse *psmouse = psmouse_from_serio(serio);
>  
>  	if (psmouse->protocol->smbus_companion &&
>  			devattr != &psmouse_attr_protocol.dattr)
> @@ -1815,7 +1820,7 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev
>  	if (retval)
>  		goto out;
>  
> -	psmouse = serio_get_drvdata(serio);
> +	psmouse = psmouse_from_serio(serio);
>  
>  	if (psmouse->protocol->smbus_companion &&
>  			devattr != &psmouse_attr_protocol.dattr) {
> @@ -1830,7 +1835,7 @@ ssize_t psmouse_attr_set_helper(struct device *dev, struct device_attribute *dev
>  		}
>  
>  		if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
> -			parent = serio_get_drvdata(serio->parent);
> +			parent = psmouse_from_serio(serio->parent);
>  			psmouse_deactivate(parent);
>  		}
>  
> @@ -1925,7 +1930,7 @@ static ssize_t psmouse_attr_set_protocol(struct psmouse *psmouse, void *data, co
>  	}
>  
>  	if (serio->parent && serio->id.type == SERIO_PS_PSTHRU) {
> -		parent = serio_get_drvdata(serio->parent);
> +		parent = psmouse_from_serio(serio->parent);
>  		if (parent->pt_deactivate)
>  			parent->pt_deactivate(parent);
>  	}
> diff --git a/drivers/input/mouse/psmouse.h b/drivers/input/mouse/psmouse.h
> index 64c3a5d3fb3e..4d8acfe0d82a 100644
> --- a/drivers/input/mouse/psmouse.h
> +++ b/drivers/input/mouse/psmouse.h
> @@ -130,6 +130,8 @@ struct psmouse {
>  	void (*pt_deactivate)(struct psmouse *psmouse);
>  };
>  
> +struct psmouse *psmouse_from_serio(struct serio *serio);
> +
>  void psmouse_queue_work(struct psmouse *psmouse, struct delayed_work *work,
>  		unsigned long delay);
>  int psmouse_reset(struct psmouse *psmouse);
> diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c
> index fa021af8506e..ada299ec5bba 100644
> --- a/drivers/input/mouse/synaptics.c
> +++ b/drivers/input/mouse/synaptics.c
> @@ -628,7 +628,7 @@ static void synaptics_set_rate(struct psmouse *psmouse, unsigned int rate)
>   ****************************************************************************/
>  static int synaptics_pt_write(struct serio *serio, u8 c)
>  {
> -	struct psmouse *parent = serio_get_drvdata(serio->parent);
> +	struct psmouse *parent = psmouse_from_serio(serio->parent);
>  	u8 rate_param = SYN_PS_CLIENT_CMD; /* indicates that we want pass-through port */
>  	int error;
>  
> @@ -645,7 +645,7 @@ static int synaptics_pt_write(struct serio *serio, u8 c)
>  
>  static int synaptics_pt_start(struct serio *serio)
>  {
> -	struct psmouse *parent = serio_get_drvdata(serio->parent);
> +	struct psmouse *parent = psmouse_from_serio(serio->parent);
>  	struct synaptics_data *priv = parent->private;
>  
>  	serio_pause_rx(parent->ps2dev.serio);
> @@ -657,7 +657,7 @@ static int synaptics_pt_start(struct serio *serio)
>  
>  static void synaptics_pt_stop(struct serio *serio)
>  {
> -	struct psmouse *parent = serio_get_drvdata(serio->parent);
> +	struct psmouse *parent = psmouse_from_serio(serio->parent);
>  	struct synaptics_data *priv = parent->private;
>  
>  	serio_pause_rx(parent->ps2dev.serio);
> @@ -672,7 +672,7 @@ static int synaptics_is_pt_packet(u8 *buf)
>  
>  static void synaptics_pass_pt_packet(struct serio *ptport, u8 *packet)
>  {
> -	struct psmouse *child = serio_get_drvdata(ptport);
> +	struct psmouse *child = psmouse_from_serio(ptport);
>  
>  	if (child && child->state == PSMOUSE_ACTIVATED) {
>  		serio_interrupt(ptport, packet[1], 0);
> @@ -688,7 +688,7 @@ static void synaptics_pass_pt_packet(struct serio *ptport, u8 *packet)
>  static void synaptics_pt_activate(struct psmouse *psmouse)
>  {
>  	struct synaptics_data *priv = psmouse->private;
> -	struct psmouse *child = serio_get_drvdata(priv->pt_port);
> +	struct psmouse *child = psmouse_from_serio(priv->pt_port);
>  
>  	/* adjust the touchpad to child's choice of protocol */
>  	if (child) {
> diff --git a/drivers/input/mouse/trackpoint.c b/drivers/input/mouse/trackpoint.c
> index 4a86b3e31d3b..5f6643b69a2c 100644
> --- a/drivers/input/mouse/trackpoint.c
> +++ b/drivers/input/mouse/trackpoint.c
> @@ -216,7 +216,7 @@ static umode_t trackpoint_is_attr_visible(struct kobject *kobj,
>  {
>  	struct device *dev = kobj_to_dev(kobj);
>  	struct serio *serio = to_serio_port(dev);
> -	struct psmouse *psmouse = serio_get_drvdata(serio);
> +	struct psmouse *psmouse = psmouse_from_serio(serio);
>  
>  	return trackpoint_is_attr_available(psmouse, attr) ? attr->mode : 0;
>  }
> diff --git a/drivers/input/serio/libps2.c b/drivers/input/serio/libps2.c
> index 3e19344eda93..764990723847 100644
> --- a/drivers/input/serio/libps2.c
> +++ b/drivers/input/serio/libps2.c
> @@ -382,6 +382,7 @@ void ps2_init(struct ps2dev *ps2dev, struct serio *serio)
>  	lockdep_set_subclass(&ps2dev->cmd_mutex, serio->depth);
>  	init_waitqueue_head(&ps2dev->wait);
>  	ps2dev->serio = serio;
> +	serio_set_drvdata(serio, ps2dev);
>  }
>  EXPORT_SYMBOL(ps2_init);
>  
Reviewed-by: Raul Rangel <rrangel@chromium.org>

^ permalink raw reply

* Re: [PATCH v2] Input: tests: add test to cover all input_grab_device() function
From: Javier Martinez Canillas @ 2023-05-18 13:38 UTC (permalink / raw)
  To: Dana Elfassy, eballetb, dmitry.torokhov, linux-input,
	linux-kernel
  Cc: Dana Elfassy
In-Reply-To: <20230517153145.513095-1-dangel101@gmail.com>

Dana Elfassy <delfassy@redhat.com> writes:

Hello Dana,

> Currently input_grab_device() isn't covered by any tests
> Thus, adding a test to cover the cases:
> 1. The device is grabbed successfully
> 2. Trying to grab a device that is already grabbed by another input
>    handle
>
> Signed-off-by: Dana Elfassy <dangel101@gmail.com>
> Tested-by: Javier Martinez Canillas <javierm@redhat.com>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> ---

[...]

> +
> +	handle.dev = input_get_device(input_dev);
> +	handle.name = dev_name(&input_dev->dev);
> +	handle.handler = &handler;
> +	res = input_grab_device(&handle);

Another thing I noticed is that your test will try to grab the same
input_handle twice. So you need to remove the line above I believe.

> +	KUNIT_ASSERT_TRUE(test, input_grab_device(&handle));
> +

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply

* [dtor-input:next] BUILD SUCCESS d8bde56dfd86a0bba9206de8574e58c8aaac4f0f
From: kernel test robot @ 2023-05-18 11:00 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input

tree/branch: INFO setup_repo_specs: /db/releases/20230517200055/lkp-src/repo/*/dtor-input
https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
branch HEAD: d8bde56dfd86a0bba9206de8574e58c8aaac4f0f  Input: Switch i2c drivers back to use .probe()

elapsed time: 733m

configs tested: 200
configs skipped: 15

The following configs have been built successfully.
More configs may be tested in the coming days.

tested configs:
alpha                            allyesconfig   gcc  
alpha        buildonly-randconfig-r001-20230517   gcc  
alpha                               defconfig   gcc  
alpha                randconfig-r012-20230517   gcc  
alpha                randconfig-r015-20230517   gcc  
arc                              allyesconfig   gcc  
arc          buildonly-randconfig-r002-20230517   gcc  
arc          buildonly-randconfig-r006-20230517   gcc  
arc                                 defconfig   gcc  
arc                  randconfig-r003-20230517   gcc  
arc                  randconfig-r022-20230517   gcc  
arm                              allmodconfig   gcc  
arm                              allyesconfig   gcc  
arm                                 defconfig   gcc  
arm                       imx_v6_v7_defconfig   gcc  
arm                        keystone_defconfig   gcc  
arm                        mvebu_v5_defconfig   clang
arm                            qcom_defconfig   gcc  
arm                  randconfig-r036-20230517   gcc  
arm                  randconfig-r046-20230517   clang
arm                           sama5_defconfig   gcc  
arm64                            allyesconfig   gcc  
arm64                               defconfig   gcc  
arm64                randconfig-r003-20230517   clang
arm64                randconfig-r012-20230517   gcc  
arm64                randconfig-r014-20230517   gcc  
arm64                randconfig-r022-20230518   clang
arm64                randconfig-r023-20230517   gcc  
csky         buildonly-randconfig-r005-20230517   gcc  
csky                                defconfig   gcc  
csky                 randconfig-r001-20230517   gcc  
csky                 randconfig-r013-20230517   gcc  
hexagon              randconfig-r022-20230517   clang
hexagon              randconfig-r035-20230517   clang
hexagon              randconfig-r041-20230517   clang
hexagon              randconfig-r045-20230517   clang
i386                             allyesconfig   gcc  
i386                              debian-10.3   gcc  
i386                                defconfig   gcc  
i386                          randconfig-a002   clang
i386                          randconfig-a004   clang
i386                          randconfig-a006   clang
i386                          randconfig-a012   gcc  
i386                          randconfig-a014   gcc  
i386                          randconfig-a016   gcc  
ia64                             allmodconfig   gcc  
ia64         buildonly-randconfig-r003-20230517   gcc  
ia64         buildonly-randconfig-r004-20230517   gcc  
ia64                                defconfig   gcc  
ia64                 randconfig-r014-20230517   gcc  
ia64                 randconfig-r016-20230517   gcc  
ia64                 randconfig-r036-20230517   gcc  
loongarch                        allmodconfig   gcc  
loongarch                         allnoconfig   gcc  
loongarch                           defconfig   gcc  
loongarch            randconfig-r001-20230517   gcc  
loongarch            randconfig-r005-20230517   gcc  
m68k                             alldefconfig   gcc  
m68k                             allmodconfig   gcc  
m68k                         apollo_defconfig   gcc  
m68k                                defconfig   gcc  
m68k                          multi_defconfig   gcc  
m68k                        mvme16x_defconfig   gcc  
m68k                 randconfig-r005-20230517   gcc  
m68k                 randconfig-r011-20230517   gcc  
m68k                 randconfig-r023-20230517   gcc  
m68k                 randconfig-r024-20230517   gcc  
m68k                 randconfig-r034-20230517   gcc  
microblaze   buildonly-randconfig-r002-20230517   gcc  
microblaze   buildonly-randconfig-r003-20230517   gcc  
microblaze           randconfig-r003-20230517   gcc  
microblaze           randconfig-r021-20230517   gcc  
microblaze           randconfig-r025-20230517   gcc  
microblaze           randconfig-r031-20230517   gcc  
mips                             allmodconfig   gcc  
mips                             allyesconfig   gcc  
mips                          ath79_defconfig   clang
mips         buildonly-randconfig-r005-20230517   gcc  
mips                     decstation_defconfig   gcc  
mips                            gpr_defconfig   gcc  
mips                        maltaup_defconfig   clang
mips                 randconfig-r006-20230517   gcc  
mips                 randconfig-r015-20230517   clang
mips                 randconfig-r025-20230517   clang
nios2                         10m50_defconfig   gcc  
nios2                               defconfig   gcc  
nios2                randconfig-r004-20230517   gcc  
nios2                randconfig-r011-20230517   gcc  
nios2                randconfig-r025-20230517   gcc  
openrisc             randconfig-r001-20230517   gcc  
openrisc             randconfig-r002-20230517   gcc  
openrisc             randconfig-r003-20230517   gcc  
openrisc             randconfig-r013-20230517   gcc  
openrisc             randconfig-r035-20230517   gcc  
parisc                           alldefconfig   gcc  
parisc                              defconfig   gcc  
parisc               randconfig-r013-20230517   gcc  
parisc               randconfig-r026-20230517   gcc  
parisc64                            defconfig   gcc  
powerpc                          allmodconfig   gcc  
powerpc                           allnoconfig   gcc  
powerpc                       eiger_defconfig   gcc  
powerpc                        fsp2_defconfig   clang
powerpc                  iss476-smp_defconfig   gcc  
powerpc              randconfig-r011-20230517   gcc  
powerpc              randconfig-r014-20230517   gcc  
powerpc              randconfig-r016-20230517   gcc  
powerpc              randconfig-r025-20230518   clang
powerpc                     sequoia_defconfig   gcc  
powerpc                     tqm5200_defconfig   clang
powerpc                      tqm8xx_defconfig   gcc  
powerpc                      walnut_defconfig   clang
riscv                            allmodconfig   gcc  
riscv                             allnoconfig   gcc  
riscv                               defconfig   gcc  
riscv             nommu_k210_sdcard_defconfig   gcc  
riscv                randconfig-r024-20230517   gcc  
riscv                randconfig-r026-20230517   gcc  
riscv                randconfig-r032-20230517   clang
riscv                          rv32_defconfig   gcc  
s390                             allmodconfig   gcc  
s390                             allyesconfig   gcc  
s390         buildonly-randconfig-r003-20230517   gcc  
s390                                defconfig   gcc  
s390                 randconfig-r004-20230517   clang
s390                 randconfig-r021-20230517   gcc  
s390                 randconfig-r022-20230517   gcc  
s390                 randconfig-r026-20230517   gcc  
s390                 randconfig-r031-20230517   clang
s390                 randconfig-r032-20230517   clang
sh                               allmodconfig   gcc  
sh           buildonly-randconfig-r004-20230517   gcc  
sh           buildonly-randconfig-r005-20230517   gcc  
sh           buildonly-randconfig-r006-20230517   gcc  
sh                        dreamcast_defconfig   gcc  
sh                ecovec24-romimage_defconfig   gcc  
sh                            migor_defconfig   gcc  
sh                          r7780mp_defconfig   gcc  
sh                   randconfig-r002-20230517   gcc  
sh                   randconfig-r013-20230517   gcc  
sh                   randconfig-r022-20230517   gcc  
sh                   randconfig-r024-20230517   gcc  
sh                           se7619_defconfig   gcc  
sh                           se7722_defconfig   gcc  
sh                           se7780_defconfig   gcc  
sh                   secureedge5410_defconfig   gcc  
sh                           sh2007_defconfig   gcc  
sh                        sh7763rdp_defconfig   gcc  
sh                   sh7770_generic_defconfig   gcc  
sh                             shx3_defconfig   gcc  
sh                          urquell_defconfig   gcc  
sparc        buildonly-randconfig-r002-20230517   gcc  
sparc        buildonly-randconfig-r004-20230517   gcc  
sparc                               defconfig   gcc  
sparc                randconfig-r003-20230517   gcc  
sparc                randconfig-r006-20230517   gcc  
sparc                randconfig-r024-20230517   gcc  
sparc                randconfig-r033-20230517   gcc  
sparc64      buildonly-randconfig-r001-20230517   gcc  
sparc64      buildonly-randconfig-r004-20230517   gcc  
sparc64              randconfig-r005-20230517   gcc  
sparc64              randconfig-r015-20230517   gcc  
sparc64              randconfig-r033-20230517   gcc  
um                             i386_defconfig   gcc  
um                           x86_64_defconfig   gcc  
x86_64                            allnoconfig   gcc  
x86_64                           allyesconfig   gcc  
x86_64                              defconfig   gcc  
x86_64                                  kexec   gcc  
x86_64                        randconfig-a001   clang
x86_64                        randconfig-a003   clang
x86_64                        randconfig-a005   clang
x86_64                        randconfig-a012   clang
x86_64                        randconfig-a014   clang
x86_64                        randconfig-a016   clang
x86_64                        randconfig-x052   clang
x86_64                        randconfig-x054   clang
x86_64                        randconfig-x056   clang
x86_64                        randconfig-x061   gcc  
x86_64                        randconfig-x062   clang
x86_64                        randconfig-x063   gcc  
x86_64                        randconfig-x064   clang
x86_64                        randconfig-x065   gcc  
x86_64                        randconfig-x066   clang
x86_64                           rhel-8.3-bpf   gcc  
x86_64                          rhel-8.3-func   gcc  
x86_64                    rhel-8.3-kselftests   gcc  
x86_64                         rhel-8.3-kunit   gcc  
x86_64                           rhel-8.3-kvm   gcc  
x86_64                           rhel-8.3-ltp   gcc  
x86_64                           rhel-8.3-syz   gcc  
x86_64                               rhel-8.3   gcc  
xtensa       buildonly-randconfig-r001-20230517   gcc  
xtensa       buildonly-randconfig-r002-20230517   gcc  
xtensa       buildonly-randconfig-r003-20230517   gcc  
xtensa               randconfig-r002-20230517   gcc  
xtensa               randconfig-r004-20230517   gcc  
xtensa               randconfig-r006-20230517   gcc  
xtensa               randconfig-r021-20230517   gcc  
xtensa               randconfig-r034-20230517   gcc  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests

^ permalink raw reply

* Re: [BUG][NEW DATA] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2
From: Mirsad Todorovac @ 2023-05-18  8:00 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mirsad Goran Todorovac, linux-usb, linux-kernel, linux-input,
	Benjamin Tissoires, Jiri Kosina
In-Reply-To: <2023051704-basket-hardcover-1a0c@gregkh>

On 5/17/23 20:57, Greg Kroah-Hartman wrote:

> And leaks are hard to notice, especially ones that only show up when you
> remove a specific type of device.
> 
> thanks again for your help here,

I feel like more of a hindrance from the real issues than being helpful.

Memory leaks seem easy to detect, however, building with KMEMLEAK
debugging on can take up to 50-67% of system time, as I've noticed
a couple of days ago ...

It is obviously incurring some overhead. I did not expect a kernel compilation
as computation-heavy process to have such an impact from memory object
debugging.

Best regards,
Mirsad

-- 
Mirsad Goran Todorovac
Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu

System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb, Republic of Croatia

"What’s this thing suddenly coming towards me very fast? Very very fast.
... I wonder if it will be friends with me?"

^ permalink raw reply

* Słowa kluczowe do wypozycjonowania
From: Adam Charachuta @ 2023-05-18  7:41 UTC (permalink / raw)
  To: linux-input

Dzień dobry,

zapoznałem się z Państwa ofertą i z przyjemnością przyznaję, że przyciąga uwagę i zachęca do dalszych rozmów. 

Pomyślałem, że może mógłbym mieć swój wkład w Państwa rozwój i pomóc dotrzeć z tą ofertą do większego grona odbiorców. Pozycjonuję strony www, dzięki czemu generują świetny ruch w sieci.

Możemy porozmawiać w najbliższym czasie?


Pozdrawiam
Adam Charachuta

^ permalink raw reply

* Re: [PATCH v4 2/4] ARM/mmc: Convert old mmci-omap to GPIO descriptors
From: Linus Walleij @ 2023-05-17 21:36 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Janusz Krzysztofik, Tony Lindgren, Russell King, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Thomas Bogendoerfer,
	Dmitry Torokhov, Mark Brown, Bartosz Golaszewski, Andreas Kemnade,
	Helge Deller, Ulf Hansson, linux-omap, linux-arm-kernel,
	linux-kernel, linux-mips, linux-input, linux-spi, linux-fbdev,
	dri-devel, linux-mmc
In-Reply-To: <20230517203011.GH271152@darkstar.musicnaut.iki.fi>

On Wed, May 17, 2023 at 10:30 PM Aaro Koskinen <aaro.koskinen@iki.fi> wrote:

> This one has some issue as mmci-omap is unable to find the GPIOs on 770.
>
> On Mon, May 08, 2023 at 11:20:07PM +0200, Linus Walleij wrote:
> > +static struct gpiod_lookup_table nokia770_mmc_gpio_table = {
> > +     .dev_id = "mmci-omap",
>
> Changing this to "mmci-omap.1" helped, not sure if that is a correct way.
> Most likely N800 and N810 are broken as well.

Yep looked over it, OMAP1 has mmci-omap.1 and OMAP2 has
mmci-omap.0.

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 1/4] Input: ads7846 - Convert to use software nodes
From: Linus Walleij @ 2023-05-17 21:20 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Janusz Krzysztofik, Tony Lindgren, Russell King, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Thomas Bogendoerfer,
	Dmitry Torokhov, Mark Brown, Bartosz Golaszewski, Andreas Kemnade,
	Helge Deller, Ulf Hansson, linux-omap, linux-arm-kernel,
	linux-kernel, linux-mips, linux-input, linux-spi, linux-fbdev,
	dri-devel, linux-mmc
In-Reply-To: <20230517203953.GI271152@darkstar.musicnaut.iki.fi>

On Wed, May 17, 2023 at 10:39 PM Aaro Koskinen <aaro.koskinen@iki.fi> wrote:

> When tested w/gpio-descriptors-omap branch, the touchscreen probe fails:
>
> [    2.378540] SPI driver ads7846 has no spi_device_id for ti,tsc2046
> [    2.391906] SPI driver ads7846 has no spi_device_id for ti,ads7843
> [    2.405029] SPI driver ads7846 has no spi_device_id for ti,ads7845
> [    2.418151] SPI driver ads7846 has no spi_device_id for ti,ads7873

This is just regular noise from SPI device drivers that are missing
spi_device_id.

> [    2.432556] ads7846 spi2.0: Unknown device model
> [    2.443817] ads7846: probe of spi2.0 failed with error -22
>
> I don't know if that's caused by any the patches in the branch or some
> other regression. With v6.2 it probes OK.

The device is missing compatible. I fixed it.

Will push the branch after looking at the rest of the comments.

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 1/4] Input: ads7846 - Convert to use software nodes
From: Linus Walleij @ 2023-05-17 21:11 UTC (permalink / raw)
  To: Aaro Koskinen
  Cc: Janusz Krzysztofik, Tony Lindgren, Russell King, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Thomas Bogendoerfer,
	Dmitry Torokhov, Mark Brown, Bartosz Golaszewski, Andreas Kemnade,
	Helge Deller, Ulf Hansson, linux-omap, linux-arm-kernel,
	linux-kernel, linux-mips, linux-input, linux-spi, linux-fbdev,
	dri-devel, linux-mmc
In-Reply-To: <20230517195911.GG271152@darkstar.musicnaut.iki.fi>

On Wed, May 17, 2023 at 9:59 PM Aaro Koskinen <aaro.koskinen@iki.fi> wrote:

> This does not compile as nokia770_ads7846_props is declared twice,
> and nokia770_cbus_props and nokia770_mpuio_gpiochip_swnode are missing.

Hmmmm I think we should probably update omap1_defconfig to enable
all the OMAP1 drivers so we have good compile coverage. It's the
ifdefs that fool me into believeing the code actually compiles ...

> On Mon, May 08, 2023 at 11:20:06PM +0200, Linus Walleij wrote:
> > +static const struct software_node_ref_args nokia770_cbus_gpio_refs[] = {
> > +     SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_swnode, 9, 0),
> > +     SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_swnode, 10, 0),
> > +     SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_swnode, 11, 0),
> > +};
>
> These should be nokia770_mpuio_gpiochip_node.

Fixed it.

> > +static const struct property_entry nokia770_ads7846_props[] = {
> > +     PROPERTY_ENTRY_REF_ARRAY("gpios", nokia770_cbus_gpio_refs),
> > +     { }
> >  };
>
> This should be nokia770_cbus_props.

Fixed it.

Also enabled CONFIG_I2C_CBUS_GPIO and recompiled.

Yours,
Linus Walleij

Yours,
Linus Walleij

^ permalink raw reply

* Re: [PATCH v4 1/4] Input: ads7846 - Convert to use software nodes
From: Aaro Koskinen @ 2023-05-17 20:39 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Janusz Krzysztofik, Tony Lindgren, Russell King, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Thomas Bogendoerfer,
	Dmitry Torokhov, Mark Brown, Bartosz Golaszewski, Andreas Kemnade,
	Helge Deller, Ulf Hansson, linux-omap, linux-arm-kernel,
	linux-kernel, linux-mips, linux-input, linux-spi, linux-fbdev,
	dri-devel, linux-mmc
In-Reply-To: <20230430-nokia770-regression-v4-1-9b6dc5536b17@linaro.org>

Hi,

On Mon, May 08, 2023 at 11:20:06PM +0200, Linus Walleij wrote:
> The CBUS also has the ADS7846 touchscreen attached.

Not sure what this comment means. CBUS is for Retu/Tahvo, and touchscreen
is SPI.

When tested w/gpio-descriptors-omap branch, the touchscreen probe fails:

[    2.378540] SPI driver ads7846 has no spi_device_id for ti,tsc2046
[    2.391906] SPI driver ads7846 has no spi_device_id for ti,ads7843
[    2.405029] SPI driver ads7846 has no spi_device_id for ti,ads7845
[    2.418151] SPI driver ads7846 has no spi_device_id for ti,ads7873
[    2.432556] ads7846 spi2.0: Unknown device model
[    2.443817] ads7846: probe of spi2.0 failed with error -22

I don't know if that's caused by any the patches in the branch or some
other regression. With v6.2 it probes OK.

A.

^ permalink raw reply

* Re: [PATCH v4 2/4] ARM/mmc: Convert old mmci-omap to GPIO descriptors
From: Aaro Koskinen @ 2023-05-17 20:30 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Janusz Krzysztofik, Tony Lindgren, Russell King, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Thomas Bogendoerfer,
	Dmitry Torokhov, Mark Brown, Bartosz Golaszewski, Andreas Kemnade,
	Helge Deller, Ulf Hansson, linux-omap, linux-arm-kernel,
	linux-kernel, linux-mips, linux-input, linux-spi, linux-fbdev,
	dri-devel, linux-mmc
In-Reply-To: <20230430-nokia770-regression-v4-2-9b6dc5536b17@linaro.org>

Hi,

This one has some issue as mmci-omap is unable to find the GPIOs on 770.

On Mon, May 08, 2023 at 11:20:07PM +0200, Linus Walleij wrote:
> +static struct gpiod_lookup_table nokia770_mmc_gpio_table = {
> +	.dev_id = "mmci-omap",

Changing this to "mmci-omap.1" helped, not sure if that is a correct way.
Most likely N800 and N810 are broken as well.

A.

^ permalink raw reply

* Re: [PATCH v4 1/4] Input: ads7846 - Convert to use software nodes
From: Aaro Koskinen @ 2023-05-17 19:59 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Janusz Krzysztofik, Tony Lindgren, Russell King, Daniel Mack,
	Haojian Zhuang, Robert Jarzmik, Thomas Bogendoerfer,
	Dmitry Torokhov, Mark Brown, Bartosz Golaszewski, Andreas Kemnade,
	Helge Deller, Ulf Hansson, linux-omap, linux-arm-kernel,
	linux-kernel, linux-mips, linux-input, linux-spi, linux-fbdev,
	dri-devel, linux-mmc
In-Reply-To: <20230430-nokia770-regression-v4-1-9b6dc5536b17@linaro.org>

Hi,

This does not compile as nokia770_ads7846_props is declared twice,
and nokia770_cbus_props and nokia770_mpuio_gpiochip_swnode are missing.

On Mon, May 08, 2023 at 11:20:06PM +0200, Linus Walleij wrote:
> +static const struct software_node_ref_args nokia770_cbus_gpio_refs[] = {
> +	SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_swnode, 9, 0),
> +	SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_swnode, 10, 0),
> +	SOFTWARE_NODE_REFERENCE(&nokia770_mpuio_gpiochip_swnode, 11, 0),
> +};

These should be nokia770_mpuio_gpiochip_node.

> +static const struct property_entry nokia770_ads7846_props[] = {
> +	PROPERTY_ENTRY_REF_ARRAY("gpios", nokia770_cbus_gpio_refs),
> +	{ }
>  };

This should be nokia770_cbus_props.

A.

^ permalink raw reply

* Re: [BUG][NEW DATA] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2
From: Mirsad Goran Todorovac @ 2023-05-17 19:41 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mirsad Goran Todorovac, linux-usb, linux-kernel, linux-input,
	Benjamin Tissoires, Jiri Kosina
In-Reply-To: <2023051704-basket-hardcover-1a0c@gregkh>

On 5/17/23 20:57, Greg Kroah-Hartman wrote:
> On Wed, May 17, 2023 at 06:10:54PM +0200, Mirsad Goran Todorovac wrote:
>> On 5/16/23 16:36, Greg Kroah-Hartman wrote:
>>> On Fri, May 12, 2023 at 11:33:31PM +0200, Mirsad Goran Todorovac wrote:
>>>> Hi,
>>>>
>>>> On 5/9/23 04:59, Greg Kroah-Hartman wrote:
>>>>> On Tue, May 09, 2023 at 01:51:35AM +0200, Mirsad Goran Todorovac wrote:
>>>>>>
>>>>>>
>>>>>> On 08. 05. 2023. 16:01, Greg Kroah-Hartman wrote:
>>>>>>> On Mon, May 08, 2023 at 08:51:55AM +0200, Greg Kroah-Hartman wrote:
>>>>>>>> On Mon, May 08, 2023 at 08:30:07AM +0200, Mirsad Goran Todorovac wrote:
>>>>>>>>> Hi,
>>>>>>>>>
>>>>>>>>> There seems to be a kernel memory leak in the USB keyboard driver.
>>>>>>>>>
>>>>>>>>> The leaked memory allocs are 96 and 512 bytes.
>>>>>>>>>
>>>>>>>>> The platform is Ubuntu 22.04 LTS on a assembled AMD Ryzen 9 with X670E PG
>>>>>>>>> Lightning mobo,
>>>>>>>>> and Genius SlimStar i220 GK-080012 keyboard.
>>>>>>>>>
>>>>>>>>> (Logitech M100 HID mouse is not affected by the bug.)
>>>>>>>>>
>>>>>>>>> BIOS is:
>>>>>>>>>
>>>>>>>>>          *-firmware
>>>>>>>>>               description: BIOS
>>>>>>>>>               vendor: American Megatrends International, LLC.
>>>>>>>>>               physical id: 0
>>>>>>>>>               version: 1.21
>>>>>>>>>               date: 04/26/2023
>>>>>>>>>               size: 64KiB
>>>>>>>>>
>>>>>>>>> The kernel is 6.3.0-torvalds-<id>-13466-gfc4354c6e5c2.
>>>>>>>>>
>>>>>>>>> The keyboard is recognised as Chicony:
>>>>>>>>>
>>>>>>>>>                      *-usb
>>>>>>>>>                           description: Keyboard
>>>>>>>>>                           product: CHICONY USB Keyboard
>>>>>>>>>                           vendor: CHICONY
>>>>>>>>>                           physical id: 2
>>>>>>>>>                           bus info: usb@5:2
>>>>>>>>>                           logical name: input35
>>>>>>>>>                           logical name: /dev/input/event4
>>>>>>>>>                           logical name: input35::capslock
>>>>>>>>>                           logical name: input35::numlock
>>>>>>>>>                           logical name: input35::scrolllock
>>>>>>>>>                           logical name: input36
>>>>>>>>>                           logical name: /dev/input/event5
>>>>>>>>>                           logical name: input37
>>>>>>>>>                           logical name: /dev/input/event6
>>>>>>>>>                           logical name: input38
>>>>>>>>>                           logical name: /dev/input/event8
>>>>>>>>>                           version: 2.30
>>>>>>>>>                           capabilities: usb-2.00 usb
>>>>>>>>>                           configuration: driver=usbhid maxpower=100mA
>>>>>>>>> speed=1Mbit/s
>>>>>>>>>
>>>>>>>>> The bug is easily reproduced by unplugging the USB keyboard, waiting about a
>>>>>>>>> couple of seconds,
>>>>>>>>> and then reconnect and scan for memory leaks twice.
>>>>>>>>>
>>>>>>>>> The kmemleak log is as follows [edited privacy info]:
>>>>>>>>>
>>>>>>>>> root@hostname:/home/username# cat /sys/kernel/debug/kmemleak
>>>>>>>>> unreferenced object 0xffff8dd020037c00 (size 96):
>>>>>>>>>       comm "systemd-udevd", pid 435, jiffies 4294892550 (age 8909.356s)
>>>>>>>>>       hex dump (first 32 bytes):
>>>>>>>>>         5d 8e 4e b9 ff ff ff ff 00 00 00 00 00 00 00 00 ].N.............
>>>>>>>>>         00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
>>>>>>>>>       backtrace:
>>>>>>>>>         [<ffffffffb81a74be>] __kmem_cache_alloc_node+0x22e/0x2b0
>>>>>>>>>         [<ffffffffb8127b6e>] kmalloc_trace+0x2e/0xa0
>>>>>>>>>         [<ffffffffb87543d9>] class_create+0x29/0x80
>>>>>>>>>         [<ffffffffb8880d24>] usb_register_dev+0x1d4/0x2e0
>>>>>>>>
>>>>>>>> As the call to class_create() in this path is now gone in 6.4-rc1, can
>>>>>>>> you retry that release to see if this is still there or not?
>>>>>>>
>>>>>>> No, wait, it's still there, I was looking at a development branch of
>>>>>>> mine that isn't sent upstream yet.  And syzbot just reported the same
>>>>>>> thing:
>>>>>>> 	https://lore.kernel.org/r/00000000000058d15f05fb264013@google.com
>>>>>>>
>>>>>>> So something's wrong here, let me dig into it tomorrow when I get a
>>>>>>> chance...
>>>>>>
>>>>>> If this could help, here is the bisect of the bug (I could not discern what
>>>>>> could possibly be wrong):
>>>>>>
>>>>>> user@host:~/linux/kernel/linux_torvalds$ git bisect log
>>>>>> git bisect start
>>>>>> # bad: [ac9a78681b921877518763ba0e89202254349d1b] Linux 6.4-rc1
>>>>>> git bisect bad ac9a78681b921877518763ba0e89202254349d1b
>>>>>> # good: [c9c3395d5e3dcc6daee66c6908354d47bf98cb0c] Linux 6.2
>>>>>> git bisect good c9c3395d5e3dcc6daee66c6908354d47bf98cb0c
>>>>>> # good: [85496c9b3bf8dbe15e2433d3a0197954d323cadc] Merge branch
>>>>>> 'net-remove-some-rcu_bh-cruft'
>>>>>> git bisect good 85496c9b3bf8dbe15e2433d3a0197954d323cadc
>>>>>> # good: [b68ee1c6131c540a62ecd443be89c406401df091] Merge tag 'scsi-misc' of
>>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
>>>>>> git bisect good b68ee1c6131c540a62ecd443be89c406401df091
>>>>>> # bad: [888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0] Merge tag 'sysctl-6.4-rc1'
>>>>>> of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux
>>>>>> git bisect bad 888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0
>>>>>> # good: [34b62f186db9614e55d021f8c58d22fc44c57911] Merge tag
>>>>>> 'pci-v6.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
>>>>>> git bisect good 34b62f186db9614e55d021f8c58d22fc44c57911
>>>>>> # good: [34da76dca4673ab1819830b4924bb5b436325b26] Merge tag
>>>>>> 'for-linus-2023042601' of
>>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
>>>>>> git bisect good 34da76dca4673ab1819830b4924bb5b436325b26
>>>>>> # good: [97b2ff294381d05e59294a931c4db55276470cb5] Merge tag
>>>>>> 'staging-6.4-rc1' of
>>>>>> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
>>>>>> git bisect good 97b2ff294381d05e59294a931c4db55276470cb5
>>>>>> # good: [2025b2ca8004c04861903d076c67a73a0ec6dfca] mcb-lpc: Reallocate
>>>>>> memory region to avoid memory overlapping
>>>>>> git bisect good 2025b2ca8004c04861903d076c67a73a0ec6dfca
>>>>>> # bad: [d06f5a3f7140921ada47d49574ae6fa4de5e2a89] cdx: fix build failure due
>>>>>> to sysfs 'bus_type' argument needing to be const
>>>>>> git bisect bad d06f5a3f7140921ada47d49574ae6fa4de5e2a89
>>>>>> # good: [dcfbb67e48a2becfce7990386e985b9c45098ee5] driver core: class: use
>>>>>> lock_class_key already present in struct subsys_private
>>>>>> git bisect good dcfbb67e48a2becfce7990386e985b9c45098ee5
>>>>>> # bad: [6f14c02220c791d5c46b0f965b9340c58f3d503d] driver core: create
>>>>>> class_is_registered()
>>>>>> git bisect bad 6f14c02220c791d5c46b0f965b9340c58f3d503d
>>>>>> # good: [2f9e87f5a2941b259336c7ea6c5a1499ede4554a] driver core: Add a
>>>>>> comment to set_primary_fwnode() on nullifying
>>>>>> git bisect good 2f9e87f5a2941b259336c7ea6c5a1499ede4554a
>>>>>> # bad: [02fe26f25325b547b7a31a65deb0326c04bb5174] firmware_loader: Add debug
>>>>>> message with checksum for FW file
>>>>>> git bisect bad 02fe26f25325b547b7a31a65deb0326c04bb5174
>>>>>> # good: [884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82] driver core: class:
>>>>>> implement class_get/put without the private pointer.
>>>>>> git bisect good 884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82
>>>>>> # bad: [3f84aa5ec052dba960baca4ab8a352d43d47028e] base: soc: populate
>>>>>> machine name in soc_device_register if empty
>>>>>> git bisect bad 3f84aa5ec052dba960baca4ab8a352d43d47028e
>>>>>> # bad: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core: class.c:
>>>>>> convert to only use class_to_subsys
>>>>>> git bisect bad 7b884b7f24b42fa25e92ed724ad82f137610afaf
>>>>>> # first bad commit: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core:
>>>>>> class.c: convert to only use class_to_subsys
>>>>>> user@host:~/linux/kernel/linux_torvalds$
>>>>>
>>>>> This helps a lot, thanks.  I got the reference counting wrong somewhere
>>>>> in here, I thought I tested this better, odd it shows up now...
>>>>>
>>>>> I'll try to work on it this week.
>>>>
>>>> I have figured out that the leak occurs on keyboard unplugging only, one
>>>> or two leaks (maybe a race condition?).
>>>>
>>>> Please NOTE that the number of leaks is now odd:
>>>>
>>>> root@defiant:/home/marvin# cat /sys/kernel/debug/kmemleak | grep comm
>>>>     comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
>>>>     comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
>>>>     comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.224s)
>>>>     comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.272s)
>>>>     comm "kworker/6:3", pid 3046, jiffies 4294935362 (age 544.780s)
>>>>     comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.740s)
>>>>     comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.784s)
>>>> root@defiant:/home/marvin#
>>>>
>>>> At one time unplugging keyboard generated only one leak, but only at one
>>>> time. As it requires manually unplugging keyboard, I didn't seem to find a
>>>> way to automate it, but it doesn't seem to require root access.
>>>>
>>>> BTW, I've seen in syzbot output that kmemleak output has debug source file
>>>> names and line numbers. I couldn't make that work with the dbg .deb.
>>>>
>>>> I will do some more homework, but this was a rough week.
>>>
>>> I made up a patch based on code inspection alone, as I couldn't
>>> reproduce this locally at all:
>>> 	https://lore.kernel.org/r/2023051628-thumb-boaster-5680@gregkh
>>> and it seemed to pass syzbot's tests.
>>>
>>> I've included it here below, can you test it as well?
>>>
>>> Hm, I only tested with a USB mouse unplug/plug cycle, maybe the issue is
>>> a keyboard?
>>>
>>> thanks,
>>>
>>> greg k-h
>>>
>>> -------------
>>>
>>> diff --git a/drivers/base/class.c b/drivers/base/class.c
>>> index ac1808d1a2e8..9b44edc8416f 100644
>>> --- a/drivers/base/class.c
>>> +++ b/drivers/base/class.c
>>> @@ -320,6 +322,7 @@ void class_dev_iter_init(struct class_dev_iter *iter, const struct class *class,
>>>    		start_knode = &start->p->knode_class;
>>>    	klist_iter_init_node(&sp->klist_devices, &iter->ki, start_knode);
>>>    	iter->type = type;
>>> +	iter->sp = sp;
>>>    }
>>>    EXPORT_SYMBOL_GPL(class_dev_iter_init);
>>> @@ -361,6 +364,7 @@ EXPORT_SYMBOL_GPL(class_dev_iter_next);
>>>    void class_dev_iter_exit(struct class_dev_iter *iter)
>>>    {
>>>    	klist_iter_exit(&iter->ki);
>>> +	subsys_put(iter->sp);
>>>    }
>>>    EXPORT_SYMBOL_GPL(class_dev_iter_exit);
>>> diff --git a/include/linux/device/class.h b/include/linux/device/class.h
>>> index 9deeaeb457bb..abf3d3bfb6fe 100644
>>> --- a/include/linux/device/class.h
>>> +++ b/include/linux/device/class.h
>>> @@ -74,6 +74,7 @@ struct class {
>>>    struct class_dev_iter {
>>>    	struct klist_iter		ki;
>>>    	const struct device_type	*type;
>>> +	struct subsys_private		*sp;
>>>    };
>>>    int __must_check class_register(const struct class *class);
>>
>> The build with the latest 6.4-rc2 and without this patch still leaked,
>> the build with the same commit and this patch applied was successful:
>>
>> root@defiant:/home/marvin# cat /sys/kernel/debug/kmemleak
>> root@defiant:/home/marvin#
>>
>> Tried three times, and it is a OK.
>>
>> Congratulations! This had fixed the leak.
> 
> Wonderful, thanks for testing, can I add your "Tested-by:" to it?

Don't mention it. Tested-by: is fine, certainly.

>> I wonder why it didn't show in the other contexts, hardware and archs?
> 
> It might depend on your keyboard if it has other things on it?  I don't
> know, sorry, I didn't spend much time digging after I found the "obvious
> leak" based on the bisection you provided, which was very very helpful,
> thanks for that.

It looks like a rather normal Genius keyboard, which the system detected
as "Chicony".

Maybe it is the motherboard or the controller? Did I send the lshw.txt?

Yes, I did.

I can't tell which one of these it is:

root@defiant:/home/marvin# lspci -k | grep -B2 xhci
15:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] Device 43f7 
(rev 01)
	Subsystem: ASMedia Technology Inc. Device 1142
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
--
17:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] Device 43f7 
(rev 01)
	Subsystem: ASMedia Technology Inc. Device 1142
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
--
1a:00.3 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15b6
	Subsystem: ASRock Incorporation Device 15b6
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
1a:00.4 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15b7
	Subsystem: ASRock Incorporation Device 15b6
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
--
1b:00.0 USB controller: Advanced Micro Devices, Inc. [AMD] Device 15b8
	Subsystem: ASRock Incorporation Device 15b6
	Kernel driver in use: xhci_hcd
	Kernel modules: xhci_pci
root@defiant:/home/marvin#

Regarding the bisection, no need to thank, I was actually happy to test
the new hardware.

Before, it would take 15 hours for the bisect that big.

Though the box was slightly overheating (91 °C), and probably there
ought to be a way to recompile only changed sources after a
"git checkout" ... that would speed up many bisects, BTW.

> And leaks are hard to notice, especially ones that only show up when you
> remove a specific type of device.

Well, the leaks are rather harmless, but they show some inconsistency in
the code, so I took them seriously.

> thanks again for your help here,

Not at all, I hope to find some "real" bugs. :-)

> greg k-h

Best regards,
Mirsad

^ permalink raw reply

* Re: [BUG][NEW DATA] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2
From: Greg Kroah-Hartman @ 2023-05-17 18:57 UTC (permalink / raw)
  To: Mirsad Goran Todorovac
  Cc: Mirsad Goran Todorovac, linux-usb, linux-kernel, linux-input,
	Benjamin Tissoires, Jiri Kosina
In-Reply-To: <70dd7fa2-9a5f-9361-ebe0-bb337c523d09@alu.unizg.hr>

On Wed, May 17, 2023 at 06:10:54PM +0200, Mirsad Goran Todorovac wrote:
> On 5/16/23 16:36, Greg Kroah-Hartman wrote:
> > On Fri, May 12, 2023 at 11:33:31PM +0200, Mirsad Goran Todorovac wrote:
> > > Hi,
> > > 
> > > On 5/9/23 04:59, Greg Kroah-Hartman wrote:
> > > > On Tue, May 09, 2023 at 01:51:35AM +0200, Mirsad Goran Todorovac wrote:
> > > > > 
> > > > > 
> > > > > On 08. 05. 2023. 16:01, Greg Kroah-Hartman wrote:
> > > > > > On Mon, May 08, 2023 at 08:51:55AM +0200, Greg Kroah-Hartman wrote:
> > > > > > > On Mon, May 08, 2023 at 08:30:07AM +0200, Mirsad Goran Todorovac wrote:
> > > > > > > > Hi,
> > > > > > > > 
> > > > > > > > There seems to be a kernel memory leak in the USB keyboard driver.
> > > > > > > > 
> > > > > > > > The leaked memory allocs are 96 and 512 bytes.
> > > > > > > > 
> > > > > > > > The platform is Ubuntu 22.04 LTS on a assembled AMD Ryzen 9 with X670E PG
> > > > > > > > Lightning mobo,
> > > > > > > > and Genius SlimStar i220 GK-080012 keyboard.
> > > > > > > > 
> > > > > > > > (Logitech M100 HID mouse is not affected by the bug.)
> > > > > > > > 
> > > > > > > > BIOS is:
> > > > > > > > 
> > > > > > > >         *-firmware
> > > > > > > >              description: BIOS
> > > > > > > >              vendor: American Megatrends International, LLC.
> > > > > > > >              physical id: 0
> > > > > > > >              version: 1.21
> > > > > > > >              date: 04/26/2023
> > > > > > > >              size: 64KiB
> > > > > > > > 
> > > > > > > > The kernel is 6.3.0-torvalds-<id>-13466-gfc4354c6e5c2.
> > > > > > > > 
> > > > > > > > The keyboard is recognised as Chicony:
> > > > > > > > 
> > > > > > > >                     *-usb
> > > > > > > >                          description: Keyboard
> > > > > > > >                          product: CHICONY USB Keyboard
> > > > > > > >                          vendor: CHICONY
> > > > > > > >                          physical id: 2
> > > > > > > >                          bus info: usb@5:2
> > > > > > > >                          logical name: input35
> > > > > > > >                          logical name: /dev/input/event4
> > > > > > > >                          logical name: input35::capslock
> > > > > > > >                          logical name: input35::numlock
> > > > > > > >                          logical name: input35::scrolllock
> > > > > > > >                          logical name: input36
> > > > > > > >                          logical name: /dev/input/event5
> > > > > > > >                          logical name: input37
> > > > > > > >                          logical name: /dev/input/event6
> > > > > > > >                          logical name: input38
> > > > > > > >                          logical name: /dev/input/event8
> > > > > > > >                          version: 2.30
> > > > > > > >                          capabilities: usb-2.00 usb
> > > > > > > >                          configuration: driver=usbhid maxpower=100mA
> > > > > > > > speed=1Mbit/s
> > > > > > > > 
> > > > > > > > The bug is easily reproduced by unplugging the USB keyboard, waiting about a
> > > > > > > > couple of seconds,
> > > > > > > > and then reconnect and scan for memory leaks twice.
> > > > > > > > 
> > > > > > > > The kmemleak log is as follows [edited privacy info]:
> > > > > > > > 
> > > > > > > > root@hostname:/home/username# cat /sys/kernel/debug/kmemleak
> > > > > > > > unreferenced object 0xffff8dd020037c00 (size 96):
> > > > > > > >      comm "systemd-udevd", pid 435, jiffies 4294892550 (age 8909.356s)
> > > > > > > >      hex dump (first 32 bytes):
> > > > > > > >        5d 8e 4e b9 ff ff ff ff 00 00 00 00 00 00 00 00 ].N.............
> > > > > > > >        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
> > > > > > > >      backtrace:
> > > > > > > >        [<ffffffffb81a74be>] __kmem_cache_alloc_node+0x22e/0x2b0
> > > > > > > >        [<ffffffffb8127b6e>] kmalloc_trace+0x2e/0xa0
> > > > > > > >        [<ffffffffb87543d9>] class_create+0x29/0x80
> > > > > > > >        [<ffffffffb8880d24>] usb_register_dev+0x1d4/0x2e0
> > > > > > > 
> > > > > > > As the call to class_create() in this path is now gone in 6.4-rc1, can
> > > > > > > you retry that release to see if this is still there or not?
> > > > > > 
> > > > > > No, wait, it's still there, I was looking at a development branch of
> > > > > > mine that isn't sent upstream yet.  And syzbot just reported the same
> > > > > > thing:
> > > > > > 	https://lore.kernel.org/r/00000000000058d15f05fb264013@google.com
> > > > > > 
> > > > > > So something's wrong here, let me dig into it tomorrow when I get a
> > > > > > chance...
> > > > > 
> > > > > If this could help, here is the bisect of the bug (I could not discern what
> > > > > could possibly be wrong):
> > > > > 
> > > > > user@host:~/linux/kernel/linux_torvalds$ git bisect log
> > > > > git bisect start
> > > > > # bad: [ac9a78681b921877518763ba0e89202254349d1b] Linux 6.4-rc1
> > > > > git bisect bad ac9a78681b921877518763ba0e89202254349d1b
> > > > > # good: [c9c3395d5e3dcc6daee66c6908354d47bf98cb0c] Linux 6.2
> > > > > git bisect good c9c3395d5e3dcc6daee66c6908354d47bf98cb0c
> > > > > # good: [85496c9b3bf8dbe15e2433d3a0197954d323cadc] Merge branch
> > > > > 'net-remove-some-rcu_bh-cruft'
> > > > > git bisect good 85496c9b3bf8dbe15e2433d3a0197954d323cadc
> > > > > # good: [b68ee1c6131c540a62ecd443be89c406401df091] Merge tag 'scsi-misc' of
> > > > > git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
> > > > > git bisect good b68ee1c6131c540a62ecd443be89c406401df091
> > > > > # bad: [888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0] Merge tag 'sysctl-6.4-rc1'
> > > > > of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux
> > > > > git bisect bad 888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0
> > > > > # good: [34b62f186db9614e55d021f8c58d22fc44c57911] Merge tag
> > > > > 'pci-v6.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
> > > > > git bisect good 34b62f186db9614e55d021f8c58d22fc44c57911
> > > > > # good: [34da76dca4673ab1819830b4924bb5b436325b26] Merge tag
> > > > > 'for-linus-2023042601' of
> > > > > git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
> > > > > git bisect good 34da76dca4673ab1819830b4924bb5b436325b26
> > > > > # good: [97b2ff294381d05e59294a931c4db55276470cb5] Merge tag
> > > > > 'staging-6.4-rc1' of
> > > > > git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
> > > > > git bisect good 97b2ff294381d05e59294a931c4db55276470cb5
> > > > > # good: [2025b2ca8004c04861903d076c67a73a0ec6dfca] mcb-lpc: Reallocate
> > > > > memory region to avoid memory overlapping
> > > > > git bisect good 2025b2ca8004c04861903d076c67a73a0ec6dfca
> > > > > # bad: [d06f5a3f7140921ada47d49574ae6fa4de5e2a89] cdx: fix build failure due
> > > > > to sysfs 'bus_type' argument needing to be const
> > > > > git bisect bad d06f5a3f7140921ada47d49574ae6fa4de5e2a89
> > > > > # good: [dcfbb67e48a2becfce7990386e985b9c45098ee5] driver core: class: use
> > > > > lock_class_key already present in struct subsys_private
> > > > > git bisect good dcfbb67e48a2becfce7990386e985b9c45098ee5
> > > > > # bad: [6f14c02220c791d5c46b0f965b9340c58f3d503d] driver core: create
> > > > > class_is_registered()
> > > > > git bisect bad 6f14c02220c791d5c46b0f965b9340c58f3d503d
> > > > > # good: [2f9e87f5a2941b259336c7ea6c5a1499ede4554a] driver core: Add a
> > > > > comment to set_primary_fwnode() on nullifying
> > > > > git bisect good 2f9e87f5a2941b259336c7ea6c5a1499ede4554a
> > > > > # bad: [02fe26f25325b547b7a31a65deb0326c04bb5174] firmware_loader: Add debug
> > > > > message with checksum for FW file
> > > > > git bisect bad 02fe26f25325b547b7a31a65deb0326c04bb5174
> > > > > # good: [884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82] driver core: class:
> > > > > implement class_get/put without the private pointer.
> > > > > git bisect good 884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82
> > > > > # bad: [3f84aa5ec052dba960baca4ab8a352d43d47028e] base: soc: populate
> > > > > machine name in soc_device_register if empty
> > > > > git bisect bad 3f84aa5ec052dba960baca4ab8a352d43d47028e
> > > > > # bad: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core: class.c:
> > > > > convert to only use class_to_subsys
> > > > > git bisect bad 7b884b7f24b42fa25e92ed724ad82f137610afaf
> > > > > # first bad commit: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core:
> > > > > class.c: convert to only use class_to_subsys
> > > > > user@host:~/linux/kernel/linux_torvalds$
> > > > 
> > > > This helps a lot, thanks.  I got the reference counting wrong somewhere
> > > > in here, I thought I tested this better, odd it shows up now...
> > > > 
> > > > I'll try to work on it this week.
> > > 
> > > I have figured out that the leak occurs on keyboard unplugging only, one
> > > or two leaks (maybe a race condition?).
> > > 
> > > Please NOTE that the number of leaks is now odd:
> > > 
> > > root@defiant:/home/marvin# cat /sys/kernel/debug/kmemleak | grep comm
> > >    comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
> > >    comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
> > >    comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.224s)
> > >    comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.272s)
> > >    comm "kworker/6:3", pid 3046, jiffies 4294935362 (age 544.780s)
> > >    comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.740s)
> > >    comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.784s)
> > > root@defiant:/home/marvin#
> > > 
> > > At one time unplugging keyboard generated only one leak, but only at one
> > > time. As it requires manually unplugging keyboard, I didn't seem to find a
> > > way to automate it, but it doesn't seem to require root access.
> > > 
> > > BTW, I've seen in syzbot output that kmemleak output has debug source file
> > > names and line numbers. I couldn't make that work with the dbg .deb.
> > > 
> > > I will do some more homework, but this was a rough week.
> > 
> > I made up a patch based on code inspection alone, as I couldn't
> > reproduce this locally at all:
> > 	https://lore.kernel.org/r/2023051628-thumb-boaster-5680@gregkh
> > and it seemed to pass syzbot's tests.
> > 
> > I've included it here below, can you test it as well?
> > 
> > Hm, I only tested with a USB mouse unplug/plug cycle, maybe the issue is
> > a keyboard?
> > 
> > thanks,
> > 
> > greg k-h
> > 
> > -------------
> > 
> > diff --git a/drivers/base/class.c b/drivers/base/class.c
> > index ac1808d1a2e8..9b44edc8416f 100644
> > --- a/drivers/base/class.c
> > +++ b/drivers/base/class.c
> > @@ -320,6 +322,7 @@ void class_dev_iter_init(struct class_dev_iter *iter, const struct class *class,
> >   		start_knode = &start->p->knode_class;
> >   	klist_iter_init_node(&sp->klist_devices, &iter->ki, start_knode);
> >   	iter->type = type;
> > +	iter->sp = sp;
> >   }
> >   EXPORT_SYMBOL_GPL(class_dev_iter_init);
> > @@ -361,6 +364,7 @@ EXPORT_SYMBOL_GPL(class_dev_iter_next);
> >   void class_dev_iter_exit(struct class_dev_iter *iter)
> >   {
> >   	klist_iter_exit(&iter->ki);
> > +	subsys_put(iter->sp);
> >   }
> >   EXPORT_SYMBOL_GPL(class_dev_iter_exit);
> > diff --git a/include/linux/device/class.h b/include/linux/device/class.h
> > index 9deeaeb457bb..abf3d3bfb6fe 100644
> > --- a/include/linux/device/class.h
> > +++ b/include/linux/device/class.h
> > @@ -74,6 +74,7 @@ struct class {
> >   struct class_dev_iter {
> >   	struct klist_iter		ki;
> >   	const struct device_type	*type;
> > +	struct subsys_private		*sp;
> >   };
> >   int __must_check class_register(const struct class *class);
> 
> The build with the latest 6.4-rc2 and without this patch still leaked,
> the build with the same commit and this patch applied was successful:
> 
> root@defiant:/home/marvin# cat /sys/kernel/debug/kmemleak
> root@defiant:/home/marvin#
> 
> Tried three times, and it is a OK.
> 
> Congratulations! This had fixed the leak.

Wonderful, thanks for testing, can I add your "Tested-by:" to it?

> I wonder why it didn't show in the other contexts, hardware and archs?

It might depend on your keyboard if it has other things on it?  I don't
know, sorry, I didn't spend much time digging after I found the "obvious
leak" based on the bisection you provided, which was very very helpful,
thanks for that.

And leaks are hard to notice, especially ones that only show up when you
remove a specific type of device.

thanks again for your help here,

greg k-h

^ permalink raw reply

* Re: [PATCH v2] Input: tests: add test to cover all input_grab_device() function
From: Javier Martinez Canillas @ 2023-05-17 17:24 UTC (permalink / raw)
  To: Dmitry Torokhov, Dana Elfassy
  Cc: eballetb, linux-input, linux-kernel, Dana Elfassy
In-Reply-To: <ZGUJoClUZpL71Jw4@google.com>

Dmitry Torokhov <dmitry.torokhov@gmail.com> writes:

Hello Dmitry,

> Hi Dana,
>
> On Wed, May 17, 2023 at 06:31:45PM +0300, Dana Elfassy wrote:
>> Currently input_grab_device() isn't covered by any tests
>> Thus, adding a test to cover the cases:
>> 1. The device is grabbed successfully
>> 2. Trying to grab a device that is already grabbed by another input
>>    handle
>> 
>> Signed-off-by: Dana Elfassy <dangel101@gmail.com>
>> Tested-by: Javier Martinez Canillas <javierm@redhat.com>
>> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
>> ---
>> 
>> Changes in v2:
>> - Use input_put_device() to decrement the refcount increased by get().
>> - Remove unnecessary struct input_handle test_handle variable.
>
> So this tests something different than what patch description states.
> You are testing that there is no "recursive" grabbing happening (an API
> could be designed to allow the same handle grab device several times).
> This is a good and useful test, but you do want to also use 2nd separate
> handle to see that it gets -EBUSY as well. And ideally we should have

That was my fault since v1 had two different handles but since it wasn't
releasing it, didn't add any value really so I asked Dana to just drop it.

> another test verifying that the 2nd handle can successfully grab the
> device once the first handle releases it.
>

That's the correct approach indeed and would make the test more useful.

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply

* Re: [PATCH v2] Input: tests: add test to cover all input_grab_device() function
From: Dmitry Torokhov @ 2023-05-17 17:06 UTC (permalink / raw)
  To: Dana Elfassy; +Cc: eballetb, javierm, linux-input, linux-kernel, Dana Elfassy
In-Reply-To: <20230517153145.513095-1-dangel101@gmail.com>

Hi Dana,

On Wed, May 17, 2023 at 06:31:45PM +0300, Dana Elfassy wrote:
> Currently input_grab_device() isn't covered by any tests
> Thus, adding a test to cover the cases:
> 1. The device is grabbed successfully
> 2. Trying to grab a device that is already grabbed by another input
>    handle
> 
> Signed-off-by: Dana Elfassy <dangel101@gmail.com>
> Tested-by: Javier Martinez Canillas <javierm@redhat.com>
> Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
> ---
> 
> Changes in v2:
> - Use input_put_device() to decrement the refcount increased by get().
> - Remove unnecessary struct input_handle test_handle variable.

So this tests something different than what patch description states.
You are testing that there is no "recursive" grabbing happening (an API
could be designed to allow the same handle grab device several times).
This is a good and useful test, but you do want to also use 2nd separate
handle to see that it gets -EBUSY as well. And ideally we should have
another test verifying that the 2nd handle can successfully grab the
device once the first handle releases it.

Thanks.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH] Input: Switch i2c drivers back to use .probe()
From: Dmitry Torokhov @ 2023-05-17 17:02 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: linux-input, kernel
In-Reply-To: <20230517164645.162294-1-u.kleine-koenig@pengutronix.de>

Hi Uwe,

On Wed, May 17, 2023 at 06:46:45PM +0200, Uwe Kleine-König wrote:
> After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
> call-back type"), all drivers being converted to .probe_new() and then
> 03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
> back to (the new) .probe() to be able to eventually drop .probe_new() from
> struct i2c_driver.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> ---
> Hello,
> 
> this patch was generated using coccinelle, but I aligned the result to
> the per-file indention. Other than that it's just s/probe_new/probe/.
> 
> I used v6.4-rc1 as base for it, there are a few patches in next that
> conflict slightly with it, but for me git can sort it all out.
> Feel free to just drop all conflicting hunks if it doesn't go so smooth
> for you, I'll care about the fallout later.

I think I saw only 1 clash in cyttsp5 driver, and I resolved it.
Hopefully I did not miss anything else.

This is now applied for the next merge window.

Thanks.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH] HID: wacom: Check for string overflow from strscpy calls
From: Jason Gerecke @ 2023-05-17 16:51 UTC (permalink / raw)
  To: Peter Hutterer
  Cc: linux-input, Benjamin Tissoires, Jiri Kosina, Ping Cheng,
	Aaron Armstrong Skomra, Joshua Dickens, Jason Gerecke, Ping Cheng
In-Reply-To: <20230504043442.GB1129520@quokka>

On Wed, May 3, 2023 at 9:34 PM Peter Hutterer <peter.hutterer@who-t.net> wrote:
>
> On Fri, Apr 14, 2023 at 11:22:10AM -0700, Jason Gerecke wrote:
> > From: Jason Gerecke <killertofu@gmail.com>
> >
> > The strscpy function is able to return an error code when a copy would
> > overflow the size of the destination. The copy is stopped and the buffer
> > terminated before overflow actually occurs so it is safe to continue
> > execution, but we should still produce a warning should this occur.
> >
> > Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
> > Reviewed-by: Ping Cheng <ping.cheng@wacom.com>
>
> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
>
> Cheers,
>   Peter
>

Sending another request for follow-up.

Jason

> > ---
> >  drivers/hid/wacom_sys.c | 14 ++++++++++----
> >  1 file changed, 10 insertions(+), 4 deletions(-)
> >
> > diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
> > index 8214896adadad..7192970d199a0 100644
> > --- a/drivers/hid/wacom_sys.c
> > +++ b/drivers/hid/wacom_sys.c
> > @@ -2224,7 +2224,9 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix)
> >               } else if (strstr(product_name, "Wacom") ||
> >                          strstr(product_name, "wacom") ||
> >                          strstr(product_name, "WACOM")) {
> > -                     strscpy(name, product_name, sizeof(name));
> > +                     if (strscpy(name, product_name, sizeof(name)) < 0) {
> > +                             hid_warn(wacom->hdev, "String overflow while assembling device name");
> > +                     }
> >               } else {
> >                       snprintf(name, sizeof(name), "Wacom %s", product_name);
> >               }
> > @@ -2242,7 +2244,9 @@ static void wacom_update_name(struct wacom *wacom, const char *suffix)
> >               if (name[strlen(name)-1] == ' ')
> >                       name[strlen(name)-1] = '\0';
> >       } else {
> > -             strscpy(name, features->name, sizeof(name));
> > +             if (strscpy(name, features->name, sizeof(name)) < 0) {
> > +                     hid_warn(wacom->hdev, "String overflow while assembling device name");
> > +             }
> >       }
> >
> >       snprintf(wacom_wac->name, sizeof(wacom_wac->name), "%s%s",
> > @@ -2500,8 +2504,10 @@ static void wacom_wireless_work(struct work_struct *work)
> >                               goto fail;
> >               }
> >
> > -             strscpy(wacom_wac->name, wacom_wac1->name,
> > -                     sizeof(wacom_wac->name));
> > +             if (strscpy(wacom_wac->name, wacom_wac1->name,
> > +                     sizeof(wacom_wac->name)) < 0) {
> > +                     hid_warn(wacom->hdev, "String overflow while assembling device name");
> > +             }
> >       }
> >
> >       return;
> > --
> > 2.40.0
> >

^ permalink raw reply

* [PATCH] Input: Switch i2c drivers back to use .probe()
From: Uwe Kleine-König @ 2023-05-17 16:46 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: linux-input, kernel

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
Hello,

this patch was generated using coccinelle, but I aligned the result to
the per-file indention. Other than that it's just s/probe_new/probe/.

I used v6.4-rc1 as base for it, there are a few patches in next that
conflict slightly with it, but for me git can sort it all out.
Feel free to just drop all conflicting hunks if it doesn't go so smooth
for you, I'll care about the fallout later.

I chose to do this in a single patch for all drivers below
drivers/input. If you want me to split it (per driver? per directory?)
just tell me.

Also note I didn't Cc: all the individual maintainers to not exceed the
allowed length of To: and Cc:. If this patch will be split I can extend
the audience accordingly.

Best regards
Uwe

 drivers/input/joystick/as5011.c                 | 2 +-
 drivers/input/joystick/qwiic-joystick.c         | 2 +-
 drivers/input/keyboard/adp5588-keys.c           | 2 +-
 drivers/input/keyboard/adp5589-keys.c           | 2 +-
 drivers/input/keyboard/cap11xx.c                | 2 +-
 drivers/input/keyboard/cypress-sf.c             | 2 +-
 drivers/input/keyboard/dlink-dir685-touchkeys.c | 2 +-
 drivers/input/keyboard/lm8323.c                 | 2 +-
 drivers/input/keyboard/lm8333.c                 | 2 +-
 drivers/input/keyboard/max7359_keypad.c         | 2 +-
 drivers/input/keyboard/mcs_touchkey.c           | 2 +-
 drivers/input/keyboard/mpr121_touchkey.c        | 2 +-
 drivers/input/keyboard/pinephone-keyboard.c     | 2 +-
 drivers/input/keyboard/qt1050.c                 | 2 +-
 drivers/input/keyboard/qt1070.c                 | 2 +-
 drivers/input/keyboard/qt2160.c                 | 2 +-
 drivers/input/keyboard/tca6416-keypad.c         | 2 +-
 drivers/input/keyboard/tca8418_keypad.c         | 2 +-
 drivers/input/keyboard/tm2-touchkey.c           | 2 +-
 drivers/input/misc/ad714x-i2c.c                 | 2 +-
 drivers/input/misc/adxl34x-i2c.c                | 2 +-
 drivers/input/misc/apanel.c                     | 2 +-
 drivers/input/misc/atmel_captouch.c             | 2 +-
 drivers/input/misc/bma150.c                     | 2 +-
 drivers/input/misc/cma3000_d0x_i2c.c            | 2 +-
 drivers/input/misc/da7280.c                     | 2 +-
 drivers/input/misc/drv260x.c                    | 2 +-
 drivers/input/misc/drv2665.c                    | 2 +-
 drivers/input/misc/drv2667.c                    | 2 +-
 drivers/input/misc/ibm-panel.c                  | 2 +-
 drivers/input/misc/iqs269a.c                    | 2 +-
 drivers/input/misc/iqs626a.c                    | 2 +-
 drivers/input/misc/iqs7222.c                    | 2 +-
 drivers/input/misc/kxtj9.c                      | 2 +-
 drivers/input/misc/mma8450.c                    | 2 +-
 drivers/input/misc/pcf8574_keypad.c             | 2 +-
 drivers/input/mouse/cyapa.c                     | 2 +-
 drivers/input/mouse/elan_i2c_core.c             | 2 +-
 drivers/input/mouse/synaptics_i2c.c             | 2 +-
 drivers/input/rmi4/rmi_i2c.c                    | 2 +-
 drivers/input/rmi4/rmi_smbus.c                  | 2 +-
 drivers/input/touchscreen/ad7879-i2c.c          | 2 +-
 drivers/input/touchscreen/ar1021_i2c.c          | 2 +-
 drivers/input/touchscreen/atmel_mxt_ts.c        | 2 +-
 drivers/input/touchscreen/auo-pixcir-ts.c       | 2 +-
 drivers/input/touchscreen/bu21013_ts.c          | 2 +-
 drivers/input/touchscreen/bu21029_ts.c          | 2 +-
 drivers/input/touchscreen/chipone_icn8318.c     | 2 +-
 drivers/input/touchscreen/chipone_icn8505.c     | 2 +-
 drivers/input/touchscreen/cy8ctma140.c          | 2 +-
 drivers/input/touchscreen/cy8ctmg110_ts.c       | 2 +-
 drivers/input/touchscreen/cyttsp4_i2c.c         | 2 +-
 drivers/input/touchscreen/cyttsp5.c             | 2 +-
 drivers/input/touchscreen/cyttsp_i2c.c          | 2 +-
 drivers/input/touchscreen/edt-ft5x06.c          | 2 +-
 drivers/input/touchscreen/eeti_ts.c             | 2 +-
 drivers/input/touchscreen/egalax_ts.c           | 2 +-
 drivers/input/touchscreen/ektf2127.c            | 2 +-
 drivers/input/touchscreen/elants_i2c.c          | 2 +-
 drivers/input/touchscreen/exc3000.c             | 2 +-
 drivers/input/touchscreen/goodix.c              | 2 +-
 drivers/input/touchscreen/hideep.c              | 2 +-
 drivers/input/touchscreen/himax_hx83112b.c      | 2 +-
 drivers/input/touchscreen/hycon-hy46xx.c        | 2 +-
 drivers/input/touchscreen/hynitron_cstxxx.c     | 2 +-
 drivers/input/touchscreen/ili210x.c             | 2 +-
 drivers/input/touchscreen/ilitek_ts_i2c.c       | 2 +-
 drivers/input/touchscreen/imagis.c              | 2 +-
 drivers/input/touchscreen/iqs5xx.c              | 2 +-
 drivers/input/touchscreen/max11801_ts.c         | 2 +-
 drivers/input/touchscreen/mcs5000_ts.c          | 2 +-
 drivers/input/touchscreen/melfas_mip4.c         | 2 +-
 drivers/input/touchscreen/migor_ts.c            | 2 +-
 drivers/input/touchscreen/mms114.c              | 2 +-
 drivers/input/touchscreen/msg2638.c             | 2 +-
 drivers/input/touchscreen/novatek-nvt-ts.c      | 2 +-
 drivers/input/touchscreen/pixcir_i2c_ts.c       | 2 +-
 drivers/input/touchscreen/raydium_i2c_ts.c      | 2 +-
 drivers/input/touchscreen/rohm_bu21023.c        | 2 +-
 drivers/input/touchscreen/s6sy761.c             | 2 +-
 drivers/input/touchscreen/silead.c              | 2 +-
 drivers/input/touchscreen/sis_i2c.c             | 2 +-
 drivers/input/touchscreen/st1232.c              | 2 +-
 drivers/input/touchscreen/stmfts.c              | 2 +-
 drivers/input/touchscreen/sx8654.c              | 2 +-
 drivers/input/touchscreen/tsc2004.c             | 2 +-
 drivers/input/touchscreen/tsc2007_core.c        | 2 +-
 drivers/input/touchscreen/wacom_i2c.c           | 2 +-
 drivers/input/touchscreen/wdt87xx_i2c.c         | 2 +-
 drivers/input/touchscreen/zet6223.c             | 2 +-
 drivers/input/touchscreen/zforce_ts.c           | 2 +-
 drivers/input/touchscreen/zinitix.c             | 2 +-
 92 files changed, 92 insertions(+), 92 deletions(-)

diff --git a/drivers/input/joystick/as5011.c b/drivers/input/joystick/as5011.c
index 3b88f0b49e01..bf8b1cc0ea9c 100644
--- a/drivers/input/joystick/as5011.c
+++ b/drivers/input/joystick/as5011.c
@@ -348,7 +348,7 @@ static struct i2c_driver as5011_driver = {
 	.driver = {
 		.name = "as5011",
 	},
-	.probe_new	= as5011_probe,
+	.probe		= as5011_probe,
 	.remove		= as5011_remove,
 	.id_table	= as5011_id,
 };
diff --git a/drivers/input/joystick/qwiic-joystick.c b/drivers/input/joystick/qwiic-joystick.c
index d4da31c0616c..7d88d76b14d6 100644
--- a/drivers/input/joystick/qwiic-joystick.c
+++ b/drivers/input/joystick/qwiic-joystick.c
@@ -137,7 +137,7 @@ static struct i2c_driver qwiic_driver = {
 		.of_match_table	= of_match_ptr(of_qwiic_match),
 	},
 	.id_table	= qwiic_id_table,
-	.probe_new	= qwiic_probe,
+	.probe		= qwiic_probe,
 };
 module_i2c_driver(qwiic_driver);
 
diff --git a/drivers/input/keyboard/adp5588-keys.c b/drivers/input/keyboard/adp5588-keys.c
index 72ae5ce72956..896a5a989ddc 100644
--- a/drivers/input/keyboard/adp5588-keys.c
+++ b/drivers/input/keyboard/adp5588-keys.c
@@ -866,7 +866,7 @@ static struct i2c_driver adp5588_driver = {
 		.of_match_table = adp5588_of_match,
 		.pm   = pm_sleep_ptr(&adp5588_dev_pm_ops),
 	},
-	.probe_new = adp5588_probe,
+	.probe    = adp5588_probe,
 	.remove   = adp5588_remove,
 	.id_table = adp5588_id,
 };
diff --git a/drivers/input/keyboard/adp5589-keys.c b/drivers/input/keyboard/adp5589-keys.c
index 38d7073863a8..8996e00cd63a 100644
--- a/drivers/input/keyboard/adp5589-keys.c
+++ b/drivers/input/keyboard/adp5589-keys.c
@@ -1054,7 +1054,7 @@ static struct i2c_driver adp5589_driver = {
 		.name = KBUILD_MODNAME,
 		.pm = pm_sleep_ptr(&adp5589_dev_pm_ops),
 	},
-	.probe_new = adp5589_probe,
+	.probe = adp5589_probe,
 	.id_table = adp5589_id,
 };
 
diff --git a/drivers/input/keyboard/cap11xx.c b/drivers/input/keyboard/cap11xx.c
index 040696d0e49c..1b4937dce672 100644
--- a/drivers/input/keyboard/cap11xx.c
+++ b/drivers/input/keyboard/cap11xx.c
@@ -518,7 +518,7 @@ static struct i2c_driver cap11xx_i2c_driver = {
 		.of_match_table = cap11xx_dt_ids,
 	},
 	.id_table	= cap11xx_i2c_ids,
-	.probe_new	= cap11xx_i2c_probe,
+	.probe		= cap11xx_i2c_probe,
 };
 
 module_i2c_driver(cap11xx_i2c_driver);
diff --git a/drivers/input/keyboard/cypress-sf.c b/drivers/input/keyboard/cypress-sf.c
index 686388f40317..2bacd9d80ecf 100644
--- a/drivers/input/keyboard/cypress-sf.c
+++ b/drivers/input/keyboard/cypress-sf.c
@@ -229,7 +229,7 @@ static struct i2c_driver cypress_sf_driver = {
 		.of_match_table = of_match_ptr(cypress_sf_of_match),
 	},
 	.id_table = cypress_sf_id_table,
-	.probe_new = cypress_sf_probe,
+	.probe = cypress_sf_probe,
 };
 module_i2c_driver(cypress_sf_driver);
 
diff --git a/drivers/input/keyboard/dlink-dir685-touchkeys.c b/drivers/input/keyboard/dlink-dir685-touchkeys.c
index ddba2bc861da..6c065eff5a5a 100644
--- a/drivers/input/keyboard/dlink-dir685-touchkeys.c
+++ b/drivers/input/keyboard/dlink-dir685-touchkeys.c
@@ -145,7 +145,7 @@ static struct i2c_driver dir685_tk_i2c_driver = {
 		.name	= "dlink-dir685-touchkeys",
 		.of_match_table = of_match_ptr(dir685_tk_of_match),
 	},
-	.probe_new	= dir685_tk_probe,
+	.probe		= dir685_tk_probe,
 	.id_table	= dir685_tk_id,
 };
 module_i2c_driver(dir685_tk_i2c_driver);
diff --git a/drivers/input/keyboard/lm8323.c b/drivers/input/keyboard/lm8323.c
index 5df4d5a7ed9e..3964f6e0f6af 100644
--- a/drivers/input/keyboard/lm8323.c
+++ b/drivers/input/keyboard/lm8323.c
@@ -826,7 +826,7 @@ static struct i2c_driver lm8323_i2c_driver = {
 		.name	= "lm8323",
 		.pm	= pm_sleep_ptr(&lm8323_pm_ops),
 	},
-	.probe_new	= lm8323_probe,
+	.probe		= lm8323_probe,
 	.remove		= lm8323_remove,
 	.id_table	= lm8323_id,
 };
diff --git a/drivers/input/keyboard/lm8333.c b/drivers/input/keyboard/lm8333.c
index 7457c3220f90..c9f05764e36d 100644
--- a/drivers/input/keyboard/lm8333.c
+++ b/drivers/input/keyboard/lm8333.c
@@ -218,7 +218,7 @@ static struct i2c_driver lm8333_driver = {
 	.driver = {
 		.name		= "lm8333",
 	},
-	.probe_new	= lm8333_probe,
+	.probe		= lm8333_probe,
 	.remove		= lm8333_remove,
 	.id_table	= lm8333_id,
 };
diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c
index b363749d02e2..faab7691c219 100644
--- a/drivers/input/keyboard/max7359_keypad.c
+++ b/drivers/input/keyboard/max7359_keypad.c
@@ -280,7 +280,7 @@ static struct i2c_driver max7359_i2c_driver = {
 		.name = "max7359",
 		.pm   = pm_sleep_ptr(&max7359_pm),
 	},
-	.probe_new	= max7359_probe,
+	.probe		= max7359_probe,
 	.id_table	= max7359_ids,
 };
 
diff --git a/drivers/input/keyboard/mcs_touchkey.c b/drivers/input/keyboard/mcs_touchkey.c
index d414e19e4559..de312d8eb974 100644
--- a/drivers/input/keyboard/mcs_touchkey.c
+++ b/drivers/input/keyboard/mcs_touchkey.c
@@ -258,7 +258,7 @@ static struct i2c_driver mcs_touchkey_driver = {
 		.name	= "mcs_touchkey",
 		.pm	= pm_sleep_ptr(&mcs_touchkey_pm_ops),
 	},
-	.probe_new	= mcs_touchkey_probe,
+	.probe		= mcs_touchkey_probe,
 	.remove		= mcs_touchkey_remove,
 	.shutdown       = mcs_touchkey_shutdown,
 	.id_table	= mcs_touchkey_id,
diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c
index 74ad353462a3..d434753afab1 100644
--- a/drivers/input/keyboard/mpr121_touchkey.c
+++ b/drivers/input/keyboard/mpr121_touchkey.c
@@ -389,7 +389,7 @@ static struct i2c_driver mpr_touchkey_driver = {
 		.of_match_table = of_match_ptr(mpr121_touchkey_dt_match_table),
 	},
 	.id_table	= mpr121_id,
-	.probe_new	= mpr_touchkey_probe,
+	.probe		= mpr_touchkey_probe,
 };
 
 module_i2c_driver(mpr_touchkey_driver);
diff --git a/drivers/input/keyboard/pinephone-keyboard.c b/drivers/input/keyboard/pinephone-keyboard.c
index 5548699b8b38..038ff3549a7a 100644
--- a/drivers/input/keyboard/pinephone-keyboard.c
+++ b/drivers/input/keyboard/pinephone-keyboard.c
@@ -455,7 +455,7 @@ static const struct of_device_id ppkb_of_match[] = {
 MODULE_DEVICE_TABLE(of, ppkb_of_match);
 
 static struct i2c_driver ppkb_driver = {
-	.probe_new	= ppkb_probe,
+	.probe		= ppkb_probe,
 	.driver		= {
 		.name		= DRV_NAME,
 		.of_match_table = ppkb_of_match,
diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c
index 317fe2b1f827..6953097db445 100644
--- a/drivers/input/keyboard/qt1050.c
+++ b/drivers/input/keyboard/qt1050.c
@@ -588,7 +588,7 @@ static struct i2c_driver qt1050_driver = {
 		.of_match_table = of_match_ptr(qt1050_of_match),
 		.pm = pm_sleep_ptr(&qt1050_pm_ops),
 	},
-	.probe_new = qt1050_probe,
+	.probe = qt1050_probe,
 };
 
 module_i2c_driver(qt1050_driver);
diff --git a/drivers/input/keyboard/qt1070.c b/drivers/input/keyboard/qt1070.c
index fabb50bde844..91aaa9fc43a4 100644
--- a/drivers/input/keyboard/qt1070.c
+++ b/drivers/input/keyboard/qt1070.c
@@ -271,7 +271,7 @@ static struct i2c_driver qt1070_driver = {
 		.pm	= pm_sleep_ptr(&qt1070_pm_ops),
 	},
 	.id_table	= qt1070_id,
-	.probe_new	= qt1070_probe,
+	.probe		= qt1070_probe,
 	.remove		= qt1070_remove,
 };
 
diff --git a/drivers/input/keyboard/qt2160.c b/drivers/input/keyboard/qt2160.c
index 04d2ee6ff577..599ea85cfd30 100644
--- a/drivers/input/keyboard/qt2160.c
+++ b/drivers/input/keyboard/qt2160.c
@@ -460,7 +460,7 @@ static struct i2c_driver qt2160_driver = {
 	},
 
 	.id_table	= qt2160_idtable,
-	.probe_new	= qt2160_probe,
+	.probe		= qt2160_probe,
 	.remove		= qt2160_remove,
 };
 
diff --git a/drivers/input/keyboard/tca6416-keypad.c b/drivers/input/keyboard/tca6416-keypad.c
index 673b905af6fe..2f745cabf4f2 100644
--- a/drivers/input/keyboard/tca6416-keypad.c
+++ b/drivers/input/keyboard/tca6416-keypad.c
@@ -350,7 +350,7 @@ static struct i2c_driver tca6416_keypad_driver = {
 		.name	= "tca6416-keypad",
 		.pm	= pm_sleep_ptr(&tca6416_keypad_dev_pm_ops),
 	},
-	.probe_new	= tca6416_keypad_probe,
+	.probe		= tca6416_keypad_probe,
 	.remove		= tca6416_keypad_remove,
 	.id_table	= tca6416_id,
 };
diff --git a/drivers/input/keyboard/tca8418_keypad.c b/drivers/input/keyboard/tca8418_keypad.c
index 3d7492f38337..76fc19ffe21d 100644
--- a/drivers/input/keyboard/tca8418_keypad.c
+++ b/drivers/input/keyboard/tca8418_keypad.c
@@ -370,7 +370,7 @@ static struct i2c_driver tca8418_keypad_driver = {
 		.name	= "tca8418_keypad",
 		.of_match_table = tca8418_dt_ids,
 	},
-	.probe_new	= tca8418_keypad_probe,
+	.probe		= tca8418_keypad_probe,
 	.id_table	= tca8418_id,
 };
 
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c
index 4e20571cb4c3..75bd3ea51194 100644
--- a/drivers/input/keyboard/tm2-touchkey.c
+++ b/drivers/input/keyboard/tm2-touchkey.c
@@ -356,7 +356,7 @@ static struct i2c_driver tm2_touchkey_driver = {
 		.pm = pm_sleep_ptr(&tm2_touchkey_pm_ops),
 		.of_match_table = tm2_touchkey_of_match,
 	},
-	.probe_new = tm2_touchkey_probe,
+	.probe = tm2_touchkey_probe,
 	.id_table = tm2_touchkey_id_table,
 };
 module_i2c_driver(tm2_touchkey_driver);
diff --git a/drivers/input/misc/ad714x-i2c.c b/drivers/input/misc/ad714x-i2c.c
index d8e39f4a57ac..679fcfea942c 100644
--- a/drivers/input/misc/ad714x-i2c.c
+++ b/drivers/input/misc/ad714x-i2c.c
@@ -86,7 +86,7 @@ static struct i2c_driver ad714x_i2c_driver = {
 		.name = "ad714x_captouch",
 		.pm   = pm_sleep_ptr(&ad714x_pm),
 	},
-	.probe_new = ad714x_i2c_probe,
+	.probe = ad714x_i2c_probe,
 	.id_table = ad714x_id,
 };
 
diff --git a/drivers/input/misc/adxl34x-i2c.c b/drivers/input/misc/adxl34x-i2c.c
index 1c75d98c85a7..6b880e282d99 100644
--- a/drivers/input/misc/adxl34x-i2c.c
+++ b/drivers/input/misc/adxl34x-i2c.c
@@ -135,7 +135,7 @@ static struct i2c_driver adxl34x_driver = {
 		.pm = pm_sleep_ptr(&adxl34x_pm),
 		.of_match_table = adxl34x_of_id,
 	},
-	.probe_new = adxl34x_i2c_probe,
+	.probe    = adxl34x_i2c_probe,
 	.remove   = adxl34x_i2c_remove,
 	.id_table = adxl34x_id,
 };
diff --git a/drivers/input/misc/apanel.c b/drivers/input/misc/apanel.c
index f42d3219cdcc..b5219bbe856d 100644
--- a/drivers/input/misc/apanel.c
+++ b/drivers/input/misc/apanel.c
@@ -201,7 +201,7 @@ static struct i2c_driver apanel_driver = {
 	.driver = {
 		.name = APANEL,
 	},
-	.probe_new	= apanel_probe,
+	.probe		= apanel_probe,
 	.shutdown	= apanel_shutdown,
 	.id_table	= apanel_id,
 };
diff --git a/drivers/input/misc/atmel_captouch.c b/drivers/input/misc/atmel_captouch.c
index d9704b174d3a..b6a30044e814 100644
--- a/drivers/input/misc/atmel_captouch.c
+++ b/drivers/input/misc/atmel_captouch.c
@@ -263,7 +263,7 @@ static const struct i2c_device_id atmel_captouch_id[] = {
 MODULE_DEVICE_TABLE(i2c, atmel_captouch_id);
 
 static struct i2c_driver atmel_captouch_driver = {
-	.probe_new	= atmel_captouch_probe,
+	.probe		= atmel_captouch_probe,
 	.id_table	= atmel_captouch_id,
 	.driver		= {
 		.name	= "atmel_captouch",
diff --git a/drivers/input/misc/bma150.c b/drivers/input/misc/bma150.c
index 3f9da5c3cb53..0fb4cc628f29 100644
--- a/drivers/input/misc/bma150.c
+++ b/drivers/input/misc/bma150.c
@@ -551,7 +551,7 @@ static struct i2c_driver bma150_driver = {
 	},
 	.class		= I2C_CLASS_HWMON,
 	.id_table	= bma150_id,
-	.probe_new	= bma150_probe,
+	.probe		= bma150_probe,
 	.remove		= bma150_remove,
 };
 
diff --git a/drivers/input/misc/cma3000_d0x_i2c.c b/drivers/input/misc/cma3000_d0x_i2c.c
index 136eb3715870..a4dfb3052dc0 100644
--- a/drivers/input/misc/cma3000_d0x_i2c.c
+++ b/drivers/input/misc/cma3000_d0x_i2c.c
@@ -97,7 +97,7 @@ static const struct i2c_device_id cma3000_i2c_id[] = {
 MODULE_DEVICE_TABLE(i2c, cma3000_i2c_id);
 
 static struct i2c_driver cma3000_i2c_driver = {
-	.probe_new	= cma3000_i2c_probe,
+	.probe		= cma3000_i2c_probe,
 	.remove		= cma3000_i2c_remove,
 	.id_table	= cma3000_i2c_id,
 	.driver = {
diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c
index b85a19e3554f..ce82548916bb 100644
--- a/drivers/input/misc/da7280.c
+++ b/drivers/input/misc/da7280.c
@@ -1321,7 +1321,7 @@ static struct i2c_driver da7280_driver = {
 		.of_match_table = of_match_ptr(da7280_of_match),
 		.pm = pm_sleep_ptr(&da7280_pm_ops),
 	},
-	.probe_new = da7280_probe,
+	.probe = da7280_probe,
 	.id_table = da7280_i2c_id,
 };
 module_i2c_driver(da7280_driver);
diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c
index 8a9ebfc04a2d..59acf8d7e259 100644
--- a/drivers/input/misc/drv260x.c
+++ b/drivers/input/misc/drv260x.c
@@ -653,7 +653,7 @@ static const struct of_device_id drv260x_of_match[] = {
 MODULE_DEVICE_TABLE(of, drv260x_of_match);
 
 static struct i2c_driver drv260x_driver = {
-	.probe_new	= drv260x_probe,
+	.probe		= drv260x_probe,
 	.driver		= {
 		.name	= "drv260x-haptics",
 		.of_match_table = drv260x_of_match,
diff --git a/drivers/input/misc/drv2665.c b/drivers/input/misc/drv2665.c
index 9145096f80ea..de27e6079d84 100644
--- a/drivers/input/misc/drv2665.c
+++ b/drivers/input/misc/drv2665.c
@@ -297,7 +297,7 @@ MODULE_DEVICE_TABLE(of, drv2665_of_match);
 #endif
 
 static struct i2c_driver drv2665_driver = {
-	.probe_new	= drv2665_probe,
+	.probe		= drv2665_probe,
 	.driver		= {
 		.name	= "drv2665-haptics",
 		.of_match_table = of_match_ptr(drv2665_of_match),
diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c
index 88b4dbe3e5b5..11c5855256e8 100644
--- a/drivers/input/misc/drv2667.c
+++ b/drivers/input/misc/drv2667.c
@@ -474,7 +474,7 @@ MODULE_DEVICE_TABLE(of, drv2667_of_match);
 #endif
 
 static struct i2c_driver drv2667_driver = {
-	.probe_new	= drv2667_probe,
+	.probe		= drv2667_probe,
 	.driver		= {
 		.name	= "drv2667-haptics",
 		.of_match_table = of_match_ptr(drv2667_of_match),
diff --git a/drivers/input/misc/ibm-panel.c b/drivers/input/misc/ibm-panel.c
index 3969ffc1bc8d..867ac7aa10d2 100644
--- a/drivers/input/misc/ibm-panel.c
+++ b/drivers/input/misc/ibm-panel.c
@@ -189,7 +189,7 @@ static struct i2c_driver ibm_panel_driver = {
 		.name = DEVICE_NAME,
 		.of_match_table = ibm_panel_match,
 	},
-	.probe_new = ibm_panel_probe,
+	.probe = ibm_panel_probe,
 	.remove = ibm_panel_remove,
 };
 module_i2c_driver(ibm_panel_driver);
diff --git a/drivers/input/misc/iqs269a.c b/drivers/input/misc/iqs269a.c
index f4c3aff3895b..1272ef7b5794 100644
--- a/drivers/input/misc/iqs269a.c
+++ b/drivers/input/misc/iqs269a.c
@@ -1746,7 +1746,7 @@ static struct i2c_driver iqs269_i2c_driver = {
 		.of_match_table = iqs269_of_match,
 		.pm = pm_sleep_ptr(&iqs269_pm),
 	},
-	.probe_new = iqs269_probe,
+	.probe = iqs269_probe,
 };
 module_i2c_driver(iqs269_i2c_driver);
 
diff --git a/drivers/input/misc/iqs626a.c b/drivers/input/misc/iqs626a.c
index 90f997a905b5..50035c25c3f7 100644
--- a/drivers/input/misc/iqs626a.c
+++ b/drivers/input/misc/iqs626a.c
@@ -1822,7 +1822,7 @@ static struct i2c_driver iqs626_i2c_driver = {
 		.of_match_table = iqs626_of_match,
 		.pm = pm_sleep_ptr(&iqs626_pm),
 	},
-	.probe_new = iqs626_probe,
+	.probe = iqs626_probe,
 };
 module_i2c_driver(iqs626_i2c_driver);
 
diff --git a/drivers/input/misc/iqs7222.c b/drivers/input/misc/iqs7222.c
index e47ab6c1177f..096b0925f41b 100644
--- a/drivers/input/misc/iqs7222.c
+++ b/drivers/input/misc/iqs7222.c
@@ -2593,7 +2593,7 @@ static struct i2c_driver iqs7222_i2c_driver = {
 		.name = "iqs7222",
 		.of_match_table = iqs7222_of_match,
 	},
-	.probe_new = iqs7222_probe,
+	.probe = iqs7222_probe,
 };
 module_i2c_driver(iqs7222_i2c_driver);
 
diff --git a/drivers/input/misc/kxtj9.c b/drivers/input/misc/kxtj9.c
index 4e806d56c55d..912e614d039d 100644
--- a/drivers/input/misc/kxtj9.c
+++ b/drivers/input/misc/kxtj9.c
@@ -538,7 +538,7 @@ static struct i2c_driver kxtj9_driver = {
 		.name	= NAME,
 		.pm	= pm_sleep_ptr(&kxtj9_pm_ops),
 	},
-	.probe_new	= kxtj9_probe,
+	.probe		= kxtj9_probe,
 	.id_table	= kxtj9_id,
 };
 
diff --git a/drivers/input/misc/mma8450.c b/drivers/input/misc/mma8450.c
index b12152536976..76a190b2220b 100644
--- a/drivers/input/misc/mma8450.c
+++ b/drivers/input/misc/mma8450.c
@@ -202,7 +202,7 @@ static struct i2c_driver mma8450_driver = {
 		.name	= MMA8450_DRV_NAME,
 		.of_match_table = mma8450_dt_ids,
 	},
-	.probe_new	= mma8450_probe,
+	.probe		= mma8450_probe,
 	.id_table	= mma8450_id,
 };
 
diff --git a/drivers/input/misc/pcf8574_keypad.c b/drivers/input/misc/pcf8574_keypad.c
index 6323c3d37ef7..536cedeb38e6 100644
--- a/drivers/input/misc/pcf8574_keypad.c
+++ b/drivers/input/misc/pcf8574_keypad.c
@@ -199,7 +199,7 @@ static struct i2c_driver pcf8574_kp_driver = {
 		.name  = DRV_NAME,
 		.pm = pm_sleep_ptr(&pcf8574_kp_pm_ops),
 	},
-	.probe_new = pcf8574_kp_probe,
+	.probe    = pcf8574_kp_probe,
 	.remove   = pcf8574_kp_remove,
 	.id_table = pcf8574_kp_id,
 };
diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c
index dd7b0d70d791..05851bc32541 100644
--- a/drivers/input/mouse/cyapa.c
+++ b/drivers/input/mouse/cyapa.c
@@ -1489,7 +1489,7 @@ static struct i2c_driver cyapa_driver = {
 		.of_match_table = of_match_ptr(cyapa_of_match),
 	},
 
-	.probe_new = cyapa_probe,
+	.probe = cyapa_probe,
 	.id_table = cyapa_id_table,
 };
 
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c
index 5f0d75a45c80..0cff742302a9 100644
--- a/drivers/input/mouse/elan_i2c_core.c
+++ b/drivers/input/mouse/elan_i2c_core.c
@@ -1424,7 +1424,7 @@ static struct i2c_driver elan_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 		.dev_groups = elan_sysfs_groups,
 	},
-	.probe_new	= elan_probe,
+	.probe		= elan_probe,
 	.id_table	= elan_id,
 };
 
diff --git a/drivers/input/mouse/synaptics_i2c.c b/drivers/input/mouse/synaptics_i2c.c
index 068692a8aba5..af5cc64c622d 100644
--- a/drivers/input/mouse/synaptics_i2c.c
+++ b/drivers/input/mouse/synaptics_i2c.c
@@ -650,7 +650,7 @@ static struct i2c_driver synaptics_i2c_driver = {
 		.pm	= pm_sleep_ptr(&synaptics_i2c_pm),
 	},
 
-	.probe_new	= synaptics_i2c_probe,
+	.probe		= synaptics_i2c_probe,
 	.remove		= synaptics_i2c_remove,
 
 	.id_table	= synaptics_i2c_id_table,
diff --git a/drivers/input/rmi4/rmi_i2c.c b/drivers/input/rmi4/rmi_i2c.c
index d69569ce8d8d..091d4e23b629 100644
--- a/drivers/input/rmi4/rmi_i2c.c
+++ b/drivers/input/rmi4/rmi_i2c.c
@@ -377,7 +377,7 @@ static struct i2c_driver rmi_i2c_driver = {
 		.of_match_table = of_match_ptr(rmi_i2c_of_match),
 	},
 	.id_table	= rmi_id,
-	.probe_new	= rmi_i2c_probe,
+	.probe		= rmi_i2c_probe,
 };
 
 module_i2c_driver(rmi_i2c_driver);
diff --git a/drivers/input/rmi4/rmi_smbus.c b/drivers/input/rmi4/rmi_smbus.c
index 4bf0e1df6a4a..7059a2762aeb 100644
--- a/drivers/input/rmi4/rmi_smbus.c
+++ b/drivers/input/rmi4/rmi_smbus.c
@@ -418,7 +418,7 @@ static struct i2c_driver rmi_smb_driver = {
 		.pm	= pm_ptr(&rmi_smb_pm),
 	},
 	.id_table	= rmi_id,
-	.probe_new	= rmi_smb_probe,
+	.probe		= rmi_smb_probe,
 	.remove		= rmi_smb_remove,
 };
 
diff --git a/drivers/input/touchscreen/ad7879-i2c.c b/drivers/input/touchscreen/ad7879-i2c.c
index dd8f31737bb8..feaa6f8b01ed 100644
--- a/drivers/input/touchscreen/ad7879-i2c.c
+++ b/drivers/input/touchscreen/ad7879-i2c.c
@@ -62,7 +62,7 @@ static struct i2c_driver ad7879_i2c_driver = {
 		.pm	= &ad7879_pm_ops,
 		.of_match_table = of_match_ptr(ad7879_i2c_dt_ids),
 	},
-	.probe_new	= ad7879_i2c_probe,
+	.probe		= ad7879_i2c_probe,
 	.id_table	= ad7879_id,
 };
 
diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c
index 3a5b65cae360..64dfb749386f 100644
--- a/drivers/input/touchscreen/ar1021_i2c.c
+++ b/drivers/input/touchscreen/ar1021_i2c.c
@@ -182,7 +182,7 @@ static struct i2c_driver ar1021_i2c_driver = {
 		.of_match_table = ar1021_i2c_of_match,
 	},
 
-	.probe_new	= ar1021_i2c_probe,
+	.probe		= ar1021_i2c_probe,
 	.id_table	= ar1021_i2c_id,
 };
 module_i2c_driver(ar1021_i2c_driver);
diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c
index 996bf434e1cb..ea45ebad7745 100644
--- a/drivers/input/touchscreen/atmel_mxt_ts.c
+++ b/drivers/input/touchscreen/atmel_mxt_ts.c
@@ -3377,7 +3377,7 @@ static struct i2c_driver mxt_driver = {
 		.acpi_match_table = ACPI_PTR(mxt_acpi_id),
 		.pm	= pm_sleep_ptr(&mxt_pm_ops),
 	},
-	.probe_new	= mxt_probe,
+	.probe		= mxt_probe,
 	.remove		= mxt_remove,
 	.id_table	= mxt_id,
 };
diff --git a/drivers/input/touchscreen/auo-pixcir-ts.c b/drivers/input/touchscreen/auo-pixcir-ts.c
index 5359efc80b2b..90c682e7407f 100644
--- a/drivers/input/touchscreen/auo-pixcir-ts.c
+++ b/drivers/input/touchscreen/auo-pixcir-ts.c
@@ -636,7 +636,7 @@ static struct i2c_driver auo_pixcir_driver = {
 		.pm	= pm_sleep_ptr(&auo_pixcir_pm_ops),
 		.of_match_table	= of_match_ptr(auo_pixcir_ts_dt_idtable),
 	},
-	.probe_new	= auo_pixcir_probe,
+	.probe		= auo_pixcir_probe,
 	.id_table	= auo_pixcir_idtable,
 };
 
diff --git a/drivers/input/touchscreen/bu21013_ts.c b/drivers/input/touchscreen/bu21013_ts.c
index c994ab6f4e58..85332cfaa29d 100644
--- a/drivers/input/touchscreen/bu21013_ts.c
+++ b/drivers/input/touchscreen/bu21013_ts.c
@@ -617,7 +617,7 @@ static struct i2c_driver bu21013_driver = {
 		.name	=	DRIVER_TP,
 		.pm	=	pm_sleep_ptr(&bu21013_dev_pm_ops),
 	},
-	.probe_new	=	bu21013_probe,
+	.probe		=	bu21013_probe,
 	.remove		=	bu21013_remove,
 	.id_table	=	bu21013_id,
 };
diff --git a/drivers/input/touchscreen/bu21029_ts.c b/drivers/input/touchscreen/bu21029_ts.c
index 8f1442894ff9..c8126d2efe95 100644
--- a/drivers/input/touchscreen/bu21029_ts.c
+++ b/drivers/input/touchscreen/bu21029_ts.c
@@ -474,7 +474,7 @@ static struct i2c_driver bu21029_driver = {
 		.pm		= pm_sleep_ptr(&bu21029_pm_ops),
 	},
 	.id_table	= bu21029_ids,
-	.probe_new	= bu21029_probe,
+	.probe		= bu21029_probe,
 };
 module_i2c_driver(bu21029_driver);
 
diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c
index 32b714a6ed2d..9fbeaf17f00b 100644
--- a/drivers/input/touchscreen/chipone_icn8318.c
+++ b/drivers/input/touchscreen/chipone_icn8318.c
@@ -264,7 +264,7 @@ static struct i2c_driver icn8318_driver = {
 		.pm	= pm_sleep_ptr(&icn8318_pm_ops),
 		.of_match_table = icn8318_of_match,
 	},
-	.probe_new = icn8318_probe,
+	.probe = icn8318_probe,
 	.id_table = icn8318_i2c_id,
 };
 
diff --git a/drivers/input/touchscreen/chipone_icn8505.c b/drivers/input/touchscreen/chipone_icn8505.c
index 246bee0bee53..b56954830b33 100644
--- a/drivers/input/touchscreen/chipone_icn8505.c
+++ b/drivers/input/touchscreen/chipone_icn8505.c
@@ -498,7 +498,7 @@ static struct i2c_driver icn8505_driver = {
 		.pm	= pm_sleep_ptr(&icn8505_pm_ops),
 		.acpi_match_table = icn8505_acpi_match,
 	},
-	.probe_new = icn8505_probe,
+	.probe = icn8505_probe,
 };
 
 module_i2c_driver(icn8505_driver);
diff --git a/drivers/input/touchscreen/cy8ctma140.c b/drivers/input/touchscreen/cy8ctma140.c
index cd86477d971a..967ecde23e83 100644
--- a/drivers/input/touchscreen/cy8ctma140.c
+++ b/drivers/input/touchscreen/cy8ctma140.c
@@ -344,7 +344,7 @@ static struct i2c_driver cy8ctma140_driver = {
 		.of_match_table = cy8ctma140_of_match,
 	},
 	.id_table	= cy8ctma140_idtable,
-	.probe_new	= cy8ctma140_probe,
+	.probe		= cy8ctma140_probe,
 };
 module_i2c_driver(cy8ctma140_driver);
 
diff --git a/drivers/input/touchscreen/cy8ctmg110_ts.c b/drivers/input/touchscreen/cy8ctmg110_ts.c
index dcf50fbf6dc7..54d6c4869eb0 100644
--- a/drivers/input/touchscreen/cy8ctmg110_ts.c
+++ b/drivers/input/touchscreen/cy8ctmg110_ts.c
@@ -279,7 +279,7 @@ static struct i2c_driver cy8ctmg110_driver = {
 		.pm	= pm_sleep_ptr(&cy8ctmg110_pm),
 	},
 	.id_table	= cy8ctmg110_idtable,
-	.probe_new	= cy8ctmg110_probe,
+	.probe		= cy8ctmg110_probe,
 };
 
 module_i2c_driver(cy8ctmg110_driver);
diff --git a/drivers/input/touchscreen/cyttsp4_i2c.c b/drivers/input/touchscreen/cyttsp4_i2c.c
index ec7a4779f3fb..80a6890cd45a 100644
--- a/drivers/input/touchscreen/cyttsp4_i2c.c
+++ b/drivers/input/touchscreen/cyttsp4_i2c.c
@@ -60,7 +60,7 @@ static struct i2c_driver cyttsp4_i2c_driver = {
 		.name	= CYTTSP4_I2C_NAME,
 		.pm	= pm_ptr(&cyttsp4_pm_ops),
 	},
-	.probe_new	= cyttsp4_i2c_probe,
+	.probe		= cyttsp4_i2c_probe,
 	.remove		= cyttsp4_i2c_remove,
 	.id_table	= cyttsp4_i2c_id,
 };
diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c
index 30102cb80fac..03470321eb91 100644
--- a/drivers/input/touchscreen/cyttsp5.c
+++ b/drivers/input/touchscreen/cyttsp5.c
@@ -891,7 +891,7 @@ static struct i2c_driver cyttsp5_i2c_driver = {
 		.name = CYTTSP5_NAME,
 		.of_match_table = cyttsp5_of_match,
 	},
-	.probe_new = cyttsp5_i2c_probe,
+	.probe = cyttsp5_i2c_probe,
 	.id_table = cyttsp5_i2c_id,
 };
 module_i2c_driver(cyttsp5_i2c_driver);
diff --git a/drivers/input/touchscreen/cyttsp_i2c.c b/drivers/input/touchscreen/cyttsp_i2c.c
index 3f91cb43ec82..127a8fda1da4 100644
--- a/drivers/input/touchscreen/cyttsp_i2c.c
+++ b/drivers/input/touchscreen/cyttsp_i2c.c
@@ -66,7 +66,7 @@ static struct i2c_driver cyttsp_i2c_driver = {
 		.pm	= pm_sleep_ptr(&cyttsp_pm_ops),
 		.of_match_table = cyttsp_of_i2c_match,
 	},
-	.probe_new	= cyttsp_i2c_probe,
+	.probe		= cyttsp_i2c_probe,
 	.id_table	= cyttsp_i2c_id,
 };
 
diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c
index 24ab9e9f5b21..7da749c36a89 100644
--- a/drivers/input/touchscreen/edt-ft5x06.c
+++ b/drivers/input/touchscreen/edt-ft5x06.c
@@ -1510,7 +1510,7 @@ static struct i2c_driver edt_ft5x06_ts_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.id_table = edt_ft5x06_ts_id,
-	.probe_new = edt_ft5x06_ts_probe,
+	.probe    = edt_ft5x06_ts_probe,
 	.remove   = edt_ft5x06_ts_remove,
 };
 
diff --git a/drivers/input/touchscreen/eeti_ts.c b/drivers/input/touchscreen/eeti_ts.c
index 56fa21688bdb..5e4167f6c63e 100644
--- a/drivers/input/touchscreen/eeti_ts.c
+++ b/drivers/input/touchscreen/eeti_ts.c
@@ -291,7 +291,7 @@ static struct i2c_driver eeti_ts_driver = {
 		.pm = pm_sleep_ptr(&eeti_ts_pm),
 		.of_match_table = of_match_ptr(of_eeti_ts_match),
 	},
-	.probe_new = eeti_ts_probe,
+	.probe = eeti_ts_probe,
 	.id_table = eeti_ts_id,
 };
 
diff --git a/drivers/input/touchscreen/egalax_ts.c b/drivers/input/touchscreen/egalax_ts.c
index 1a9805938e6d..a7f7e7308267 100644
--- a/drivers/input/touchscreen/egalax_ts.c
+++ b/drivers/input/touchscreen/egalax_ts.c
@@ -264,7 +264,7 @@ static struct i2c_driver egalax_ts_driver = {
 		.of_match_table	= egalax_ts_dt_ids,
 	},
 	.id_table	= egalax_ts_id,
-	.probe_new	= egalax_ts_probe,
+	.probe		= egalax_ts_probe,
 };
 
 module_i2c_driver(egalax_ts_driver);
diff --git a/drivers/input/touchscreen/ektf2127.c b/drivers/input/touchscreen/ektf2127.c
index e6f1e46d003d..fd8724a3c19f 100644
--- a/drivers/input/touchscreen/ektf2127.c
+++ b/drivers/input/touchscreen/ektf2127.c
@@ -351,7 +351,7 @@ static struct i2c_driver ektf2127_driver = {
 		.pm	= pm_sleep_ptr(&ektf2127_pm_ops),
 		.of_match_table = of_match_ptr(ektf2127_of_match),
 	},
-	.probe_new = ektf2127_probe,
+	.probe = ektf2127_probe,
 	.id_table = ektf2127_i2c_id,
 };
 module_i2c_driver(ektf2127_driver);
diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c
index 8a16eb51481f..2da1db64126d 100644
--- a/drivers/input/touchscreen/elants_i2c.c
+++ b/drivers/input/touchscreen/elants_i2c.c
@@ -1673,7 +1673,7 @@ MODULE_DEVICE_TABLE(of, elants_of_match);
 #endif
 
 static struct i2c_driver elants_i2c_driver = {
-	.probe_new = elants_i2c_probe,
+	.probe = elants_i2c_probe,
 	.id_table = elants_i2c_id,
 	.driver = {
 		.name = DEVICE_NAME,
diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c
index 69eae79e2087..4af4c1e5d0da 100644
--- a/drivers/input/touchscreen/exc3000.c
+++ b/drivers/input/touchscreen/exc3000.c
@@ -460,7 +460,7 @@ static struct i2c_driver exc3000_driver = {
 		.of_match_table = of_match_ptr(exc3000_of_match),
 	},
 	.id_table	= exc3000_id,
-	.probe_new	= exc3000_probe,
+	.probe		= exc3000_probe,
 };
 
 module_i2c_driver(exc3000_driver);
diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c
index d77f116680a0..f5aa240739f9 100644
--- a/drivers/input/touchscreen/goodix.c
+++ b/drivers/input/touchscreen/goodix.c
@@ -1544,7 +1544,7 @@ MODULE_DEVICE_TABLE(of, goodix_of_match);
 #endif
 
 static struct i2c_driver goodix_ts_driver = {
-	.probe_new = goodix_ts_probe,
+	.probe = goodix_ts_probe,
 	.remove = goodix_ts_remove,
 	.id_table = goodix_ts_id,
 	.driver = {
diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c
index 7c7020099b0f..404153338df7 100644
--- a/drivers/input/touchscreen/hideep.c
+++ b/drivers/input/touchscreen/hideep.c
@@ -1136,7 +1136,7 @@ static struct i2c_driver hideep_driver = {
 		.pm			= pm_sleep_ptr(&hideep_pm_ops),
 	},
 	.id_table	= hideep_i2c_id,
-	.probe_new	= hideep_probe,
+	.probe		= hideep_probe,
 };
 
 module_i2c_driver(hideep_driver);
diff --git a/drivers/input/touchscreen/himax_hx83112b.c b/drivers/input/touchscreen/himax_hx83112b.c
index e96150d80a48..4f6609dcdef3 100644
--- a/drivers/input/touchscreen/himax_hx83112b.c
+++ b/drivers/input/touchscreen/himax_hx83112b.c
@@ -349,7 +349,7 @@ MODULE_DEVICE_TABLE(of, himax_of_match);
 #endif
 
 static struct i2c_driver himax_ts_driver = {
-	.probe_new = himax_probe,
+	.probe = himax_probe,
 	.id_table = himax_ts_id,
 	.driver = {
 		.name = "Himax-hx83112b-TS",
diff --git a/drivers/input/touchscreen/hycon-hy46xx.c b/drivers/input/touchscreen/hycon-hy46xx.c
index 8f4989aba9a4..2450cfa14de9 100644
--- a/drivers/input/touchscreen/hycon-hy46xx.c
+++ b/drivers/input/touchscreen/hycon-hy46xx.c
@@ -580,7 +580,7 @@ static struct i2c_driver hycon_hy46xx_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.id_table = hycon_hy46xx_id,
-	.probe_new = hycon_hy46xx_probe,
+	.probe = hycon_hy46xx_probe,
 };
 
 module_i2c_driver(hycon_hy46xx_driver);
diff --git a/drivers/input/touchscreen/hynitron_cstxxx.c b/drivers/input/touchscreen/hynitron_cstxxx.c
index e86c85addb38..05946fee4fd4 100644
--- a/drivers/input/touchscreen/hynitron_cstxxx.c
+++ b/drivers/input/touchscreen/hynitron_cstxxx.c
@@ -488,7 +488,7 @@ static struct i2c_driver hynitron_i2c_driver = {
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
 	.id_table = hyn_tpd_id,
-	.probe_new = hyn_probe,
+	.probe = hyn_probe,
 };
 
 module_i2c_driver(hynitron_i2c_driver);
diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c
index 4897fafa4204..cf0d14062d70 100644
--- a/drivers/input/touchscreen/ili210x.c
+++ b/drivers/input/touchscreen/ili210x.c
@@ -1043,7 +1043,7 @@ static struct i2c_driver ili210x_ts_driver = {
 		.of_match_table = ili210x_dt_ids,
 	},
 	.id_table = ili210x_i2c_id,
-	.probe_new = ili210x_i2c_probe,
+	.probe = ili210x_i2c_probe,
 };
 
 module_i2c_driver(ili210x_ts_driver);
diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c
index d69809338498..2f872e95fbba 100644
--- a/drivers/input/touchscreen/ilitek_ts_i2c.c
+++ b/drivers/input/touchscreen/ilitek_ts_i2c.c
@@ -679,7 +679,7 @@ static struct i2c_driver ilitek_ts_i2c_driver = {
 		.of_match_table = of_match_ptr(ilitek_ts_i2c_match),
 		.acpi_match_table = ACPI_PTR(ilitekts_acpi_id),
 	},
-	.probe_new = ilitek_ts_i2c_probe,
+	.probe = ilitek_ts_i2c_probe,
 	.id_table = ilitek_ts_i2c_id,
 };
 module_i2c_driver(ilitek_ts_i2c_driver);
diff --git a/drivers/input/touchscreen/imagis.c b/drivers/input/touchscreen/imagis.c
index de1b16e94bb8..07111ca24455 100644
--- a/drivers/input/touchscreen/imagis.c
+++ b/drivers/input/touchscreen/imagis.c
@@ -357,7 +357,7 @@ static struct i2c_driver imagis_ts_driver = {
 		.pm = pm_sleep_ptr(&imagis_pm_ops),
 		.of_match_table = of_match_ptr(imagis_of_match),
 	},
-	.probe_new = imagis_probe,
+	.probe = imagis_probe,
 };
 
 module_i2c_driver(imagis_ts_driver);
diff --git a/drivers/input/touchscreen/iqs5xx.c b/drivers/input/touchscreen/iqs5xx.c
index c73e9c5c0077..0aa9d6492df8 100644
--- a/drivers/input/touchscreen/iqs5xx.c
+++ b/drivers/input/touchscreen/iqs5xx.c
@@ -1093,7 +1093,7 @@ static struct i2c_driver iqs5xx_i2c_driver = {
 		.pm		= pm_sleep_ptr(&iqs5xx_pm),
 	},
 	.id_table	= iqs5xx_id,
-	.probe_new	= iqs5xx_probe,
+	.probe		= iqs5xx_probe,
 };
 module_i2c_driver(iqs5xx_i2c_driver);
 
diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c
index 461023fd6a09..8be6dade118c 100644
--- a/drivers/input/touchscreen/max11801_ts.c
+++ b/drivers/input/touchscreen/max11801_ts.c
@@ -230,7 +230,7 @@ static struct i2c_driver max11801_ts_driver = {
 		.of_match_table = max11801_ts_dt_ids,
 	},
 	.id_table	= max11801_ts_id,
-	.probe_new	= max11801_ts_probe,
+	.probe		= max11801_ts_probe,
 };
 
 module_i2c_driver(max11801_ts_driver);
diff --git a/drivers/input/touchscreen/mcs5000_ts.c b/drivers/input/touchscreen/mcs5000_ts.c
index 704e36087ca2..ac28019ba4c3 100644
--- a/drivers/input/touchscreen/mcs5000_ts.c
+++ b/drivers/input/touchscreen/mcs5000_ts.c
@@ -272,7 +272,7 @@ static const struct i2c_device_id mcs5000_ts_id[] = {
 MODULE_DEVICE_TABLE(i2c, mcs5000_ts_id);
 
 static struct i2c_driver mcs5000_ts_driver = {
-	.probe_new	= mcs5000_ts_probe,
+	.probe		= mcs5000_ts_probe,
 	.driver = {
 		.name = "mcs5000_ts",
 		.pm   = pm_sleep_ptr(&mcs5000_ts_pm),
diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c
index 89b6020a9a61..32896e5085bd 100644
--- a/drivers/input/touchscreen/melfas_mip4.c
+++ b/drivers/input/touchscreen/melfas_mip4.c
@@ -1591,7 +1591,7 @@ MODULE_DEVICE_TABLE(i2c, mip4_i2c_ids);
 
 static struct i2c_driver mip4_driver = {
 	.id_table = mip4_i2c_ids,
-	.probe_new = mip4_probe,
+	.probe = mip4_probe,
 	.driver = {
 		.name = MIP4_DEVICE_NAME,
 		.of_match_table = of_match_ptr(mip4_of_match),
diff --git a/drivers/input/touchscreen/migor_ts.c b/drivers/input/touchscreen/migor_ts.c
index 69fcc88d4f80..2384ea69a3f8 100644
--- a/drivers/input/touchscreen/migor_ts.c
+++ b/drivers/input/touchscreen/migor_ts.c
@@ -221,7 +221,7 @@ static struct i2c_driver migor_ts_driver = {
 		.name = "migor_ts",
 		.pm = pm_sleep_ptr(&migor_ts_pm),
 	},
-	.probe_new = migor_ts_probe,
+	.probe = migor_ts_probe,
 	.remove = migor_ts_remove,
 	.id_table = migor_ts_id,
 };
diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c
index 4dbca1aad89d..ac12494c7930 100644
--- a/drivers/input/touchscreen/mms114.c
+++ b/drivers/input/touchscreen/mms114.c
@@ -638,7 +638,7 @@ static struct i2c_driver mms114_driver = {
 		.pm	= pm_sleep_ptr(&mms114_pm_ops),
 		.of_match_table = of_match_ptr(mms114_dt_match),
 	},
-	.probe_new	= mms114_probe,
+	.probe		= mms114_probe,
 	.id_table	= mms114_id,
 };
 
diff --git a/drivers/input/touchscreen/msg2638.c b/drivers/input/touchscreen/msg2638.c
index b23db689d995..a38af3fee34a 100644
--- a/drivers/input/touchscreen/msg2638.c
+++ b/drivers/input/touchscreen/msg2638.c
@@ -492,7 +492,7 @@ static const struct of_device_id msg2638_of_match[] = {
 MODULE_DEVICE_TABLE(of, msg2638_of_match);
 
 static struct i2c_driver msg2638_ts_driver = {
-	.probe_new = msg2638_ts_probe,
+	.probe = msg2638_ts_probe,
 	.driver = {
 		.name = "MStar-TS",
 		.pm = pm_sleep_ptr(&msg2638_pm_ops),
diff --git a/drivers/input/touchscreen/novatek-nvt-ts.c b/drivers/input/touchscreen/novatek-nvt-ts.c
index 3e551f9d31d7..7f7d879aac6d 100644
--- a/drivers/input/touchscreen/novatek-nvt-ts.c
+++ b/drivers/input/touchscreen/novatek-nvt-ts.c
@@ -290,7 +290,7 @@ static struct i2c_driver nvt_ts_driver = {
 		.name	= "novatek-nvt-ts",
 		.pm	= pm_sleep_ptr(&nvt_ts_pm_ops),
 	},
-	.probe_new = nvt_ts_probe,
+	.probe = nvt_ts_probe,
 	.id_table = nvt_ts_i2c_id,
 };
 
diff --git a/drivers/input/touchscreen/pixcir_i2c_ts.c b/drivers/input/touchscreen/pixcir_i2c_ts.c
index f09f4831bad4..554e179c2e48 100644
--- a/drivers/input/touchscreen/pixcir_i2c_ts.c
+++ b/drivers/input/touchscreen/pixcir_i2c_ts.c
@@ -617,7 +617,7 @@ static struct i2c_driver pixcir_i2c_ts_driver = {
 		.pm	= pm_sleep_ptr(&pixcir_dev_pm_ops),
 		.of_match_table = of_match_ptr(pixcir_of_match),
 	},
-	.probe_new	= pixcir_i2c_ts_probe,
+	.probe		= pixcir_i2c_ts_probe,
 	.id_table	= pixcir_i2c_ts_id,
 };
 
diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c
index 49a06d3876cf..76e7d62d5870 100644
--- a/drivers/input/touchscreen/raydium_i2c_ts.c
+++ b/drivers/input/touchscreen/raydium_i2c_ts.c
@@ -1273,7 +1273,7 @@ MODULE_DEVICE_TABLE(of, raydium_of_match);
 #endif
 
 static struct i2c_driver raydium_i2c_driver = {
-	.probe_new = raydium_i2c_probe,
+	.probe = raydium_i2c_probe,
 	.id_table = raydium_i2c_id,
 	.driver = {
 		.name = "raydium_ts",
diff --git a/drivers/input/touchscreen/rohm_bu21023.c b/drivers/input/touchscreen/rohm_bu21023.c
index 833422e5fd6d..240424f06b98 100644
--- a/drivers/input/touchscreen/rohm_bu21023.c
+++ b/drivers/input/touchscreen/rohm_bu21023.c
@@ -1183,7 +1183,7 @@ static struct i2c_driver rohm_bu21023_i2c_driver = {
 	.driver = {
 		.name = BU21023_NAME,
 	},
-	.probe_new = rohm_bu21023_i2c_probe,
+	.probe = rohm_bu21023_i2c_probe,
 	.id_table = rohm_bu21023_i2c_id,
 };
 module_i2c_driver(rohm_bu21023_i2c_driver);
diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c
index 371cf4848ad5..998d99d18911 100644
--- a/drivers/input/touchscreen/s6sy761.c
+++ b/drivers/input/touchscreen/s6sy761.c
@@ -538,7 +538,7 @@ static struct i2c_driver s6sy761_driver = {
 		.of_match_table = of_match_ptr(s6sy761_of_match),
 		.pm = pm_ptr(&s6sy761_pm_ops),
 	},
-	.probe_new = s6sy761_probe,
+	.probe = s6sy761_probe,
 	.remove = s6sy761_remove,
 	.id_table = s6sy761_id,
 };
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
index a37fac089010..9e28f962e059 100644
--- a/drivers/input/touchscreen/silead.c
+++ b/drivers/input/touchscreen/silead.c
@@ -826,7 +826,7 @@ MODULE_DEVICE_TABLE(of, silead_ts_of_match);
 #endif
 
 static struct i2c_driver silead_ts_driver = {
-	.probe_new = silead_ts_probe,
+	.probe = silead_ts_probe,
 	.id_table = silead_ts_id,
 	.driver = {
 		.name = SILEAD_TS_NAME,
diff --git a/drivers/input/touchscreen/sis_i2c.c b/drivers/input/touchscreen/sis_i2c.c
index 5a493b15b25d..426564d0fc39 100644
--- a/drivers/input/touchscreen/sis_i2c.c
+++ b/drivers/input/touchscreen/sis_i2c.c
@@ -393,7 +393,7 @@ static struct i2c_driver sis_ts_driver = {
 		.name	= SIS_I2C_NAME,
 		.of_match_table = of_match_ptr(sis_ts_dt_ids),
 	},
-	.probe_new	= sis_ts_probe,
+	.probe		= sis_ts_probe,
 	.id_table	= sis_ts_id,
 };
 module_i2c_driver(sis_ts_driver);
diff --git a/drivers/input/touchscreen/st1232.c b/drivers/input/touchscreen/st1232.c
index f49566dc96f8..6475084aee1b 100644
--- a/drivers/input/touchscreen/st1232.c
+++ b/drivers/input/touchscreen/st1232.c
@@ -384,7 +384,7 @@ static const struct of_device_id st1232_ts_dt_ids[] = {
 MODULE_DEVICE_TABLE(of, st1232_ts_dt_ids);
 
 static struct i2c_driver st1232_ts_driver = {
-	.probe_new	= st1232_ts_probe,
+	.probe		= st1232_ts_probe,
 	.id_table	= st1232_ts_id,
 	.driver = {
 		.name	= ST1232_TS_NAME,
diff --git a/drivers/input/touchscreen/stmfts.c b/drivers/input/touchscreen/stmfts.c
index fdbf5e68943c..56e371fd88fa 100644
--- a/drivers/input/touchscreen/stmfts.c
+++ b/drivers/input/touchscreen/stmfts.c
@@ -808,7 +808,7 @@ static struct i2c_driver stmfts_driver = {
 		.pm = pm_ptr(&stmfts_pm_ops),
 		.probe_type = PROBE_PREFER_ASYNCHRONOUS,
 	},
-	.probe_new = stmfts_probe,
+	.probe = stmfts_probe,
 	.remove = stmfts_remove,
 	.id_table = stmfts_id,
 };
diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c
index 52ae73035830..0293c493bc79 100644
--- a/drivers/input/touchscreen/sx8654.c
+++ b/drivers/input/touchscreen/sx8654.c
@@ -470,7 +470,7 @@ static struct i2c_driver sx8654_driver = {
 		.of_match_table = of_match_ptr(sx8654_of_match),
 	},
 	.id_table = sx8654_id_table,
-	.probe_new = sx8654_probe,
+	.probe = sx8654_probe,
 };
 module_i2c_driver(sx8654_driver);
 
diff --git a/drivers/input/touchscreen/tsc2004.c b/drivers/input/touchscreen/tsc2004.c
index 45f39eb20638..b5e904c5b7c4 100644
--- a/drivers/input/touchscreen/tsc2004.c
+++ b/drivers/input/touchscreen/tsc2004.c
@@ -68,7 +68,7 @@ static struct i2c_driver tsc2004_driver = {
 		.pm     = pm_sleep_ptr(&tsc200x_pm_ops),
 	},
 	.id_table       = tsc2004_idtable,
-	.probe_new      = tsc2004_probe,
+	.probe          = tsc2004_probe,
 	.remove         = tsc2004_remove,
 };
 module_i2c_driver(tsc2004_driver);
diff --git a/drivers/input/touchscreen/tsc2007_core.c b/drivers/input/touchscreen/tsc2007_core.c
index 21916a30fb76..b3655250d4a7 100644
--- a/drivers/input/touchscreen/tsc2007_core.c
+++ b/drivers/input/touchscreen/tsc2007_core.c
@@ -418,7 +418,7 @@ static struct i2c_driver tsc2007_driver = {
 		.of_match_table = tsc2007_of_match,
 	},
 	.id_table	= tsc2007_idtable,
-	.probe_new	= tsc2007_probe,
+	.probe		= tsc2007_probe,
 };
 
 module_i2c_driver(tsc2007_driver);
diff --git a/drivers/input/touchscreen/wacom_i2c.c b/drivers/input/touchscreen/wacom_i2c.c
index a145b9105255..f389f9c004a9 100644
--- a/drivers/input/touchscreen/wacom_i2c.c
+++ b/drivers/input/touchscreen/wacom_i2c.c
@@ -264,7 +264,7 @@ static struct i2c_driver wacom_i2c_driver = {
 		.pm	= pm_sleep_ptr(&wacom_i2c_pm),
 	},
 
-	.probe_new	= wacom_i2c_probe,
+	.probe		= wacom_i2c_probe,
 	.id_table	= wacom_i2c_id,
 };
 module_i2c_driver(wacom_i2c_driver);
diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c
index 771962af3d0a..cbc4750c53f9 100644
--- a/drivers/input/touchscreen/wdt87xx_i2c.c
+++ b/drivers/input/touchscreen/wdt87xx_i2c.c
@@ -1169,7 +1169,7 @@ static const struct acpi_device_id wdt87xx_acpi_id[] = {
 MODULE_DEVICE_TABLE(acpi, wdt87xx_acpi_id);
 
 static struct i2c_driver wdt87xx_driver = {
-	.probe_new	= wdt87xx_ts_probe,
+	.probe		= wdt87xx_ts_probe,
 	.id_table	= wdt87xx_dev_id,
 	.driver	= {
 		.name	= WDT87XX_NAME,
diff --git a/drivers/input/touchscreen/zet6223.c b/drivers/input/touchscreen/zet6223.c
index bfa0c637d569..1a034471f103 100644
--- a/drivers/input/touchscreen/zet6223.c
+++ b/drivers/input/touchscreen/zet6223.c
@@ -248,7 +248,7 @@ static struct i2c_driver zet6223_driver = {
 		.name = "zet6223",
 		.of_match_table = zet6223_of_match,
 	},
-	.probe_new = zet6223_probe,
+	.probe = zet6223_probe,
 	.id_table = zet6223_id
 };
 module_i2c_driver(zet6223_driver);
diff --git a/drivers/input/touchscreen/zforce_ts.c b/drivers/input/touchscreen/zforce_ts.c
index 76b194285e1c..5be5112845e1 100644
--- a/drivers/input/touchscreen/zforce_ts.c
+++ b/drivers/input/touchscreen/zforce_ts.c
@@ -944,7 +944,7 @@ static struct i2c_driver zforce_driver = {
 		.pm	= pm_sleep_ptr(&zforce_pm_ops),
 		.of_match_table	= of_match_ptr(zforce_dt_idtable),
 	},
-	.probe_new	= zforce_probe,
+	.probe		= zforce_probe,
 	.id_table	= zforce_idtable,
 };
 
diff --git a/drivers/input/touchscreen/zinitix.c b/drivers/input/touchscreen/zinitix.c
index b6ece47151b8..1b4807ba4624 100644
--- a/drivers/input/touchscreen/zinitix.c
+++ b/drivers/input/touchscreen/zinitix.c
@@ -617,7 +617,7 @@ MODULE_DEVICE_TABLE(of, zinitix_of_match);
 #endif
 
 static struct i2c_driver zinitix_ts_driver = {
-	.probe_new = zinitix_ts_probe,
+	.probe = zinitix_ts_probe,
 	.driver = {
 		.name = "Zinitix-TS",
 		.pm = pm_sleep_ptr(&zinitix_pm_ops),

base-commit: ac9a78681b921877518763ba0e89202254349d1b
-- 
2.39.2


^ permalink raw reply related

* Re: [BUG][NEW DATA] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2
From: Mirsad Goran Todorovac @ 2023-05-17 16:10 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mirsad Goran Todorovac, linux-usb, linux-kernel, linux-input,
	Benjamin Tissoires, Jiri Kosina
In-Reply-To: <2023051607-sturdy-jiffy-ca99@gregkh>

On 5/16/23 16:36, Greg Kroah-Hartman wrote:
> On Fri, May 12, 2023 at 11:33:31PM +0200, Mirsad Goran Todorovac wrote:
>> Hi,
>>
>> On 5/9/23 04:59, Greg Kroah-Hartman wrote:
>>> On Tue, May 09, 2023 at 01:51:35AM +0200, Mirsad Goran Todorovac wrote:
>>>>
>>>>
>>>> On 08. 05. 2023. 16:01, Greg Kroah-Hartman wrote:
>>>>> On Mon, May 08, 2023 at 08:51:55AM +0200, Greg Kroah-Hartman wrote:
>>>>>> On Mon, May 08, 2023 at 08:30:07AM +0200, Mirsad Goran Todorovac wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> There seems to be a kernel memory leak in the USB keyboard driver.
>>>>>>>
>>>>>>> The leaked memory allocs are 96 and 512 bytes.
>>>>>>>
>>>>>>> The platform is Ubuntu 22.04 LTS on a assembled AMD Ryzen 9 with X670E PG
>>>>>>> Lightning mobo,
>>>>>>> and Genius SlimStar i220 GK-080012 keyboard.
>>>>>>>
>>>>>>> (Logitech M100 HID mouse is not affected by the bug.)
>>>>>>>
>>>>>>> BIOS is:
>>>>>>>
>>>>>>>         *-firmware
>>>>>>>              description: BIOS
>>>>>>>              vendor: American Megatrends International, LLC.
>>>>>>>              physical id: 0
>>>>>>>              version: 1.21
>>>>>>>              date: 04/26/2023
>>>>>>>              size: 64KiB
>>>>>>>
>>>>>>> The kernel is 6.3.0-torvalds-<id>-13466-gfc4354c6e5c2.
>>>>>>>
>>>>>>> The keyboard is recognised as Chicony:
>>>>>>>
>>>>>>>                     *-usb
>>>>>>>                          description: Keyboard
>>>>>>>                          product: CHICONY USB Keyboard
>>>>>>>                          vendor: CHICONY
>>>>>>>                          physical id: 2
>>>>>>>                          bus info: usb@5:2
>>>>>>>                          logical name: input35
>>>>>>>                          logical name: /dev/input/event4
>>>>>>>                          logical name: input35::capslock
>>>>>>>                          logical name: input35::numlock
>>>>>>>                          logical name: input35::scrolllock
>>>>>>>                          logical name: input36
>>>>>>>                          logical name: /dev/input/event5
>>>>>>>                          logical name: input37
>>>>>>>                          logical name: /dev/input/event6
>>>>>>>                          logical name: input38
>>>>>>>                          logical name: /dev/input/event8
>>>>>>>                          version: 2.30
>>>>>>>                          capabilities: usb-2.00 usb
>>>>>>>                          configuration: driver=usbhid maxpower=100mA
>>>>>>> speed=1Mbit/s
>>>>>>>
>>>>>>> The bug is easily reproduced by unplugging the USB keyboard, waiting about a
>>>>>>> couple of seconds,
>>>>>>> and then reconnect and scan for memory leaks twice.
>>>>>>>
>>>>>>> The kmemleak log is as follows [edited privacy info]:
>>>>>>>
>>>>>>> root@hostname:/home/username# cat /sys/kernel/debug/kmemleak
>>>>>>> unreferenced object 0xffff8dd020037c00 (size 96):
>>>>>>>      comm "systemd-udevd", pid 435, jiffies 4294892550 (age 8909.356s)
>>>>>>>      hex dump (first 32 bytes):
>>>>>>>        5d 8e 4e b9 ff ff ff ff 00 00 00 00 00 00 00 00 ].N.............
>>>>>>>        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
>>>>>>>      backtrace:
>>>>>>>        [<ffffffffb81a74be>] __kmem_cache_alloc_node+0x22e/0x2b0
>>>>>>>        [<ffffffffb8127b6e>] kmalloc_trace+0x2e/0xa0
>>>>>>>        [<ffffffffb87543d9>] class_create+0x29/0x80
>>>>>>>        [<ffffffffb8880d24>] usb_register_dev+0x1d4/0x2e0
>>>>>>
>>>>>> As the call to class_create() in this path is now gone in 6.4-rc1, can
>>>>>> you retry that release to see if this is still there or not?
>>>>>
>>>>> No, wait, it's still there, I was looking at a development branch of
>>>>> mine that isn't sent upstream yet.  And syzbot just reported the same
>>>>> thing:
>>>>> 	https://lore.kernel.org/r/00000000000058d15f05fb264013@google.com
>>>>>
>>>>> So something's wrong here, let me dig into it tomorrow when I get a
>>>>> chance...
>>>>
>>>> If this could help, here is the bisect of the bug (I could not discern what
>>>> could possibly be wrong):
>>>>
>>>> user@host:~/linux/kernel/linux_torvalds$ git bisect log
>>>> git bisect start
>>>> # bad: [ac9a78681b921877518763ba0e89202254349d1b] Linux 6.4-rc1
>>>> git bisect bad ac9a78681b921877518763ba0e89202254349d1b
>>>> # good: [c9c3395d5e3dcc6daee66c6908354d47bf98cb0c] Linux 6.2
>>>> git bisect good c9c3395d5e3dcc6daee66c6908354d47bf98cb0c
>>>> # good: [85496c9b3bf8dbe15e2433d3a0197954d323cadc] Merge branch
>>>> 'net-remove-some-rcu_bh-cruft'
>>>> git bisect good 85496c9b3bf8dbe15e2433d3a0197954d323cadc
>>>> # good: [b68ee1c6131c540a62ecd443be89c406401df091] Merge tag 'scsi-misc' of
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
>>>> git bisect good b68ee1c6131c540a62ecd443be89c406401df091
>>>> # bad: [888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0] Merge tag 'sysctl-6.4-rc1'
>>>> of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux
>>>> git bisect bad 888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0
>>>> # good: [34b62f186db9614e55d021f8c58d22fc44c57911] Merge tag
>>>> 'pci-v6.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
>>>> git bisect good 34b62f186db9614e55d021f8c58d22fc44c57911
>>>> # good: [34da76dca4673ab1819830b4924bb5b436325b26] Merge tag
>>>> 'for-linus-2023042601' of
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
>>>> git bisect good 34da76dca4673ab1819830b4924bb5b436325b26
>>>> # good: [97b2ff294381d05e59294a931c4db55276470cb5] Merge tag
>>>> 'staging-6.4-rc1' of
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
>>>> git bisect good 97b2ff294381d05e59294a931c4db55276470cb5
>>>> # good: [2025b2ca8004c04861903d076c67a73a0ec6dfca] mcb-lpc: Reallocate
>>>> memory region to avoid memory overlapping
>>>> git bisect good 2025b2ca8004c04861903d076c67a73a0ec6dfca
>>>> # bad: [d06f5a3f7140921ada47d49574ae6fa4de5e2a89] cdx: fix build failure due
>>>> to sysfs 'bus_type' argument needing to be const
>>>> git bisect bad d06f5a3f7140921ada47d49574ae6fa4de5e2a89
>>>> # good: [dcfbb67e48a2becfce7990386e985b9c45098ee5] driver core: class: use
>>>> lock_class_key already present in struct subsys_private
>>>> git bisect good dcfbb67e48a2becfce7990386e985b9c45098ee5
>>>> # bad: [6f14c02220c791d5c46b0f965b9340c58f3d503d] driver core: create
>>>> class_is_registered()
>>>> git bisect bad 6f14c02220c791d5c46b0f965b9340c58f3d503d
>>>> # good: [2f9e87f5a2941b259336c7ea6c5a1499ede4554a] driver core: Add a
>>>> comment to set_primary_fwnode() on nullifying
>>>> git bisect good 2f9e87f5a2941b259336c7ea6c5a1499ede4554a
>>>> # bad: [02fe26f25325b547b7a31a65deb0326c04bb5174] firmware_loader: Add debug
>>>> message with checksum for FW file
>>>> git bisect bad 02fe26f25325b547b7a31a65deb0326c04bb5174
>>>> # good: [884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82] driver core: class:
>>>> implement class_get/put without the private pointer.
>>>> git bisect good 884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82
>>>> # bad: [3f84aa5ec052dba960baca4ab8a352d43d47028e] base: soc: populate
>>>> machine name in soc_device_register if empty
>>>> git bisect bad 3f84aa5ec052dba960baca4ab8a352d43d47028e
>>>> # bad: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core: class.c:
>>>> convert to only use class_to_subsys
>>>> git bisect bad 7b884b7f24b42fa25e92ed724ad82f137610afaf
>>>> # first bad commit: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core:
>>>> class.c: convert to only use class_to_subsys
>>>> user@host:~/linux/kernel/linux_torvalds$
>>>
>>> This helps a lot, thanks.  I got the reference counting wrong somewhere
>>> in here, I thought I tested this better, odd it shows up now...
>>>
>>> I'll try to work on it this week.
>>
>> I have figured out that the leak occurs on keyboard unplugging only, one
>> or two leaks (maybe a race condition?).
>>
>> Please NOTE that the number of leaks is now odd:
>>
>> root@defiant:/home/marvin# cat /sys/kernel/debug/kmemleak | grep comm
>>    comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
>>    comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
>>    comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.224s)
>>    comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.272s)
>>    comm "kworker/6:3", pid 3046, jiffies 4294935362 (age 544.780s)
>>    comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.740s)
>>    comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.784s)
>> root@defiant:/home/marvin#
>>
>> At one time unplugging keyboard generated only one leak, but only at one
>> time. As it requires manually unplugging keyboard, I didn't seem to find a
>> way to automate it, but it doesn't seem to require root access.
>>
>> BTW, I've seen in syzbot output that kmemleak output has debug source file
>> names and line numbers. I couldn't make that work with the dbg .deb.
>>
>> I will do some more homework, but this was a rough week.
> 
> I made up a patch based on code inspection alone, as I couldn't
> reproduce this locally at all:
> 	https://lore.kernel.org/r/2023051628-thumb-boaster-5680@gregkh
> and it seemed to pass syzbot's tests.
> 
> I've included it here below, can you test it as well?
> 
> Hm, I only tested with a USB mouse unplug/plug cycle, maybe the issue is
> a keyboard?
> 
> thanks,
> 
> greg k-h
> 
> -------------
> 
> diff --git a/drivers/base/class.c b/drivers/base/class.c
> index ac1808d1a2e8..9b44edc8416f 100644
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -320,6 +322,7 @@ void class_dev_iter_init(struct class_dev_iter *iter, const struct class *class,
>   		start_knode = &start->p->knode_class;
>   	klist_iter_init_node(&sp->klist_devices, &iter->ki, start_knode);
>   	iter->type = type;
> +	iter->sp = sp;
>   }
>   EXPORT_SYMBOL_GPL(class_dev_iter_init);
>   
> @@ -361,6 +364,7 @@ EXPORT_SYMBOL_GPL(class_dev_iter_next);
>   void class_dev_iter_exit(struct class_dev_iter *iter)
>   {
>   	klist_iter_exit(&iter->ki);
> +	subsys_put(iter->sp);
>   }
>   EXPORT_SYMBOL_GPL(class_dev_iter_exit);
>   
> diff --git a/include/linux/device/class.h b/include/linux/device/class.h
> index 9deeaeb457bb..abf3d3bfb6fe 100644
> --- a/include/linux/device/class.h
> +++ b/include/linux/device/class.h
> @@ -74,6 +74,7 @@ struct class {
>   struct class_dev_iter {
>   	struct klist_iter		ki;
>   	const struct device_type	*type;
> +	struct subsys_private		*sp;
>   };
>   
>   int __must_check class_register(const struct class *class);

The build with the latest 6.4-rc2 and without this patch still leaked,
the build with the same commit and this patch applied was successful:

root@defiant:/home/marvin# cat /sys/kernel/debug/kmemleak
root@defiant:/home/marvin#

Tried three times, and it is a OK.

Congratulations! This had fixed the leak.

I wonder why it didn't show in the other contexts, hardware and archs?

Best regards,
Mirsad

^ permalink raw reply

* [PATCH v2] Input: tests: add test to cover all input_grab_device() function
From: Dana Elfassy @ 2023-05-17 15:31 UTC (permalink / raw)
  To: eballetb, dmitry.torokhov, javierm, linux-input, linux-kernel
  Cc: Dana Elfassy

Currently input_grab_device() isn't covered by any tests
Thus, adding a test to cover the cases:
1. The device is grabbed successfully
2. Trying to grab a device that is already grabbed by another input
   handle

Signed-off-by: Dana Elfassy <dangel101@gmail.com>
Tested-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
---

Changes in v2:
- Use input_put_device() to decrement the refcount increased by get().
- Remove unnecessary struct input_handle test_handle variable.

 drivers/input/tests/input_test.c | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/drivers/input/tests/input_test.c b/drivers/input/tests/input_test.c
index 25bbf51b5c87..cea0167a74d2 100644
--- a/drivers/input/tests/input_test.c
+++ b/drivers/input/tests/input_test.c
@@ -124,10 +124,33 @@ static void input_test_match_device_id(struct kunit *test)
 	KUNIT_ASSERT_FALSE(test, input_match_device_id(input_dev, &id));
 }
 
+static void input_test_grab(struct kunit *test)
+{
+	struct input_dev *input_dev = test->priv;
+	struct input_handler handler;
+	struct input_handle handle;
+	struct input_device_id id;
+	int res;
+
+	handler.name = "handler";
+	handler.id_table = &id;
+
+	handle.dev = input_get_device(input_dev);
+	handle.name = dev_name(&input_dev->dev);
+	handle.handler = &handler;
+	res = input_grab_device(&handle);
+	KUNIT_ASSERT_TRUE(test, input_grab_device(&handle));
+
+	res = input_grab_device(&handle);
+	KUNIT_ASSERT_EQ(test, res, -EBUSY);
+	input_put_device(input_dev);
+}
+
 static struct kunit_case input_tests[] = {
 	KUNIT_CASE(input_test_polling),
 	KUNIT_CASE(input_test_timestamp),
 	KUNIT_CASE(input_test_match_device_id),
+	KUNIT_CASE(input_test_grab),
 	{ /* sentinel */ }
 };
 
-- 
2.40.1


^ permalink raw reply related

* Re: [regression] Since kernel 6.3.1 logitech unify receiver not working properly
From: Bagas Sanjaya @ 2023-05-17 13:17 UTC (permalink / raw)
  To: Linux regressions mailing list, Filipe Laíns, Bastien Nocera,
	Jiri Kosina, Benjamin Tissoires
  Cc: Linux Input Devices, LKML, guy.b, poncho, Bastien Nocera
In-Reply-To: <bec024d5-4088-00ae-f7b5-7188868b1707@leemhuis.info>

[-- Attachment #1: Type: text/plain, Size: 1350 bytes --]

On Thu, May 11, 2023 at 01:58:43PM +0200, Thorsten Leemhuis wrote:
> Hi, Thorsten here, the Linux kernel's regression tracker.
> 
> On 08.05.23 11:55, Linux regression tracking (Thorsten Leemhuis) wrote:
> > Hi, Thorsten here, the Linux kernel's regression tracker.
> > 
> > I noticed a regression report in bugzilla.kernel.org. As many (most?)
> > kernel developers don't keep an eye on it, I decided to forward it by mail.
> > 
> > Quoting from https://bugzilla.kernel.org/show_bug.cgi?id=217412 :
> 
> TWIMC: a few other users (three or four iirc) showed up in that ticket
> and reported problems with the receiver, albeit the symptoms are not
> exactly the same for all of them, so there might be more than one problem.
> 
> I'll try to motivate the affected users to perform a bisection. But
> would be great if those with more knowledge about this code could
> briefly look into the ticket, maybe the details the users shared allows
> one of you to guess what causes this.

Hi Thorsten,

Another reporter in the same bug ticket has already pinned down the
culprit to 586e8fede7953b ("HID: logitech-hidpp: Retry commands when device
is busy"). I'm now updating regzbot entry (and Cc'ing the culprit author):

#regzbot introduced: 586e8fede7953b

Thanks.

-- 
An old man doll... just what I always wanted! - Clara

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* Re: [PATCH v2 2/4] dt-bindings: touchscreen: add virtual-touchscreen and virtual-buttons properties
From: Javier Carrasco @ 2023-05-17  9:13 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Dmitry Torokhov, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Henrik Rydberg, Bastian Hecht,
	Michael Riesch
  Cc: linux-kernel, linux-input, devicetree
In-Reply-To: <ac6d8bcb-b16b-6c50-a9b6-975560059bdc@linaro.org>



On 17.05.23 10:59, Krzysztof Kozlowski wrote:
> On 16/05/2023 11:03, Javier Carrasco wrote:
>> On 16.05.23 10:13, Krzysztof Kozlowski wrote:
>>> On 16/05/2023 10:10, Krzysztof Kozlowski wrote:
>>>> On 15/05/2023 17:00, Javier Carrasco wrote:
>>>>> The virtual-touchscreen object defines an area within the touchscreen
>>>>> where touch events are reported and their coordinates get converted to
>>>>> the virtual origin. This object avoids getting events from areas that
>>>>> are physically hidden by overlay frames.
>>>>>
>>>>> For touchscreens where overlay buttons on the touchscreen surface are
>>>>> provided, the virtual-buttons object contains a node for every button
>>>>> and the key event that should be reported when pressed.
>>>>>
>>>>> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
>>>>> ---
>>>>
>>>>
>>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>>
>>> Apologies, second thoughts - why calling all this binding and properties
>>> "virtual"? That's the word which immediately raises questions, because
>>> bindings are only for real things, not virtual.
>>>
>>> Touchscreen is just clipped, not virtual, so maybe "clipped-area"
>>> instead of virtual-touchscreen? Buttons are real, so maybe just "buttons"?
>>>
>>> Best regards,
>>> Krzysztof
>>>
>> I guess it is a matter of perspective. For a user the buttons and the
>> clipped area are 100% real, but for a driver developer they are virtual
>> in the sense that there is not an "active" hardware behind apart from
>> the original touchscreen.
> 
> 
> The feature describes the hardware, not driver. To understand what does
> it mean, look from hardware point of view - does it have some virtual
> area or clipped area?
> 
>>
>> I just wanted to avoid misunderstandings when implementing this feature
>> for other drivers. One might wonder if the touchscreen now has
>> mechanical keys attached to it. With the "virtual-" prefix it is clear
>> that the objects are not additional pieces of hardware or extensions of
>> the touchscreen functionality.
> 
> But what if actual physical buttons are added there? You still would
> have clipped/virtual area, just without virtual buttons.
> 
>>
>> For the virtual-touchscreen your point is stronger because there is
>> indeed a real touchscreen hardware no matter the area you define, but my
>> approach was keeping homogeneous names for the different objects in case
>> some new ones might appear in the future: every object that gets on top
>> of the touchscreen area is virtual, so add a new object type and name it
>> virtual-xxx.
> 
> To me, word "virtual" suggests something which does not exist. Kind of
> something abstracted or symbolic. Opposite to "real". Here all this
> really exists. You have physical stickers on the touchscreen.
> 
> Maybe this should be then "dedicated"? or "isolated"?
> 
> Or just "overlay-area"?
> 
>>
>> I have nothing against about doing some renaming and I will do it if it
>> is required, but with the documentation I think it is now more clear
>> what everything means and in the end it might make more sense for the
>> drivers so they can differentiate between real and virtual devices.
> 
> Best regards,
> Krzysztof
> 
I think the word "overlay" is more precise and does not lead to any
misunderstanding, so I will rename everything to xxx-overlay and
overlay-xxx in the code and the documentation if that is ok.
virtual-buttons -> overlay-buttons
ts_virtobj_xxx()->ts_overlay_xxx()
etc.

^ permalink raw reply

* Re: [PATCH v2 2/4] dt-bindings: touchscreen: add virtual-touchscreen and virtual-buttons properties
From: Krzysztof Kozlowski @ 2023-05-17  8:59 UTC (permalink / raw)
  To: Javier Carrasco, Dmitry Torokhov, Rob Herring,
	Krzysztof Kozlowski, Conor Dooley, Henrik Rydberg, Bastian Hecht,
	Michael Riesch
  Cc: linux-kernel, linux-input, devicetree
In-Reply-To: <d32e46aa-af50-ad60-7679-5c235487039e@wolfvision.net>

On 16/05/2023 11:03, Javier Carrasco wrote:
> On 16.05.23 10:13, Krzysztof Kozlowski wrote:
>> On 16/05/2023 10:10, Krzysztof Kozlowski wrote:
>>> On 15/05/2023 17:00, Javier Carrasco wrote:
>>>> The virtual-touchscreen object defines an area within the touchscreen
>>>> where touch events are reported and their coordinates get converted to
>>>> the virtual origin. This object avoids getting events from areas that
>>>> are physically hidden by overlay frames.
>>>>
>>>> For touchscreens where overlay buttons on the touchscreen surface are
>>>> provided, the virtual-buttons object contains a node for every button
>>>> and the key event that should be reported when pressed.
>>>>
>>>> Signed-off-by: Javier Carrasco <javier.carrasco@wolfvision.net>
>>>> ---
>>>
>>>
>>> Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
>>
>> Apologies, second thoughts - why calling all this binding and properties
>> "virtual"? That's the word which immediately raises questions, because
>> bindings are only for real things, not virtual.
>>
>> Touchscreen is just clipped, not virtual, so maybe "clipped-area"
>> instead of virtual-touchscreen? Buttons are real, so maybe just "buttons"?
>>
>> Best regards,
>> Krzysztof
>>
> I guess it is a matter of perspective. For a user the buttons and the
> clipped area are 100% real, but for a driver developer they are virtual
> in the sense that there is not an "active" hardware behind apart from
> the original touchscreen.


The feature describes the hardware, not driver. To understand what does
it mean, look from hardware point of view - does it have some virtual
area or clipped area?

> 
> I just wanted to avoid misunderstandings when implementing this feature
> for other drivers. One might wonder if the touchscreen now has
> mechanical keys attached to it. With the "virtual-" prefix it is clear
> that the objects are not additional pieces of hardware or extensions of
> the touchscreen functionality.

But what if actual physical buttons are added there? You still would
have clipped/virtual area, just without virtual buttons.

> 
> For the virtual-touchscreen your point is stronger because there is
> indeed a real touchscreen hardware no matter the area you define, but my
> approach was keeping homogeneous names for the different objects in case
> some new ones might appear in the future: every object that gets on top
> of the touchscreen area is virtual, so add a new object type and name it
> virtual-xxx.

To me, word "virtual" suggests something which does not exist. Kind of
something abstracted or symbolic. Opposite to "real". Here all this
really exists. You have physical stickers on the touchscreen.

Maybe this should be then "dedicated"? or "isolated"?

Or just "overlay-area"?

> 
> I have nothing against about doing some renaming and I will do it if it
> is required, but with the documentation I think it is now more clear
> what everything means and in the end it might make more sense for the
> drivers so they can differentiate between real and virtual devices.

Best regards,
Krzysztof


^ permalink raw reply

* Re: [PATCH] Input: tests: add test to cover all input_grab_device() function
From: Javier Martinez Canillas @ 2023-05-17  8:23 UTC (permalink / raw)
  To: Dana Elfassy, eballetb, dmitry.torokhov, linux-input,
	linux-kernel
  Cc: Dana Elfassy
In-Reply-To: <20230516162412.461066-1-dangel101@gmail.com>

Dana Elfassy <delfassy@redhat.com> writes:

Hello Dana,

Is great to see more input Kunit tests being added, thanks!

> Currently input_grab_device() isn't covered by any tests
> Thus, adding a test to cover the cases:
> 1. The device is grabbed successfully
> 2. Trying to grab a device that is already grabbed by another input
>    handle
>
> Signed-off-by: Dana Elfassy <dangel101@gmail.com>
> ---

I tested this and it worked for me:

$ ./tools/testing/kunit/kunit.py run --kunitconfig=drivers/input/tests/.kunitconfig
...
[09:36:42] Starting KUnit Kernel (1/1)...
[09:36:42] ============================================================
[09:36:43] ================= input_core (4 subtests) ==================
[09:36:43] [PASSED] input_test_polling
[09:36:43] [PASSED] input_test_timestamp
[09:36:43] [PASSED] input_test_match_device_id
[09:36:43] [PASSED] input_test_grab
[09:36:43] =================== [PASSED] input_core ====================
[09:36:43] ============================================================
[09:36:43] Testing complete. Ran 4 tests: passed: 4
[09:36:43] Elapsed time: 129.985s total, 5.005s configuring, 124.864s building, 0.062s running

>  drivers/input/tests/input_test.c | 28 ++++++++++++++++++++++++++++
>  1 file changed, 28 insertions(+)
>
> diff --git a/drivers/input/tests/input_test.c b/drivers/input/tests/input_test.c
> index 25bbf51b5c87..cd4db365e9fa 100644
> --- a/drivers/input/tests/input_test.c
> +++ b/drivers/input/tests/input_test.c
> @@ -124,10 +124,38 @@ static void input_test_match_device_id(struct kunit *test)
>  	KUNIT_ASSERT_FALSE(test, input_match_device_id(input_dev, &id));
>  }
>  
> +
> +static void input_test_grab(struct kunit *test)
> +{
> +	struct input_dev *input_dev = test->priv;
> +	struct input_handle test_handle;
> +	struct input_handler handler;
> +	struct input_handle handle;
> +	struct input_device_id id;
> +	int res;
> +
> +	handler.name = "handler";
> +	handler.id_table = &id;
> +
> +	handle.dev = input_get_device(input_dev);
> +	handle.name = dev_name(&input_dev->dev);
> +	handle.handler = &handler;
> +	res = input_grab_device(&handle);
> +	KUNIT_ASSERT_TRUE(test, input_grab_device(&handle));
> +

I think you need to add a input_put_device(input_dev) here ?

Otherwise the reference counter won't be decremented.

> +	test_handle.dev = input_get_device(input_dev);
> +	test_handle.name = dev_name(&input_dev->dev);
> +	test_handle.handler = &handler;
> +

I think you can just reuse the handle variable that was set-up before ?

There's no need to another test_handle variable as far as I can tell.

> +	res = input_grab_device(&test_handle);
> +	KUNIT_ASSERT_EQ(test, res, -EBUSY);

And here add an input_put_device(input_dev) call too.

Other than that the patch looks good to me.

Tested-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>

-- 
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat


^ permalink raw reply

* Re: [BUG][NEW DATA] Kmemleak, possibly hiddev_connect(), in 6.3.0+ torvalds tree commit gfc4354c6e5c2
From: Mirsad Goran Todorovac @ 2023-05-17  7:24 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Mirsad Goran Todorovac, linux-usb, linux-kernel, linux-input,
	Benjamin Tissoires, Jiri Kosina
In-Reply-To: <2023051607-sturdy-jiffy-ca99@gregkh>

On 16.5.2023. 16:36, Greg Kroah-Hartman wrote:
> On Fri, May 12, 2023 at 11:33:31PM +0200, Mirsad Goran Todorovac wrote:
>> Hi,
>>
>> On 5/9/23 04:59, Greg Kroah-Hartman wrote:
>>> On Tue, May 09, 2023 at 01:51:35AM +0200, Mirsad Goran Todorovac wrote:
>>>>
>>>>
>>>> On 08. 05. 2023. 16:01, Greg Kroah-Hartman wrote:
>>>>> On Mon, May 08, 2023 at 08:51:55AM +0200, Greg Kroah-Hartman wrote:
>>>>>> On Mon, May 08, 2023 at 08:30:07AM +0200, Mirsad Goran Todorovac wrote:
>>>>>>> Hi,
>>>>>>>
>>>>>>> There seems to be a kernel memory leak in the USB keyboard driver.
>>>>>>>
>>>>>>> The leaked memory allocs are 96 and 512 bytes.
>>>>>>>
>>>>>>> The platform is Ubuntu 22.04 LTS on a assembled AMD Ryzen 9 with X670E PG
>>>>>>> Lightning mobo,
>>>>>>> and Genius SlimStar i220 GK-080012 keyboard.
>>>>>>>
>>>>>>> (Logitech M100 HID mouse is not affected by the bug.)
>>>>>>>
>>>>>>> BIOS is:
>>>>>>>
>>>>>>>         *-firmware
>>>>>>>              description: BIOS
>>>>>>>              vendor: American Megatrends International, LLC.
>>>>>>>              physical id: 0
>>>>>>>              version: 1.21
>>>>>>>              date: 04/26/2023
>>>>>>>              size: 64KiB
>>>>>>>
>>>>>>> The kernel is 6.3.0-torvalds-<id>-13466-gfc4354c6e5c2.
>>>>>>>
>>>>>>> The keyboard is recognised as Chicony:
>>>>>>>
>>>>>>>                     *-usb
>>>>>>>                          description: Keyboard
>>>>>>>                          product: CHICONY USB Keyboard
>>>>>>>                          vendor: CHICONY
>>>>>>>                          physical id: 2
>>>>>>>                          bus info: usb@5:2
>>>>>>>                          logical name: input35
>>>>>>>                          logical name: /dev/input/event4
>>>>>>>                          logical name: input35::capslock
>>>>>>>                          logical name: input35::numlock
>>>>>>>                          logical name: input35::scrolllock
>>>>>>>                          logical name: input36
>>>>>>>                          logical name: /dev/input/event5
>>>>>>>                          logical name: input37
>>>>>>>                          logical name: /dev/input/event6
>>>>>>>                          logical name: input38
>>>>>>>                          logical name: /dev/input/event8
>>>>>>>                          version: 2.30
>>>>>>>                          capabilities: usb-2.00 usb
>>>>>>>                          configuration: driver=usbhid maxpower=100mA
>>>>>>> speed=1Mbit/s
>>>>>>>
>>>>>>> The bug is easily reproduced by unplugging the USB keyboard, waiting about a
>>>>>>> couple of seconds,
>>>>>>> and then reconnect and scan for memory leaks twice.
>>>>>>>
>>>>>>> The kmemleak log is as follows [edited privacy info]:
>>>>>>>
>>>>>>> root@hostname:/home/username# cat /sys/kernel/debug/kmemleak
>>>>>>> unreferenced object 0xffff8dd020037c00 (size 96):
>>>>>>>      comm "systemd-udevd", pid 435, jiffies 4294892550 (age 8909.356s)
>>>>>>>      hex dump (first 32 bytes):
>>>>>>>        5d 8e 4e b9 ff ff ff ff 00 00 00 00 00 00 00 00 ].N.............
>>>>>>>        00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................
>>>>>>>      backtrace:
>>>>>>>        [<ffffffffb81a74be>] __kmem_cache_alloc_node+0x22e/0x2b0
>>>>>>>        [<ffffffffb8127b6e>] kmalloc_trace+0x2e/0xa0
>>>>>>>        [<ffffffffb87543d9>] class_create+0x29/0x80
>>>>>>>        [<ffffffffb8880d24>] usb_register_dev+0x1d4/0x2e0
>>>>>>
>>>>>> As the call to class_create() in this path is now gone in 6.4-rc1, can
>>>>>> you retry that release to see if this is still there or not?
>>>>>
>>>>> No, wait, it's still there, I was looking at a development branch of
>>>>> mine that isn't sent upstream yet.  And syzbot just reported the same
>>>>> thing:
>>>>> 	https://lore.kernel.org/r/00000000000058d15f05fb264013@google.com
>>>>>
>>>>> So something's wrong here, let me dig into it tomorrow when I get a
>>>>> chance...
>>>>
>>>> If this could help, here is the bisect of the bug (I could not discern what
>>>> could possibly be wrong):
>>>>
>>>> user@host:~/linux/kernel/linux_torvalds$ git bisect log
>>>> git bisect start
>>>> # bad: [ac9a78681b921877518763ba0e89202254349d1b] Linux 6.4-rc1
>>>> git bisect bad ac9a78681b921877518763ba0e89202254349d1b
>>>> # good: [c9c3395d5e3dcc6daee66c6908354d47bf98cb0c] Linux 6.2
>>>> git bisect good c9c3395d5e3dcc6daee66c6908354d47bf98cb0c
>>>> # good: [85496c9b3bf8dbe15e2433d3a0197954d323cadc] Merge branch
>>>> 'net-remove-some-rcu_bh-cruft'
>>>> git bisect good 85496c9b3bf8dbe15e2433d3a0197954d323cadc
>>>> # good: [b68ee1c6131c540a62ecd443be89c406401df091] Merge tag 'scsi-misc' of
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
>>>> git bisect good b68ee1c6131c540a62ecd443be89c406401df091
>>>> # bad: [888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0] Merge tag 'sysctl-6.4-rc1'
>>>> of git://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux
>>>> git bisect bad 888d3c9f7f3ae44101a3fd76528d3dd6f96e9fd0
>>>> # good: [34b62f186db9614e55d021f8c58d22fc44c57911] Merge tag
>>>> 'pci-v6.4-changes' of git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci
>>>> git bisect good 34b62f186db9614e55d021f8c58d22fc44c57911
>>>> # good: [34da76dca4673ab1819830b4924bb5b436325b26] Merge tag
>>>> 'for-linus-2023042601' of
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
>>>> git bisect good 34da76dca4673ab1819830b4924bb5b436325b26
>>>> # good: [97b2ff294381d05e59294a931c4db55276470cb5] Merge tag
>>>> 'staging-6.4-rc1' of
>>>> git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging
>>>> git bisect good 97b2ff294381d05e59294a931c4db55276470cb5
>>>> # good: [2025b2ca8004c04861903d076c67a73a0ec6dfca] mcb-lpc: Reallocate
>>>> memory region to avoid memory overlapping
>>>> git bisect good 2025b2ca8004c04861903d076c67a73a0ec6dfca
>>>> # bad: [d06f5a3f7140921ada47d49574ae6fa4de5e2a89] cdx: fix build failure due
>>>> to sysfs 'bus_type' argument needing to be const
>>>> git bisect bad d06f5a3f7140921ada47d49574ae6fa4de5e2a89
>>>> # good: [dcfbb67e48a2becfce7990386e985b9c45098ee5] driver core: class: use
>>>> lock_class_key already present in struct subsys_private
>>>> git bisect good dcfbb67e48a2becfce7990386e985b9c45098ee5
>>>> # bad: [6f14c02220c791d5c46b0f965b9340c58f3d503d] driver core: create
>>>> class_is_registered()
>>>> git bisect bad 6f14c02220c791d5c46b0f965b9340c58f3d503d
>>>> # good: [2f9e87f5a2941b259336c7ea6c5a1499ede4554a] driver core: Add a
>>>> comment to set_primary_fwnode() on nullifying
>>>> git bisect good 2f9e87f5a2941b259336c7ea6c5a1499ede4554a
>>>> # bad: [02fe26f25325b547b7a31a65deb0326c04bb5174] firmware_loader: Add debug
>>>> message with checksum for FW file
>>>> git bisect bad 02fe26f25325b547b7a31a65deb0326c04bb5174
>>>> # good: [884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82] driver core: class:
>>>> implement class_get/put without the private pointer.
>>>> git bisect good 884f8ce42ccec9d0bf11d8bf9f111e5961ca1c82
>>>> # bad: [3f84aa5ec052dba960baca4ab8a352d43d47028e] base: soc: populate
>>>> machine name in soc_device_register if empty
>>>> git bisect bad 3f84aa5ec052dba960baca4ab8a352d43d47028e
>>>> # bad: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core: class.c:
>>>> convert to only use class_to_subsys
>>>> git bisect bad 7b884b7f24b42fa25e92ed724ad82f137610afaf
>>>> # first bad commit: [7b884b7f24b42fa25e92ed724ad82f137610afaf] driver core:
>>>> class.c: convert to only use class_to_subsys
>>>> user@host:~/linux/kernel/linux_torvalds$
>>>
>>> This helps a lot, thanks.  I got the reference counting wrong somewhere
>>> in here, I thought I tested this better, odd it shows up now...
>>>
>>> I'll try to work on it this week.
>>
>> I have figured out that the leak occurs on keyboard unplugging only, one
>> or two leaks (maybe a race condition?).
>>
>> Please NOTE that the number of leaks is now odd:
>>
>> root@defiant:/home/marvin# cat /sys/kernel/debug/kmemleak | grep comm
>>    comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
>>    comm "systemd-udevd", pid 330, jiffies 4294892588 (age 715.772s)
>>    comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.224s)
>>    comm "kworker/6:0", pid 54, jiffies 4294907989 (age 654.272s)
>>    comm "kworker/6:3", pid 3046, jiffies 4294935362 (age 544.780s)
>>    comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.740s)
>>    comm "kworker/6:0", pid 54, jiffies 4294964122 (age 429.784s)
>> root@defiant:/home/marvin#
>>
>> At one time unplugging keyboard generated only one leak, but only at one
>> time. As it requires manually unplugging keyboard, I didn't seem to find a
>> way to automate it, but it doesn't seem to require root access.
>>
>> BTW, I've seen in syzbot output that kmemleak output has debug source file
>> names and line numbers. I couldn't make that work with the dbg .deb.
>>
>> I will do some more homework, but this was a rough week.
> 
> I made up a patch based on code inspection alone, as I couldn't
> reproduce this locally at all:
> 	https://lore.kernel.org/r/2023051628-thumb-boaster-5680@gregkh
> and it seemed to pass syzbot's tests.
> 
> I've included it here below, can you test it as well?
> 
> Hm, I only tested with a USB mouse unplug/plug cycle, maybe the issue is
> a keyboard?
> 
> thanks,
> 
> greg k-h

Hi, Greg,

Yes, the problem was with the keyboard, and with unplugging, mouse unplugged
w/o problems.

I will test the patch in the afternoon, as the issue did not appear on the
work computer. Probably it is for the best that the exact environment is
reproduced for the test.

Best regards,
Mirsad

> -------------
> 
> diff --git a/drivers/base/class.c b/drivers/base/class.c
> index ac1808d1a2e8..9b44edc8416f 100644
> --- a/drivers/base/class.c
> +++ b/drivers/base/class.c
> @@ -320,6 +322,7 @@ void class_dev_iter_init(struct class_dev_iter *iter, const struct class *class,
>   		start_knode = &start->p->knode_class;
>   	klist_iter_init_node(&sp->klist_devices, &iter->ki, start_knode);
>   	iter->type = type;
> +	iter->sp = sp;
>   }
>   EXPORT_SYMBOL_GPL(class_dev_iter_init);
>   
> @@ -361,6 +364,7 @@ EXPORT_SYMBOL_GPL(class_dev_iter_next);
>   void class_dev_iter_exit(struct class_dev_iter *iter)
>   {
>   	klist_iter_exit(&iter->ki);
> +	subsys_put(iter->sp);
>   }
>   EXPORT_SYMBOL_GPL(class_dev_iter_exit);
>   
> diff --git a/include/linux/device/class.h b/include/linux/device/class.h
> index 9deeaeb457bb..abf3d3bfb6fe 100644
> --- a/include/linux/device/class.h
> +++ b/include/linux/device/class.h
> @@ -74,6 +74,7 @@ struct class {
>   struct class_dev_iter {
>   	struct klist_iter		ki;
>   	const struct device_type	*type;
> +	struct subsys_private		*sp;
>   };
>   
>   int __must_check class_register(const struct class *class);

-- 
Mirsad Todorovac
System engineer
Faculty of Graphic Arts | Academy of Fine Arts
University of Zagreb
Republic of Croatia, the European Union

Sistem inženjer
Grafički fakultet | Akademija likovnih umjetnosti
Sveučilište u Zagrebu


^ permalink raw reply


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox