Linux Serial subsystem development
 help / color / mirror / Atom feed
* Re: [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW
From: Jarkko Nikula @ 2017-12-20  8:34 UTC (permalink / raw)
  To: Joe Perches
  Cc: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Cezary Jackiewicz,
	Darren Hart, Andy Shevchenko, Sebastian Ott, Peter Oberparleiter,
	James Smart, Dick Kennedy, Zhang Rui, Eduardo Valentin,
	Greg Kroah-Hartman, Mathias Nyman, Felipe Balbi,
	Luis R. Rodriguez, Peter Ujfalusi, Martin Schwidefsky
In-Reply-To: <cd38f14f06e1f447b3159ffe8c69c0df8241bb6e.1513706701.git.joe@perches.com>

On Tue, Dec 19, 2017 at 10:15:07AM -0800, Joe Perches wrote:
> Convert DEVICE_ATTR uses to DEVICE_ATTR_RW where possible.
> 
...
  
> diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
> index 7a54e3083203..79d4dc785e5c 100644
> --- a/sound/soc/omap/mcbsp.c
> +++ b/sound/soc/omap/mcbsp.c
> @@ -854,7 +854,7 @@ static ssize_t dma_op_mode_store(struct device *dev,
>  	return size;
>  }
>  
> -static DEVICE_ATTR(dma_op_mode, 0644, dma_op_mode_show, dma_op_mode_store);
> +static DEVICE_ATTR_RW(dma_op_mode);
>  
While I can ack this part here if it helps generic cleanup effort I
don't understart would it improve code readability in general? Mode 644
is clear and don't need any grepping but for DEVICE_ATTR_RW() I had to go
through all of these files in order to see what does it mean:

DEVICE_ATTR_RW: include/linux/device.h
__ATTR_RW: include/linux/sysfs.h
S_IWUSR: include/uapi/linux/stat.h
S_IRUGO: include/linux/stat.h

Jarkko Nikula <jarkko.nikula@bitmer.com>

^ permalink raw reply

* Re: [alsa-devel] [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW
From: Jidong Zhang @ 2017-12-20  7:19 UTC (permalink / raw)
  To: Andy Shevchenko, Joe Perches
  Cc: linux-fbdev@vger.kernel.org, Liam Girdwood, David Airlie,
	Heiko Carstens, ALSA Development Mailing List,
	dri-devel@lists.freedesktop.org, Platform Driver, Peter Ujfalusi,
	linux-s390@vger.kernel.org, James E.J. Bottomley, linux-scsi,
	linux-pm@vger.kernel.org, Sebastian Ott, James Smart,
	Cezary Jackiewicz, linux-serial@vger.kernel.org, Jiri Slaby,
	Darren Hart, Zhang Rui <rui>
In-Reply-To: <CAHp75VfyvA3kAtGiwJ63BOx43RuVSz-XgdK79WApytoaehOOgQ@mail.gmail.com>


Does anyone know how to use Conexant CX20921 to develop our own application. I cannot find anywhere to download the software and manuals.

Thanks to all
J.D

-----Original Message-----
From: alsa-devel-bounces@alsa-project.org [mailto:alsa-devel-bounces@alsa-project.org] On Behalf Of Andy Shevchenko
Sent: 2017年12月20日 2:42
To: Joe Perches <joe@perches.com>
Cc: linux-fbdev@vger.kernel.org; David Airlie <airlied@linux.ie>; Joonas Lahtinen <joonas.lahtinen@linux.intel.com>; Heiko Carstens <heiko.carstens@de.ibm.com>; ALSA Development Mailing List <alsa-devel@alsa-project.org>; dri-devel@lists.freedesktop.org; Peter Ujfalusi <peter.ujfalusi@ti.com>; linux-s390@vger.kernel.org; Linux OMAP Mailing List <linux-omap@vger.kernel.org>; James E.J. Bottomley <jejb@linux.vnet.ibm.com>; linux-scsi <linux-scsi@vger.kernel.org>; Takashi Iwai <tiwai@suse.com>; Sebastian Ott <sebott@linux.vnet.ibm.com>; James Smart <james.smart@broadcom.com>; Cezary Jackiewicz <cezary.jackiewicz@gmail.com>; linux-serial@vger.kernel.org; Jiri Slaby <jslaby@suse.com>; Darren Hart <dvhart@infradead.org>; Zhang Rui <rui.zhang@intel.com>; Dick Kennedy <dick.kennedy@broadcom.com>; Mathias Nyman <mathias.nyman@intel.com>; Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>; Peter Oberparleiter <oberpar@linux.vnet.ibm.com>; intel-gfx@lists.freedesktop.org; Jani Nikula <jani.nikula@linux.intel.com>; Eduardo Valentin <edubezval@gmail.com>; Mark Brown <broonie@kernel.org>; Rodrigo Vivi <rodrigo.vivi@intel.com>; Platform Driver <platform-driver-x86@vger.kernel.org>; Felipe Balbi <balbi@kernel.org>; Martin K. Petersen <martin.petersen@oracle.com>; Greg Kroah-Hartman <gregkh@linuxfoundation.org>; linux-pm@vger.kernel.org; USB <linux-usb@vger.kernel.org>; Liam Girdwood <lgirdwood@gmail.com>; linux-kernel@vger.kernel.org; Luis R. Rodriguez <mcgrof@kernel.org>; Andy Shevchenko <andy@infradead.org>; Martin Schwidefsky <schwidefsky@de.ibm.com>; Jarkko Nikula <jarkko.nikula@bitmer.com>
Subject: Re: [alsa-devel] [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW

On Tue, Dec 19, 2017 at 8:15 PM, Joe Perches <joe@perches.com> wrote:
> Convert DEVICE_ATTR uses to DEVICE_ATTR_RW where possible.
>
> Done with perl script:
>
> $ git grep -w --name-only DEVICE_ATTR | \
>   xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(\s*S_IRUGO\s*\|\s*S_IWUSR|\s*S_IWUSR\s*\|\s*S_IRUGO\s*|\s*0644\s*)\)?\s*,\s*\1_show\s*,\s*\1_store\s*\)/DEVICE_ATTR_RW(\1)/g; print;}'

>  drivers/platform/x86/compal-laptop.c | 18 +++++----------

> --- a/drivers/platform/x86/compal-laptop.c
> +++ b/drivers/platform/x86/compal-laptop.c
> @@ -679,18 +679,12 @@ static int bat_writeable_property(struct 
> power_supply *psy,
>  /* ============== */
>  /* Driver Globals */
>  /* ============== */
> -static DEVICE_ATTR(wake_up_pme,
> -               0644, wake_up_pme_show,         wake_up_pme_store);
> -static DEVICE_ATTR(wake_up_modem,
> -               0644, wake_up_modem_show,       wake_up_modem_store);
> -static DEVICE_ATTR(wake_up_lan,
> -               0644, wake_up_lan_show, wake_up_lan_store);
> -static DEVICE_ATTR(wake_up_wlan,
> -               0644, wake_up_wlan_show,        wake_up_wlan_store);
> -static DEVICE_ATTR(wake_up_key,
> -               0644, wake_up_key_show, wake_up_key_store);
> -static DEVICE_ATTR(wake_up_mouse,
> -               0644, wake_up_mouse_show,       wake_up_mouse_store);
> +static DEVICE_ATTR_RW(wake_up_pme);
> +static DEVICE_ATTR_RW(wake_up_modem); static 
> +DEVICE_ATTR_RW(wake_up_lan); static DEVICE_ATTR_RW(wake_up_wlan); 
> +static DEVICE_ATTR_RW(wake_up_key); static 
> +DEVICE_ATTR_RW(wake_up_mouse);

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

for PDx86 bits.

Have to say that while it doesn't change the attributes here, it might require still to be revisited by security people, if they wish.

--
With Best Regards,
Andy Shevchenko
_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* [PATCH v15 2/5] serdev: Introduce devm_serdev_device_open()
From: Andrey Smirnov @ 2017-12-20  4:00 UTC (permalink / raw)
  To: Lee Jones
  Cc: Andrey Smirnov, linux-kernel, linux-serial, Rob Herring, cphealy,
	Guenter Roeck, Lucas Stach, Nikita Yushchenko, Greg Kroah-Hartman,
	Pavel Machek, Andy Shevchenko, Johan Hovold, Sebastian Reichel
In-Reply-To: <20171220040017.7605-1-andrew.smirnov@gmail.com>

Add code implementing managed version of serdev_device_open() for
serdev device drivers that "open" the device during driver's lifecycle
only once (e.g. opened in .probe() and closed in .remove()).

Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: cphealy@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 Documentation/driver-model/devres.txt |  3 +++
 drivers/tty/serdev/core.c             | 27 +++++++++++++++++++++++++++
 include/linux/serdev.h                |  1 +
 3 files changed, 31 insertions(+)

diff --git a/Documentation/driver-model/devres.txt b/Documentation/driver-model/devres.txt
index c180045eb43b..7c1bb3d0c222 100644
--- a/Documentation/driver-model/devres.txt
+++ b/Documentation/driver-model/devres.txt
@@ -384,6 +384,9 @@ RESET
   devm_reset_control_get()
   devm_reset_controller_register()
 
+SERDEV
+  devm_serdev_device_open()
+
 SLAVE DMA ENGINE
   devm_acpi_dma_controller_register()
 
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 34050b439c1f..28133dbd2808 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -132,6 +132,33 @@ void serdev_device_close(struct serdev_device *serdev)
 }
 EXPORT_SYMBOL_GPL(serdev_device_close);
 
+static void devm_serdev_device_release(struct device *dev, void *dr)
+{
+	serdev_device_close(*(struct serdev_device **)dr);
+}
+
+int devm_serdev_device_open(struct device *dev, struct serdev_device *serdev)
+{
+	struct serdev_device **dr;
+	int ret;
+
+	dr = devres_alloc(devm_serdev_device_release, sizeof(*dr), GFP_KERNEL);
+	if (!dr)
+		return -ENOMEM;
+
+	ret = serdev_device_open(serdev);
+	if (ret) {
+		devres_free(dr);
+		return ret;
+	}
+
+	*dr = serdev;
+	devres_add(dev, dr);
+
+	return 0;
+}
+EXPORT_SYMBOL_GPL(devm_serdev_device_open);
+
 void serdev_device_write_wakeup(struct serdev_device *serdev)
 {
 	complete(&serdev->write_comp);
diff --git a/include/linux/serdev.h b/include/linux/serdev.h
index e69402d4a8ae..9929063bd45d 100644
--- a/include/linux/serdev.h
+++ b/include/linux/serdev.h
@@ -193,6 +193,7 @@ static inline int serdev_controller_receive_buf(struct serdev_controller *ctrl,
 
 int serdev_device_open(struct serdev_device *);
 void serdev_device_close(struct serdev_device *);
+int devm_serdev_device_open(struct device *, struct serdev_device *);
 unsigned int serdev_device_set_baudrate(struct serdev_device *, unsigned int);
 void serdev_device_set_flow_control(struct serdev_device *, bool);
 int serdev_device_write_buf(struct serdev_device *, const unsigned char *, size_t);
-- 
2.14.3

^ permalink raw reply related

* [PATCH v15 1/5] serdev: Make .remove in struct serdev_device_driver optional
From: Andrey Smirnov @ 2017-12-20  4:00 UTC (permalink / raw)
  To: Lee Jones
  Cc: Andrey Smirnov, linux-kernel, linux-serial, Rob Herring, cphealy,
	Guenter Roeck, Lucas Stach, Nikita Yushchenko, Greg Kroah-Hartman,
	Pavel Machek, Andy Shevchenko, Johan Hovold, Sebastian Reichel
In-Reply-To: <20171220040017.7605-1-andrew.smirnov@gmail.com>

Using devres infrastructure it is possible to write a serdev driver
that doesn't have any code that needs to be called as a part of
.remove. Add code to make .remove optional.

Cc: linux-kernel@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: Rob Herring <robh@kernel.org>
Cc: cphealy@gmail.com
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Cc: Lee Jones <lee.jones@linaro.org>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Johan Hovold <johan@kernel.org>
Cc: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
Reviewed-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Andrey Smirnov <andrew.smirnov@gmail.com>
---
 drivers/tty/serdev/core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index 1bef39828ca7..34050b439c1f 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -268,8 +268,8 @@ static int serdev_drv_probe(struct device *dev)
 static int serdev_drv_remove(struct device *dev)
 {
 	const struct serdev_device_driver *sdrv = to_serdev_device_driver(dev->driver);
-
-	sdrv->remove(to_serdev_device(dev));
+	if (sdrv->remove)
+		sdrv->remove(to_serdev_device(dev));
 	return 0;
 }
 
-- 
2.14.3

^ permalink raw reply related

* Re: [PATCH v4 04/36] nds32: Kernel booting and initialization
From: Greentime Hu @ 2017-12-20  2:35 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: Greentime, Linux Kernel Mailing List, Arnd Bergmann, linux-arch,
	Thomas Gleixner, Jason Cooper, Marc Zyngier, Rob Herring, netdev,
	Vincent Chen, DTML, Al Viro, David Howells, Will Deacon,
	Daniel Lezcano, linux-serial, Geert Uytterhoeven, Linus Walleij,
	Mark Rutland, Greg KH
In-Reply-To: <78afd442-4482-f104-746e-5984214658ee@infradead.org>

2017-12-20 6:01 GMT+08:00 Randy Dunlap <rdunlap@infradead.org>:
> On 12/17/2017 10:46 PM, Greentime Hu wrote:
>> From: Greentime Hu <greentime@andestech.com>
>>
>> This patch includes the kernel startup code. It can get dtb pointer
>> passed from bootloader. It will create a temp mapping by tlb
>> instructions at beginning and goto start_kernel.
>>
>> Signed-off-by: Vincent Chen <vincentc@andestech.com>
>> Signed-off-by: Greentime Hu <greentime@andestech.com>
>> ---
>>  arch/nds32/kernel/head.S  |  189 ++++++++++++++++++++++
>>  arch/nds32/kernel/setup.c |  383 +++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 572 insertions(+)
>>  create mode 100644 arch/nds32/kernel/head.S
>>  create mode 100644 arch/nds32/kernel/setup.c
>>
>
>> diff --git a/arch/nds32/kernel/setup.c b/arch/nds32/kernel/setup.c
>> new file mode 100644
>> index 0000000..7718c58
>> --- /dev/null
>> +++ b/arch/nds32/kernel/setup.c
>> @@ -0,0 +1,383 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +// Copyright (C) 2005-2017 Andes Technology Corporation
>> +
>
> [snip]
>
>> +struct cache_info L1_cache_info[2];
>> +static void __init dump_cpu_info(int cpu)
>> +{
>> +     int i, p = 0;
>> +     char str[sizeof(hwcap_str) + 16];
>> +
>> +     for (i = 0; hwcap_str[i]; i++) {
>> +             if (elf_hwcap & (1 << i)) {
>> +                     sprintf(str + p, "%s ", hwcap_str[i]);
>> +                     p += strlen(hwcap_str[i]) + 1;
>> +             }
>> +     }
>> +
>> +     pr_info("CPU%d Featuretures: %s\n", cpu, str);
>
>                        Features:
>

Thanks Randy. I will fix this typo.

^ permalink raw reply

* Re: [PATCH v4 25/36] nds32: Miscellaneous header files
From: Greentime Hu @ 2017-12-20  2:34 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greentime, Linux Kernel Mailing List, linux-arch, Thomas Gleixner,
	Jason Cooper, Marc Zyngier, Rob Herring, Networking, Vincent Chen,
	DTML, Al Viro, David Howells, Will Deacon, Daniel Lezcano,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven,
	Linus Walleij, Mark Rutland, Greg KH, Guo Ren
In-Reply-To: <CAK8P3a3Ofczq1DrQEcEcP1fZrgyeOLpFDwgd7uMZ4H0NpHs+wg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

2017-12-19 17:54 GMT+08:00 Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>:
> On Tue, Dec 19, 2017 at 6:34 AM, Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> Hi, Arnd:
>>
>> 2017-12-18 19:13 GMT+08:00 Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>:
>>> On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>>> From: Greentime Hu <greentime-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
>>>>
>>>> This patch introduces some miscellaneous header files.
>>>
>>>> +static inline void __delay(unsigned long loops)
>>>> +{
>>>> +       __asm__ __volatile__(".align 2\n"
>>>> +                            "1:\n"
>>>> +                            "\taddi\t%0, %0, -1\n"
>>>> +                            "\tbgtz\t%0, 1b\n"
>>>> +                            :"=r"(loops)
>>>> +                            :"0"(loops));
>>>> +}
>>>> +
>>>> +static inline void __udelay(unsigned long usecs, unsigned long lpj)
>>>> +{
>>>> +       usecs *= (unsigned long)(((0x8000000000000000ULL / (500000 / HZ)) +
>>>> +                                 0x80000000ULL) >> 32);
>>>> +       usecs = (unsigned long)(((unsigned long long)usecs * lpj) >> 32);
>>>> +       __delay(usecs);
>>>> +}
>>>
>>> Do you have a reliable clocksource that you can read here instead of doing the
>>> loop? It's generally preferred to have an accurate delay if at all possible, the
>>> delay loop calibration is only for those architectures that don't have any
>>> way to observe how much time has passed accurately.
>>>
>>
>> We currently only have atcpit100 as clocksource but it is an IP of  SoC.
>> These delay API will be unavailable if we changed to another SoC
>> unless all these timer driver provided the same APIs.
>> It may suffer our customers if they forget to port these APIs in their
>> timer drivers when they try to use nds32 in the first beginning.
>
> Ok, thanks for the clarification.
>
>> Or maybe I can use a CONFIG_USE_ACCURATE_DELAY to keep these 2
>> implementions for these purposes?
>
> I'd just add a one-line comment in delay.h to explain that there is no
> cycle counter in the CPU.
>

Thanks.
Got it. I will add a one-line comment in delay.h
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v4 04/36] nds32: Kernel booting and initialization
From: Randy Dunlap @ 2017-12-19 22:01 UTC (permalink / raw)
  To: Greentime Hu, greentime-MUIXKm3Oiri1Z/+hSey0Gg,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA, arnd-r2nGTMty4D4,
	linux-arch-u79uwXL29TY76Z2rM5mHXA, tglx-hfZtesqFncYOwBW4kG4KsQ,
	jason-NLaQJdtUoK4Be96aLqz0jA, marc.zyngier-5wv7dgnIgG8,
	robh+dt-DgEjT+Ai2ygdnm+yROfE0A, netdev-u79uwXL29TY76Z2rM5mHXA,
	deanbo422-Re5JQEeQqe8AvxtiuMwx3w,
	devicetree-u79uwXL29TY76Z2rM5mHXA,
	viro-RmSDqhL/yNMiFSDQTTA3OLVCufUGDwFn,
	dhowells-H+wXaHxf7aLQT0dZR+AlfA, will.deacon-5wv7dgnIgG8,
	daniel.lezcano-QSEj5FYQhm4dnm+yROfE0A,
	linux-serial-u79uwXL29TY76Z2rM5mHXA,
	geert.uytterhoeven-Re5JQEeQqe8AvxtiuMwx3w,
	linus.walleij-QSEj5FYQhm4dnm+yROfE0A, mark.rutland-5wv7dgnIgG8,
	greg-U8xfFu+wG4EAvxtiuMwx3w, ren_guo-Y+KPrCd2zL4AvxtiuMwx3w,
	pombredanne-od1rfyK75/E
  Cc: Vincent Chen
In-Reply-To: <935ff034982f077b2e6f5eeccd6fe2110614fc9c.1513577007.git.green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>

On 12/17/2017 10:46 PM, Greentime Hu wrote:
> From: Greentime Hu <greentime-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
> 
> This patch includes the kernel startup code. It can get dtb pointer
> passed from bootloader. It will create a temp mapping by tlb
> instructions at beginning and goto start_kernel.
> 
> Signed-off-by: Vincent Chen <vincentc-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
> Signed-off-by: Greentime Hu <greentime-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
> ---
>  arch/nds32/kernel/head.S  |  189 ++++++++++++++++++++++
>  arch/nds32/kernel/setup.c |  383 +++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 572 insertions(+)
>  create mode 100644 arch/nds32/kernel/head.S
>  create mode 100644 arch/nds32/kernel/setup.c
> 

> diff --git a/arch/nds32/kernel/setup.c b/arch/nds32/kernel/setup.c
> new file mode 100644
> index 0000000..7718c58
> --- /dev/null
> +++ b/arch/nds32/kernel/setup.c
> @@ -0,0 +1,383 @@
> +// SPDX-License-Identifier: GPL-2.0
> +// Copyright (C) 2005-2017 Andes Technology Corporation
> +

[snip]

> +struct cache_info L1_cache_info[2];
> +static void __init dump_cpu_info(int cpu)
> +{
> +	int i, p = 0;
> +	char str[sizeof(hwcap_str) + 16];
> +
> +	for (i = 0; hwcap_str[i]; i++) {
> +		if (elf_hwcap & (1 << i)) {
> +			sprintf(str + p, "%s ", hwcap_str[i]);
> +			p += strlen(hwcap_str[i]) + 1;
> +		}
> +	}
> +
> +	pr_info("CPU%d Featuretures: %s\n", cpu, str);

	               Features:


-- 
~Randy
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [-next PATCH 0/4] sysfs and DEVICE_ATTR_<foo>
From: Corey Minyard @ 2017-12-19 19:26 UTC (permalink / raw)
  To: Joe Perches, linux-arm-kernel, linux-acpi, openipmi-developer,
	intel-gfx, linuxppc-dev, netdev, linux-nvme, platform-driver-x86,
	linux-s390, esc.storagedev, linux-scsi, linux-pm, linux-serial,
	linux-usb, linux-kernel, alsa-devel, linux-omap
  Cc: devel, linux-fbdev, linux-sh, dri-devel, linux-input, linux-media
In-Reply-To: <cover.1513706701.git.joe@perches.com>

On 12/19/2017 12:15 PM, Joe Perches wrote:
>   drivers/char/ipmi/ipmi_msghandler.c                | 17 +++---

For ipmi:

Acked-by: Corey Minyard <cminyard@mvista.com>

^ permalink raw reply

* Re: [-next PATCH 0/4] sysfs and DEVICE_ATTR_<foo>
From: Jani Nikula @ 2017-12-19 18:54 UTC (permalink / raw)
  To: Joe Perches, linux-arm-kernel, linux-acpi, openipmi-developer,
	intel-gfx, linuxppc-dev, netdev, linux-nvme, platform-driver-x86,
	linux-s390, esc.storagedev, linux-scsi, linux-pm, linux-serial,
	linux-usb, linux-kernel, alsa-devel, linux-omap
  Cc: devel, linux-fbdev, linux-sh, dri-devel, linux-input, linux-media
In-Reply-To: <cover.1513706701.git.joe@perches.com>

On Tue, 19 Dec 2017, Joe Perches <joe@perches.com> wrote:
>  drivers/gpu/drm/i915/i915_sysfs.c                  | 12 ++--

For i915,

Acked-by: Jani Nikula <jani.nikula@intel.com>


-- 
Jani Nikula, Intel Open Source Technology Center

^ permalink raw reply

* Re: [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW
From: Andy Shevchenko @ 2017-12-19 18:41 UTC (permalink / raw)
  To: Joe Perches
  Cc: linux-fbdev, David Airlie, Heiko Carstens,
	ALSA Development Mailing List, dri-devel, Jaroslav Kysela,
	Peter Ujfalusi, linux-s390, Linux OMAP Mailing List,
	James E.J. Bottomley, linux-scsi, Takashi Iwai, Sebastian Ott,
	James Smart, Cezary Jackiewicz, linux-serial@vger.kernel.org,
	Jiri Slaby, Darren Hart, Zhang Rui, Dick Kennedy, Mathias Nyman,
	Bartlomiej
In-Reply-To: <cd38f14f06e1f447b3159ffe8c69c0df8241bb6e.1513706701.git.joe@perches.com>

On Tue, Dec 19, 2017 at 8:15 PM, Joe Perches <joe@perches.com> wrote:
> Convert DEVICE_ATTR uses to DEVICE_ATTR_RW where possible.
>
> Done with perl script:
>
> $ git grep -w --name-only DEVICE_ATTR | \
>   xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(\s*S_IRUGO\s*\|\s*S_IWUSR|\s*S_IWUSR\s*\|\s*S_IRUGO\s*|\s*0644\s*)\)?\s*,\s*\1_show\s*,\s*\1_store\s*\)/DEVICE_ATTR_RW(\1)/g; print;}'

>  drivers/platform/x86/compal-laptop.c | 18 +++++----------

> --- a/drivers/platform/x86/compal-laptop.c
> +++ b/drivers/platform/x86/compal-laptop.c
> @@ -679,18 +679,12 @@ static int bat_writeable_property(struct power_supply *psy,
>  /* ============== */
>  /* Driver Globals */
>  /* ============== */
> -static DEVICE_ATTR(wake_up_pme,
> -               0644, wake_up_pme_show,         wake_up_pme_store);
> -static DEVICE_ATTR(wake_up_modem,
> -               0644, wake_up_modem_show,       wake_up_modem_store);
> -static DEVICE_ATTR(wake_up_lan,
> -               0644, wake_up_lan_show, wake_up_lan_store);
> -static DEVICE_ATTR(wake_up_wlan,
> -               0644, wake_up_wlan_show,        wake_up_wlan_store);
> -static DEVICE_ATTR(wake_up_key,
> -               0644, wake_up_key_show, wake_up_key_store);
> -static DEVICE_ATTR(wake_up_mouse,
> -               0644, wake_up_mouse_show,       wake_up_mouse_store);
> +static DEVICE_ATTR_RW(wake_up_pme);
> +static DEVICE_ATTR_RW(wake_up_modem);
> +static DEVICE_ATTR_RW(wake_up_lan);
> +static DEVICE_ATTR_RW(wake_up_wlan);
> +static DEVICE_ATTR_RW(wake_up_key);
> +static DEVICE_ATTR_RW(wake_up_mouse);

Acked-by: Andy Shevchenko <andy.shevchenko@gmail.com>

for PDx86 bits.

Have to say that while it doesn't change the attributes here, it might
require still to be revisited by security people, if they wish.

-- 
With Best Regards,
Andy Shevchenko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply

* [-next PATCH 2/4] treewide: Use DEVICE_ATTR_RW
From: Joe Perches @ 2017-12-19 18:15 UTC (permalink / raw)
  To: Jani Nikula, Joonas Lahtinen, Rodrigo Vivi, Cezary Jackiewicz,
	Darren Hart, Andy Shevchenko, Sebastian Ott, Peter Oberparleiter,
	James Smart, Dick Kennedy, Zhang Rui, Eduardo Valentin,
	Greg Kroah-Hartman, Mathias Nyman, Felipe Balbi,
	Luis R. Rodriguez, Peter Ujfalusi, Jarkko Nikula
  Cc: alsa-devel, Liam Girdwood, David Airlie, Heiko Carstens,
	linux-fbdev, dri-devel, Takashi Iwai, linux-s390, linux-omap,
	James E.J. Bottomley, linux-scsi, linux-pm, linux-serial,
	Jiri Slaby, platform-driver-x86, Bartlomiej Zolnierkiewicz,
	intel-gfx, Mark Brown, Jaroslav Kysela, Martin K. Petersen,
	linux-usb, linux-kernel, Martin Schwidefsky
In-Reply-To: <cover.1513706701.git.joe@perches.com>

Convert DEVICE_ATTR uses to DEVICE_ATTR_RW where possible.

Done with perl script:

$ git grep -w --name-only DEVICE_ATTR | \
  xargs perl -i -e 'local $/; while (<>) { s/\bDEVICE_ATTR\s*\(\s*(\w+)\s*,\s*\(?(\s*S_IRUGO\s*\|\s*S_IWUSR|\s*S_IWUSR\s*\|\s*S_IRUGO\s*|\s*0644\s*)\)?\s*,\s*\1_show\s*,\s*\1_store\s*\)/DEVICE_ATTR_RW(\1)/g; print;}'

Signed-off-by: Joe Perches <joe@perches.com>
---
 arch/s390/kernel/topology.c          |  3 +--
 arch/tile/kernel/sysfs.c             |  2 +-
 drivers/gpu/drm/i915/i915_sysfs.c    |  6 ++---
 drivers/platform/x86/compal-laptop.c | 18 +++++----------
 drivers/s390/cio/device.c            |  2 +-
 drivers/scsi/lpfc/lpfc_attr.c        | 43 ++++++++++++------------------------
 drivers/thermal/thermal_sysfs.c      |  9 ++++----
 drivers/tty/serial/sh-sci.c          |  2 +-
 drivers/usb/host/xhci-dbgcap.c       |  2 +-
 drivers/usb/phy/phy-tahvo.c          |  2 +-
 drivers/video/fbdev/auo_k190x.c      |  4 ++--
 drivers/video/fbdev/w100fb.c         |  4 ++--
 lib/test_firmware.c                  | 14 +++++-------
 lib/test_kmod.c                      | 14 +++++-------
 sound/soc/omap/mcbsp.c               |  4 ++--
 15 files changed, 49 insertions(+), 80 deletions(-)

diff --git a/arch/s390/kernel/topology.c b/arch/s390/kernel/topology.c
index 4d5b65e527b5..4b6e0397f66d 100644
--- a/arch/s390/kernel/topology.c
+++ b/arch/s390/kernel/topology.c
@@ -404,8 +404,7 @@ static ssize_t dispatching_store(struct device *dev,
 	put_online_cpus();
 	return rc ? rc : count;
 }
-static DEVICE_ATTR(dispatching, 0644, dispatching_show,
-			 dispatching_store);
+static DEVICE_ATTR_RW(dispatching);
 
 static ssize_t cpu_polarization_show(struct device *dev,
 				     struct device_attribute *attr, char *buf)
diff --git a/arch/tile/kernel/sysfs.c b/arch/tile/kernel/sysfs.c
index 825867c53853..af5024f0fb5a 100644
--- a/arch/tile/kernel/sysfs.c
+++ b/arch/tile/kernel/sysfs.c
@@ -184,7 +184,7 @@ static ssize_t hv_stats_store(struct device *dev,
 	return n < 0 ? n : count;
 }
 
-static DEVICE_ATTR(hv_stats, 0644, hv_stats_show, hv_stats_store);
+static DEVICE_ATTR_RW(hv_stats);
 
 static int hv_stats_device_add(struct device *dev, struct subsys_interface *sif)
 {
diff --git a/drivers/gpu/drm/i915/i915_sysfs.c b/drivers/gpu/drm/i915/i915_sysfs.c
index c74a20b80182..1d0ab8ff5915 100644
--- a/drivers/gpu/drm/i915/i915_sysfs.c
+++ b/drivers/gpu/drm/i915/i915_sysfs.c
@@ -447,9 +447,9 @@ static ssize_t gt_min_freq_mhz_store(struct device *kdev,
 
 static DEVICE_ATTR(gt_act_freq_mhz, S_IRUGO, gt_act_freq_mhz_show, NULL);
 static DEVICE_ATTR(gt_cur_freq_mhz, S_IRUGO, gt_cur_freq_mhz_show, NULL);
-static DEVICE_ATTR(gt_boost_freq_mhz, S_IRUGO | S_IWUSR, gt_boost_freq_mhz_show, gt_boost_freq_mhz_store);
-static DEVICE_ATTR(gt_max_freq_mhz, S_IRUGO | S_IWUSR, gt_max_freq_mhz_show, gt_max_freq_mhz_store);
-static DEVICE_ATTR(gt_min_freq_mhz, S_IRUGO | S_IWUSR, gt_min_freq_mhz_show, gt_min_freq_mhz_store);
+static DEVICE_ATTR_RW(gt_boost_freq_mhz);
+static DEVICE_ATTR_RW(gt_max_freq_mhz);
+static DEVICE_ATTR_RW(gt_min_freq_mhz);
 
 static DEVICE_ATTR(vlv_rpe_freq_mhz, S_IRUGO, vlv_rpe_freq_mhz_show, NULL);
 
diff --git a/drivers/platform/x86/compal-laptop.c b/drivers/platform/x86/compal-laptop.c
index 6bcb750e1865..4f9bc72f0584 100644
--- a/drivers/platform/x86/compal-laptop.c
+++ b/drivers/platform/x86/compal-laptop.c
@@ -679,18 +679,12 @@ static int bat_writeable_property(struct power_supply *psy,
 /* ============== */
 /* Driver Globals */
 /* ============== */
-static DEVICE_ATTR(wake_up_pme,
-		0644, wake_up_pme_show,		wake_up_pme_store);
-static DEVICE_ATTR(wake_up_modem,
-		0644, wake_up_modem_show,	wake_up_modem_store);
-static DEVICE_ATTR(wake_up_lan,
-		0644, wake_up_lan_show,	wake_up_lan_store);
-static DEVICE_ATTR(wake_up_wlan,
-		0644, wake_up_wlan_show,	wake_up_wlan_store);
-static DEVICE_ATTR(wake_up_key,
-		0644, wake_up_key_show,	wake_up_key_store);
-static DEVICE_ATTR(wake_up_mouse,
-		0644, wake_up_mouse_show,	wake_up_mouse_store);
+static DEVICE_ATTR_RW(wake_up_pme);
+static DEVICE_ATTR_RW(wake_up_modem);
+static DEVICE_ATTR_RW(wake_up_lan);
+static DEVICE_ATTR_RW(wake_up_wlan);
+static DEVICE_ATTR_RW(wake_up_key);
+static DEVICE_ATTR_RW(wake_up_mouse);
 
 static DEVICE_ATTR(fan1_input,  S_IRUGO, fan_show,          NULL);
 static DEVICE_ATTR(temp1_input, S_IRUGO, temp_cpu,          NULL);
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c
index 75a245f38e2e..6eefb67b31f3 100644
--- a/drivers/s390/cio/device.c
+++ b/drivers/s390/cio/device.c
@@ -600,7 +600,7 @@ static ssize_t vpm_show(struct device *dev, struct device_attribute *attr,
 static DEVICE_ATTR(devtype, 0444, devtype_show, NULL);
 static DEVICE_ATTR(cutype, 0444, cutype_show, NULL);
 static DEVICE_ATTR(modalias, 0444, modalias_show, NULL);
-static DEVICE_ATTR(online, 0644, online_show, online_store);
+static DEVICE_ATTR_RW(online);
 static DEVICE_ATTR(availability, 0444, available_show, NULL);
 static DEVICE_ATTR(logging, 0200, NULL, initiate_logging);
 static DEVICE_ATTR(vpm, 0444, vpm_show, NULL);
diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c
index 797bb42a6306..95f7ba3c3f1a 100644
--- a/drivers/scsi/lpfc/lpfc_attr.c
+++ b/drivers/scsi/lpfc/lpfc_attr.c
@@ -2519,8 +2519,7 @@ lpfc_soft_wwpn_store(struct device *dev, struct device_attribute *attr,
 				"reinit adapter - %d\n", stat2);
 	return (stat1 || stat2) ? -EIO : count;
 }
-static DEVICE_ATTR(lpfc_soft_wwpn, S_IRUGO | S_IWUSR,
-		   lpfc_soft_wwpn_show, lpfc_soft_wwpn_store);
+static DEVICE_ATTR_RW(lpfc_soft_wwpn);
 
 /**
  * lpfc_soft_wwnn_show - Return the cfg soft ww node name for the adapter
@@ -2583,8 +2582,7 @@ lpfc_soft_wwnn_store(struct device *dev, struct device_attribute *attr,
 
 	return count;
 }
-static DEVICE_ATTR(lpfc_soft_wwnn, S_IRUGO | S_IWUSR,
-		   lpfc_soft_wwnn_show, lpfc_soft_wwnn_store);
+static DEVICE_ATTR_RW(lpfc_soft_wwnn);
 
 /**
  * lpfc_oas_tgt_show - Return wwpn of target whose luns maybe enabled for
@@ -3102,8 +3100,7 @@ MODULE_PARM_DESC(lpfc_poll, "FCP ring polling mode control:"
 		 " 1 - poll with interrupts enabled"
 		 " 3 - poll and disable FCP ring interrupts");
 
-static DEVICE_ATTR(lpfc_poll, S_IRUGO | S_IWUSR,
-		   lpfc_poll_show, lpfc_poll_store);
+static DEVICE_ATTR_RW(lpfc_poll);
 
 int lpfc_no_hba_reset_cnt;
 unsigned long lpfc_no_hba_reset[MAX_HBAS_NO_RESET] = {
@@ -3336,8 +3333,7 @@ lpfc_nodev_tmo_set(struct lpfc_vport *vport, int val)
 
 lpfc_vport_param_store(nodev_tmo)
 
-static DEVICE_ATTR(lpfc_nodev_tmo, S_IRUGO | S_IWUSR,
-		   lpfc_nodev_tmo_show, lpfc_nodev_tmo_store);
+static DEVICE_ATTR_RW(lpfc_nodev_tmo);
 
 /*
 # lpfc_devloss_tmo: If set, it will hold all I/O errors on devices that
@@ -3386,8 +3382,7 @@ lpfc_devloss_tmo_set(struct lpfc_vport *vport, int val)
 }
 
 lpfc_vport_param_store(devloss_tmo)
-static DEVICE_ATTR(lpfc_devloss_tmo, S_IRUGO | S_IWUSR,
-		   lpfc_devloss_tmo_show, lpfc_devloss_tmo_store);
+static DEVICE_ATTR_RW(lpfc_devloss_tmo);
 
 /*
  * lpfc_suppress_rsp: Enable suppress rsp feature is firmware supports it
@@ -3580,8 +3575,7 @@ lpfc_restrict_login_set(struct lpfc_vport *vport, int val)
 	return 0;
 }
 lpfc_vport_param_store(restrict_login);
-static DEVICE_ATTR(lpfc_restrict_login, S_IRUGO | S_IWUSR,
-		   lpfc_restrict_login_show, lpfc_restrict_login_store);
+static DEVICE_ATTR_RW(lpfc_restrict_login);
 
 /*
 # Some disk devices have a "select ID" or "select Target" capability.
@@ -3695,8 +3689,7 @@ lpfc_topology_store(struct device *dev, struct device_attribute *attr,
 }
 
 lpfc_param_show(topology)
-static DEVICE_ATTR(lpfc_topology, S_IRUGO | S_IWUSR,
-		lpfc_topology_show, lpfc_topology_store);
+static DEVICE_ATTR_RW(lpfc_topology);
 
 /**
  * lpfc_static_vport_show: Read callback function for
@@ -3954,8 +3947,7 @@ lpfc_stat_data_ctrl_show(struct device *dev, struct device_attribute *attr,
 /*
  * Sysfs attribute to control the statistical data collection.
  */
-static DEVICE_ATTR(lpfc_stat_data_ctrl, S_IRUGO | S_IWUSR,
-		   lpfc_stat_data_ctrl_show, lpfc_stat_data_ctrl_store);
+static DEVICE_ATTR_RW(lpfc_stat_data_ctrl);
 
 /*
  * lpfc_drvr_stat_data: sysfs attr to get driver statistical data.
@@ -4194,8 +4186,7 @@ lpfc_link_speed_init(struct lpfc_hba *phba, int val)
 	return -EINVAL;
 }
 
-static DEVICE_ATTR(lpfc_link_speed, S_IRUGO | S_IWUSR,
-		   lpfc_link_speed_show, lpfc_link_speed_store);
+static DEVICE_ATTR_RW(lpfc_link_speed);
 
 /*
 # lpfc_aer_support: Support PCIe device Advanced Error Reporting (AER)
@@ -4288,8 +4279,7 @@ lpfc_aer_support_store(struct device *dev, struct device_attribute *attr,
 	return rc;
 }
 
-static DEVICE_ATTR(lpfc_aer_support, S_IRUGO | S_IWUSR,
-		   lpfc_aer_support_show, lpfc_aer_support_store);
+static DEVICE_ATTR_RW(lpfc_aer_support);
 
 /**
  * lpfc_aer_cleanup_state - Clean up aer state to the aer enabled device
@@ -4436,8 +4426,7 @@ LPFC_ATTR(sriov_nr_virtfn, LPFC_DEF_VFN_PER_PFN, 0, LPFC_MAX_VFN_PER_PFN,
 	"Enable PCIe device SR-IOV virtual fn");
 
 lpfc_param_show(sriov_nr_virtfn)
-static DEVICE_ATTR(lpfc_sriov_nr_virtfn, S_IRUGO | S_IWUSR,
-		   lpfc_sriov_nr_virtfn_show, lpfc_sriov_nr_virtfn_store);
+static DEVICE_ATTR_RW(lpfc_sriov_nr_virtfn);
 
 /**
  * lpfc_request_firmware_store - Request for Linux generic firmware upgrade
@@ -4611,8 +4600,7 @@ lpfc_fcp_imax_init(struct lpfc_hba *phba, int val)
 	return 0;
 }
 
-static DEVICE_ATTR(lpfc_fcp_imax, S_IRUGO | S_IWUSR,
-		   lpfc_fcp_imax_show, lpfc_fcp_imax_store);
+static DEVICE_ATTR_RW(lpfc_fcp_imax);
 
 /*
  * lpfc_auto_imax: Controls Auto-interrupt coalescing values support.
@@ -4772,8 +4760,7 @@ lpfc_fcp_cpu_map_init(struct lpfc_hba *phba, int val)
 	return 0;
 }
 
-static DEVICE_ATTR(lpfc_fcp_cpu_map, S_IRUGO | S_IWUSR,
-		   lpfc_fcp_cpu_map_show, lpfc_fcp_cpu_map_store);
+static DEVICE_ATTR_RW(lpfc_fcp_cpu_map);
 
 /*
 # lpfc_fcp_class:  Determines FC class to use for the FCP protocol.
@@ -4859,9 +4846,7 @@ lpfc_max_scsicmpl_time_set(struct lpfc_vport *vport, int val)
 	return 0;
 }
 lpfc_vport_param_store(max_scsicmpl_time);
-static DEVICE_ATTR(lpfc_max_scsicmpl_time, S_IRUGO | S_IWUSR,
-		   lpfc_max_scsicmpl_time_show,
-		   lpfc_max_scsicmpl_time_store);
+static DEVICE_ATTR_RW(lpfc_max_scsicmpl_time);
 
 /*
 # lpfc_ack0: Use ACK0, instead of ACK1 for class 2 acknowledgement. Value
diff --git a/drivers/thermal/thermal_sysfs.c b/drivers/thermal/thermal_sysfs.c
index fb80c96d8f73..c008af7fb480 100644
--- a/drivers/thermal/thermal_sysfs.c
+++ b/drivers/thermal/thermal_sysfs.c
@@ -398,14 +398,13 @@ create_s32_tzp_attr(offset);
  */
 static DEVICE_ATTR(type, 0444, type_show, NULL);
 static DEVICE_ATTR(temp, 0444, temp_show, NULL);
-static DEVICE_ATTR(policy, S_IRUGO | S_IWUSR, policy_show, policy_store);
+static DEVICE_ATTR_RW(policy);
 static DEVICE_ATTR(available_policies, S_IRUGO, available_policies_show, NULL);
-static DEVICE_ATTR(sustainable_power, S_IWUSR | S_IRUGO, sustainable_power_show,
-		   sustainable_power_store);
+static DEVICE_ATTR_RW(sustainable_power);
 
 /* These thermal zone device attributes are created based on conditions */
-static DEVICE_ATTR(mode, 0644, mode_show, mode_store);
-static DEVICE_ATTR(passive, S_IRUGO | S_IWUSR, passive_show, passive_store);
+static DEVICE_ATTR_RW(mode);
+static DEVICE_ATTR_RW(passive);
 
 /* These attributes are unconditionally added to a thermal zone */
 static struct attribute *thermal_zone_dev_attrs[] = {
diff --git a/drivers/tty/serial/sh-sci.c b/drivers/tty/serial/sh-sci.c
index d9f399c4e90c..7257c078e155 100644
--- a/drivers/tty/serial/sh-sci.c
+++ b/drivers/tty/serial/sh-sci.c
@@ -1144,7 +1144,7 @@ static ssize_t rx_fifo_timeout_store(struct device *dev,
 	return count;
 }
 
-static DEVICE_ATTR(rx_fifo_timeout, 0644, rx_fifo_timeout_show, rx_fifo_timeout_store);
+static DEVICE_ATTR_RW(rx_fifo_timeout);
 
 
 #ifdef CONFIG_SERIAL_SH_SCI_DMA
diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c
index 452df0f87d6e..a1ab8acf39ba 100644
--- a/drivers/usb/host/xhci-dbgcap.c
+++ b/drivers/usb/host/xhci-dbgcap.c
@@ -920,7 +920,7 @@ static ssize_t dbc_store(struct device *dev,
 	return count;
 }
 
-static DEVICE_ATTR(dbc, 0644, dbc_show, dbc_store);
+static DEVICE_ATTR_RW(dbc);
 
 int xhci_dbc_init(struct xhci_hcd *xhci)
 {
diff --git a/drivers/usb/phy/phy-tahvo.c b/drivers/usb/phy/phy-tahvo.c
index b3ce42edb373..7f7c5c82420d 100644
--- a/drivers/usb/phy/phy-tahvo.c
+++ b/drivers/usb/phy/phy-tahvo.c
@@ -310,7 +310,7 @@ static ssize_t otg_mode_store(struct device *device,
 
 	return r;
 }
-static DEVICE_ATTR(otg_mode, 0644, otg_mode_show, otg_mode_store);
+static DEVICE_ATTR_RW(otg_mode);
 
 static struct attribute *tahvo_attributes[] = {
 	&dev_attr_vbus.attr,
diff --git a/drivers/video/fbdev/auo_k190x.c b/drivers/video/fbdev/auo_k190x.c
index 0d06038324e0..1e383c547633 100644
--- a/drivers/video/fbdev/auo_k190x.c
+++ b/drivers/video/fbdev/auo_k190x.c
@@ -708,8 +708,8 @@ static ssize_t temp_show(struct device *dev, struct device_attribute *attr,
 	return sprintf(buf, "%d\n", temp);
 }
 
-static DEVICE_ATTR(update_mode, 0644, update_mode_show, update_mode_store);
-static DEVICE_ATTR(flash, 0644, flash_show, flash_store);
+static DEVICE_ATTR_RW(update_mode);
+static DEVICE_ATTR_RW(flash);
 static DEVICE_ATTR(temp, 0644, temp_show, NULL);
 
 static struct attribute *auok190x_attributes[] = {
diff --git a/drivers/video/fbdev/w100fb.c b/drivers/video/fbdev/w100fb.c
index d570e19a2864..035ff6e02894 100644
--- a/drivers/video/fbdev/w100fb.c
+++ b/drivers/video/fbdev/w100fb.c
@@ -110,7 +110,7 @@ static ssize_t flip_store(struct device *dev, struct device_attribute *attr, con
 	return count;
 }
 
-static DEVICE_ATTR(flip, 0644, flip_show, flip_store);
+static DEVICE_ATTR_RW(flip);
 
 static ssize_t w100fb_reg_read(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
 {
@@ -166,7 +166,7 @@ static ssize_t fastpllclk_store(struct device *dev, struct device_attribute *att
 	return count;
 }
 
-static DEVICE_ATTR(fastpllclk, 0644, fastpllclk_show, fastpllclk_store);
+static DEVICE_ATTR_RW(fastpllclk);
 
 /*
  * Some touchscreens need hsync information from the video driver to
diff --git a/lib/test_firmware.c b/lib/test_firmware.c
index 64a4c76cba2b..964784dc1602 100644
--- a/lib/test_firmware.c
+++ b/lib/test_firmware.c
@@ -359,7 +359,7 @@ static ssize_t config_name_show(struct device *dev,
 {
 	return config_test_show_str(buf, test_fw_config->name);
 }
-static DEVICE_ATTR(config_name, 0644, config_name_show, config_name_store);
+static DEVICE_ATTR_RW(config_name);
 
 static ssize_t config_num_requests_store(struct device *dev,
 					 struct device_attribute *attr,
@@ -388,8 +388,7 @@ static ssize_t config_num_requests_show(struct device *dev,
 {
 	return test_dev_config_show_u8(buf, test_fw_config->num_requests);
 }
-static DEVICE_ATTR(config_num_requests, 0644, config_num_requests_show,
-		   config_num_requests_store);
+static DEVICE_ATTR_RW(config_num_requests);
 
 static ssize_t config_sync_direct_store(struct device *dev,
 					struct device_attribute *attr,
@@ -411,8 +410,7 @@ static ssize_t config_sync_direct_show(struct device *dev,
 {
 	return test_dev_config_show_bool(buf, test_fw_config->sync_direct);
 }
-static DEVICE_ATTR(config_sync_direct, 0644, config_sync_direct_show,
-		   config_sync_direct_store);
+static DEVICE_ATTR_RW(config_sync_direct);
 
 static ssize_t config_send_uevent_store(struct device *dev,
 					struct device_attribute *attr,
@@ -428,8 +426,7 @@ static ssize_t config_send_uevent_show(struct device *dev,
 {
 	return test_dev_config_show_bool(buf, test_fw_config->send_uevent);
 }
-static DEVICE_ATTR(config_send_uevent, 0644, config_send_uevent_show,
-		   config_send_uevent_store);
+static DEVICE_ATTR_RW(config_send_uevent);
 
 static ssize_t config_read_fw_idx_store(struct device *dev,
 					struct device_attribute *attr,
@@ -445,8 +442,7 @@ static ssize_t config_read_fw_idx_show(struct device *dev,
 {
 	return test_dev_config_show_u8(buf, test_fw_config->read_fw_idx);
 }
-static DEVICE_ATTR(config_read_fw_idx, 0644, config_read_fw_idx_show,
-		   config_read_fw_idx_store);
+static DEVICE_ATTR_RW(config_read_fw_idx);
 
 
 static ssize_t trigger_request_store(struct device *dev,
diff --git a/lib/test_kmod.c b/lib/test_kmod.c
index 337f408b4de6..e372b97eee13 100644
--- a/lib/test_kmod.c
+++ b/lib/test_kmod.c
@@ -694,8 +694,7 @@ static ssize_t config_test_driver_show(struct device *dev,
 	return config_test_show_str(&test_dev->config_mutex, buf,
 				    config->test_driver);
 }
-static DEVICE_ATTR(config_test_driver, 0644, config_test_driver_show,
-		   config_test_driver_store);
+static DEVICE_ATTR_RW(config_test_driver);
 
 static ssize_t config_test_fs_store(struct device *dev,
 				    struct device_attribute *attr,
@@ -726,8 +725,7 @@ static ssize_t config_test_fs_show(struct device *dev,
 	return config_test_show_str(&test_dev->config_mutex, buf,
 				    config->test_fs);
 }
-static DEVICE_ATTR(config_test_fs, 0644, config_test_fs_show,
-		   config_test_fs_store);
+static DEVICE_ATTR_RW(config_test_fs);
 
 static int trigger_config_run_type(struct kmod_test_device *test_dev,
 				   enum kmod_test_case test_case,
@@ -1012,8 +1010,7 @@ static ssize_t config_num_threads_show(struct device *dev,
 
 	return test_dev_config_show_int(test_dev, buf, config->num_threads);
 }
-static DEVICE_ATTR(config_num_threads, 0644, config_num_threads_show,
-		   config_num_threads_store);
+static DEVICE_ATTR_RW(config_num_threads);
 
 static ssize_t config_test_case_store(struct device *dev,
 				      struct device_attribute *attr,
@@ -1037,8 +1034,7 @@ static ssize_t config_test_case_show(struct device *dev,
 
 	return test_dev_config_show_uint(test_dev, buf, config->test_case);
 }
-static DEVICE_ATTR(config_test_case, 0644, config_test_case_show,
-		   config_test_case_store);
+static DEVICE_ATTR_RW(config_test_case);
 
 static ssize_t test_result_show(struct device *dev,
 				struct device_attribute *attr,
@@ -1049,7 +1045,7 @@ static ssize_t test_result_show(struct device *dev,
 
 	return test_dev_config_show_int(test_dev, buf, config->test_result);
 }
-static DEVICE_ATTR(test_result, 0644, test_result_show, test_result_store);
+static DEVICE_ATTR_RW(test_result);
 
 #define TEST_KMOD_DEV_ATTR(name)		&dev_attr_##name.attr
 
diff --git a/sound/soc/omap/mcbsp.c b/sound/soc/omap/mcbsp.c
index 7a54e3083203..79d4dc785e5c 100644
--- a/sound/soc/omap/mcbsp.c
+++ b/sound/soc/omap/mcbsp.c
@@ -854,7 +854,7 @@ static ssize_t dma_op_mode_store(struct device *dev,
 	return size;
 }
 
-static DEVICE_ATTR(dma_op_mode, 0644, dma_op_mode_show, dma_op_mode_store);
+static DEVICE_ATTR_RW(dma_op_mode);
 
 static const struct attribute *additional_attrs[] = {
 	&dev_attr_max_tx_thres.attr,
@@ -923,7 +923,7 @@ static ssize_t st_taps_store(struct device *dev,
 	return size;
 }
 
-static DEVICE_ATTR(st_taps, 0644, st_taps_show, st_taps_store);
+static DEVICE_ATTR_RW(st_taps);
 
 static const struct attribute *sidetone_attrs[] = {
 	&dev_attr_st_taps.attr,
-- 
2.15.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related

* [-next PATCH 0/4] sysfs and DEVICE_ATTR_<foo>
From: Joe Perches @ 2017-12-19 18:15 UTC (permalink / raw)
  To: linux-arm-kernel, linux-acpi, openipmi-developer, intel-gfx,
	linuxppc-dev, netdev, linux-nvme, platform-driver-x86, linux-s390,
	esc.storagedev, linux-scsi, linux-pm, linux-serial, linux-usb,
	linux-kernel, alsa-devel, linux-omap
  Cc: devel, linux-fbdev, linux-sh, dri-devel, linux-input, linux-media

Joe Perches (4):
  sysfs.h: Use octal permissions
  treewide: Use DEVICE_ATTR_RW
  treewide: Use DEVICE_ATTR_RO
  treewide: Use DEVICE_ATTR_WO

 arch/arm/mach-pxa/sharpsl_pm.c                     |  4 +-
 arch/s390/kernel/smp.c                             |  2 +-
 arch/s390/kernel/topology.c                        |  3 +-
 arch/sh/drivers/push-switch.c                      |  2 +-
 arch/tile/kernel/sysfs.c                           | 12 ++--
 arch/x86/kernel/cpu/microcode/core.c               |  2 +-
 drivers/acpi/device_sysfs.c                        |  6 +-
 drivers/char/ipmi/ipmi_msghandler.c                | 17 +++---
 drivers/gpu/drm/i915/i915_sysfs.c                  | 12 ++--
 drivers/input/touchscreen/elants_i2c.c             |  2 +-
 drivers/net/ethernet/ibm/ibmvnic.c                 |  2 +-
 drivers/net/wimax/i2400m/sysfs.c                   |  3 +-
 drivers/nvme/host/core.c                           | 10 ++--
 drivers/platform/x86/compal-laptop.c               | 18 ++----
 drivers/s390/cio/css.c                             |  8 +--
 drivers/s390/cio/device.c                          | 10 ++--
 drivers/s390/crypto/ap_card.c                      |  2 +-
 drivers/scsi/hpsa.c                                | 10 ++--
 drivers/scsi/lpfc/lpfc_attr.c                      | 64 ++++++++--------------
 .../staging/media/atomisp/pci/atomisp2/hmm/hmm.c   |  8 +--
 drivers/thermal/thermal_sysfs.c                    | 17 +++---
 drivers/tty/serial/sh-sci.c                        |  2 +-
 drivers/usb/host/xhci-dbgcap.c                     |  2 +-
 drivers/usb/phy/phy-tahvo.c                        |  2 +-
 drivers/video/fbdev/auo_k190x.c                    |  4 +-
 drivers/video/fbdev/w100fb.c                       |  4 +-
 include/linux/sysfs.h                              | 14 ++---
 lib/test_firmware.c                                | 14 ++---
 lib/test_kmod.c                                    | 14 ++---
 sound/soc/omap/mcbsp.c                             |  4 +-
 sound/soc/soc-core.c                               |  2 +-
 sound/soc/soc-dapm.c                               |  2 +-
 32 files changed, 120 insertions(+), 158 deletions(-)

-- 
2.15.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply

* Re: Have my PA8800 back online... (serial port missing on v4.14)
From: Andy Shevchenko @ 2017-12-19 10:53 UTC (permalink / raw)
  To: Helge Deller, Frank Scheiner, linux-parisc, John David Anglin,
	linux-serial
  Cc: debian-hppa
In-Reply-To: <ebe416dd-aa18-9433-4dd7-67490d5778ee@gmx.de>

On Mon, 2017-12-18 at 21:07 +0100, Helge Deller wrote:
> Hi Andy,
> 
> On 13.12.2017 16:16, Andy Shevchenko wrote:
> > On Tue, 2017-12-12 at 21:11 +0100, Helge Deller wrote:
> > > On 11.12.2017 09:26, Andy Shevchenko wrote:
> > > > 
> > > Thanks for the offer to accept this patch, but maybe we are able
> > > to come up with another patch which simply hides those unsupported
> > > devices (serial port and ATI graphics card device on the Diva
> > > card).
> > > I posted a proposed patch here:
> > > http://www.spinics.net/lists/linux-parisc/msg08187.html
> > 
> > Reading briefly that one I guess it's even better (now I realized
> > you
> > even do not have connectors of those devices outside).
> 
> It's now fixed for parisc by new PCI quirks which
> disable the parisc serial AUX port: 
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/com
> mit/?id=bcf3f1752a622f1372d3252d0fea8855d89812e7

Thank you for taking care of this.

-- 
Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Intel Finland Oy

^ permalink raw reply

* Re: [PATCH v4 25/36] nds32: Miscellaneous header files
From: Arnd Bergmann @ 2017-12-19  9:54 UTC (permalink / raw)
  To: Greentime Hu
  Cc: Greentime, Linux Kernel Mailing List, linux-arch, Thomas Gleixner,
	Jason Cooper, Marc Zyngier, Rob Herring, Networking, Vincent Chen,
	DTML, Al Viro, David Howells, Will Deacon, Daniel Lezcano,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven,
	Linus Walleij, Mark Rutland, Greg KH, Guo Ren
In-Reply-To: <CAEbi=3fWvrvdqUYOWdmbAHDmMpLiUaTaL_-jUjqg=p4aZiMLrA-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

On Tue, Dec 19, 2017 at 6:34 AM, Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi, Arnd:
>
> 2017-12-18 19:13 GMT+08:00 Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>:
>> On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>>> From: Greentime Hu <greentime-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
>>>
>>> This patch introduces some miscellaneous header files.
>>
>>> +static inline void __delay(unsigned long loops)
>>> +{
>>> +       __asm__ __volatile__(".align 2\n"
>>> +                            "1:\n"
>>> +                            "\taddi\t%0, %0, -1\n"
>>> +                            "\tbgtz\t%0, 1b\n"
>>> +                            :"=r"(loops)
>>> +                            :"0"(loops));
>>> +}
>>> +
>>> +static inline void __udelay(unsigned long usecs, unsigned long lpj)
>>> +{
>>> +       usecs *= (unsigned long)(((0x8000000000000000ULL / (500000 / HZ)) +
>>> +                                 0x80000000ULL) >> 32);
>>> +       usecs = (unsigned long)(((unsigned long long)usecs * lpj) >> 32);
>>> +       __delay(usecs);
>>> +}
>>
>> Do you have a reliable clocksource that you can read here instead of doing the
>> loop? It's generally preferred to have an accurate delay if at all possible, the
>> delay loop calibration is only for those architectures that don't have any
>> way to observe how much time has passed accurately.
>>
>
> We currently only have atcpit100 as clocksource but it is an IP of  SoC.
> These delay API will be unavailable if we changed to another SoC
> unless all these timer driver provided the same APIs.
> It may suffer our customers if they forget to port these APIs in their
> timer drivers when they try to use nds32 in the first beginning.

Ok, thanks for the clarification.

> Or maybe I can use a CONFIG_USE_ACCURATE_DELAY to keep these 2
> implementions for these purposes?

I'd just add a one-line comment in delay.h to explain that there is no
cycle counter in the CPU.

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

^ permalink raw reply

* Re: [PATCH v3 07/33] nds32: MMU initialization
From: Greentime Hu @ 2017-12-19  6:56 UTC (permalink / raw)
  To: Guo Ren
  Cc: Greentime, Linux Kernel Mailing List, Arnd Bergmann, linux-arch,
	Thomas Gleixner, Jason Cooper, Marc Zyngier, Rob Herring, netdev,
	Vincent Chen, DTML, Al Viro, David Howells, Will Deacon,
	Daniel Lezcano, linux-serial, Geert Uytterhoeven, Linus Walleij,
	Mark Rutland, Greg KH
In-Reply-To: <20171218122253.GA19382@gary-OptiPlex-3050>

Hi, Guo Ren:

2017-12-18 20:22 GMT+08:00 Guo Ren <ren_guo@c-sky.com>:
> On Mon, Dec 18, 2017 at 07:21:30PM +0800, Greentime Hu wrote:
>> Hi, Guo Ren:
>>
>> 2017-12-18 17:08 GMT+08:00 Guo Ren <ren_guo@c-sky.com>:
>> > Hi Greentime,
>> >
>> > On Fri, Dec 08, 2017 at 05:11:50PM +0800, Greentime Hu wrote:
>> > [...]
>> >>
>> >> diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
>> > [...]
>> >> +void *kmap(struct page *page)
>> >> +{
>> >> +     unsigned long vaddr;
>> >> +     might_sleep();
>> >> +     if (!PageHighMem(page))
>> >> +             return page_address(page);
>> >> +     vaddr = (unsigned long)kmap_high(page);
>> > Here should invalid the cpu_mmu_tlb's entry, Or invalid it in the
>> > set_pte().
>> >
>> > eg:
>> > vaddr0 = kmap(page0)
>> > *vaddr0 = val0 //It will cause tlb-miss, and hard-refill to MMU-tlb
>> > kunmap(page0)
>> > vaddr1 = kmap(page1) // Mostly vaddr1 = vaddr0
>> > val = vaddr1; //No tlb-miss and it will get page0's val not page1, because
>> >                 last expired vaddr0's entry is left in CPU-MMU-tlb.
>> >
>>
>> Thanks.
>> I will add __nds32__tlbop_inv(vaddr); to invalidate this mapping
>> before retrun vaddr.
>
> Sorry, perhaps I'm wrong. See
> kmap->kmap_high->map_new_virtual->get_next_pkmap_nr(color).
>
> Seems pkmap will return the vaddr by vaddr + 1 until
> no_more_pkmaps(), and then flush_all_zero_pkmaps.
> Just kmap_atomic need it, and you've done.

Thanks for double checking this case. :)
As you said, it will flush tlb in the generic code flow.

^ permalink raw reply

* Re: [PATCH v4 25/36] nds32: Miscellaneous header files
From: Greentime Hu @ 2017-12-19  5:34 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greentime, Linux Kernel Mailing List, linux-arch, Thomas Gleixner,
	Jason Cooper, Marc Zyngier, Rob Herring, Networking, Vincent Chen,
	DTML, Al Viro, David Howells, Will Deacon, Daniel Lezcano,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven,
	Linus Walleij, Mark Rutland, Greg KH, Guo Ren
In-Reply-To: <CAK8P3a1EOD3WB=c4JybBD5bazhVJ5reuegyA1Hyoj-nPHpsW6g-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

Hi, Arnd:

2017-12-18 19:13 GMT+08:00 Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>:
> On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>> From: Greentime Hu <greentime-MUIXKm3Oiri1Z/+hSey0Gg@public.gmane.org>
>>
>> This patch introduces some miscellaneous header files.
>
>> +static inline void __delay(unsigned long loops)
>> +{
>> +       __asm__ __volatile__(".align 2\n"
>> +                            "1:\n"
>> +                            "\taddi\t%0, %0, -1\n"
>> +                            "\tbgtz\t%0, 1b\n"
>> +                            :"=r"(loops)
>> +                            :"0"(loops));
>> +}
>> +
>> +static inline void __udelay(unsigned long usecs, unsigned long lpj)
>> +{
>> +       usecs *= (unsigned long)(((0x8000000000000000ULL / (500000 / HZ)) +
>> +                                 0x80000000ULL) >> 32);
>> +       usecs = (unsigned long)(((unsigned long long)usecs * lpj) >> 32);
>> +       __delay(usecs);
>> +}
>
> Do you have a reliable clocksource that you can read here instead of doing the
> loop? It's generally preferred to have an accurate delay if at all possible, the
> delay loop calibration is only for those architectures that don't have any
> way to observe how much time has passed accurately.
>

We currently only have atcpit100 as clocksource but it is an IP of  SoC.
These delay API will be unavailable if we changed to another SoC
unless all these timer driver provided the same APIs.
It may suffer our customers if they forget to port these APIs in their
timer drivers when they try to use nds32 in the first beginning.
Or maybe I can use a CONFIG_USE_ACCURATE_DELAY to keep these 2
implementions for these purposes?
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH v4 16/36] nds32: System calls handling
From: Vincent Chen @ 2017-12-19  2:10 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greentime Hu, Greentime, Linux Kernel Mailing List, linux-arch,
	Thomas Gleixner, Jason Cooper, Marc Zyngier, Rob Herring,
	Networking, DTML, Al Viro, David Howells, Will Deacon,
	Daniel Lezcano, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Geert Uytterhoeven, Linus Walleij, Mark Rutland, Greg KH,
	ren_guo-Y+KPrCd2zL4AvxtiuMwx3w, Philipp
In-Reply-To: <CAK8P3a2Yas3rWdx_qYx48PECundOzRSKOsqkJnUTzGW86OjJVg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

2017-12-18 19:19 GMT+08:00 Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>:
> On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>
>> new file mode 100644
>> index 0000000..90da745
>> --- /dev/null
>> +++ b/arch/nds32/include/uapi/asm/unistd.h
>> @@ -0,0 +1,12 @@
>> +// SPDX-License-Identifier: GPL-2.0
>> +// Copyright (C) 2005-2017 Andes Technology Corporation
>> +
>> +#define __ARCH_WANT_SYNC_FILE_RANGE2
>> +
>> +/* Use the standard ABI for syscalls */
>> +#include <asm-generic/unistd.h>
>> +
>> +/* Additional NDS32 specific syscalls. */
>> +#define __NR_cacheflush                (__NR_arch_specific_syscall)
>> +#define __NR__llseek             __NR_llseek
>> +__SYSCALL(__NR_cacheflush, sys_cacheflush)
>
> I'm still confused by __NR__llseek here, why do you need that one?
>

Dear Arnd:
We hoped to solve  ABI register alignment problem for llseek in glibc
by __NR__llseek.
After checking glibc again, I find glibc has same __NR__llseek macro
and It's better to solve this problem.
So, I will remove this definition in the next version patch.


>> +SYSCALL_DEFINE6(mmap2, unsigned long, addr, unsigned long, len,
>> +              unsigned long, prot, unsigned long, flags,
>> +              unsigned long, fd, unsigned long, pgoff)
>> +{
>> +       if (pgoff & (~PAGE_MASK >> 12))
>> +               return -EINVAL;
>> +
>> +       return sys_mmap_pgoff(addr, len, prot, flags, fd,
>> +                             pgoff >> (PAGE_SHIFT - 12));
>> +}
>> +
>> +SYSCALL_DEFINE6(mmap, unsigned long, addr, unsigned long, len,
>> +              unsigned long, prot, unsigned long, flags,
>> +              unsigned long, fd, unsigned long, pgoff)
>> +{
>> +       if (unlikely(pgoff & ~PAGE_MASK))
>> +               return -EINVAL;
>> +
>> +       return sys_mmap_pgoff(addr, len, prot, flags, fd,
>> +                             pgoff >> PAGE_SHIFT);
>> +}
>
> And I don't see why you define sys_mmap() in addition to sys_mmap2().
>
This is my mistake. I will remove it in the next version patch.

> The rest of the syscall handling looks good now.
>
>          Arnd


Thanks
Vincent
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: Have my PA8800 back online... (serial port missing on v4.14)
From: Helge Deller @ 2017-12-18 20:07 UTC (permalink / raw)
  To: Andy Shevchenko, Frank Scheiner, linux-parisc, John David Anglin,
	linux-serial
  Cc: debian-hppa
In-Reply-To: <1513178210.7000.34.camel@linux.intel.com>

Hi Andy,

On 13.12.2017 16:16, Andy Shevchenko wrote:
> On Tue, 2017-12-12 at 21:11 +0100, Helge Deller wrote:
>> On 11.12.2017 09:26, Andy Shevchenko wrote:
>>> On Fri, 2017-12-08 at 20:06 +0100, Helge Deller wrote:
> 
>> Before your patch this check was inside the function
>> serial_pci_guess_board()
>> and if (ent->driver_data != pbn_default) the pci serial port got
>> registered 
>> and initialized *even* if it's *not* of class SERIAL or MODEM.
> 
> Ah, okay, it explains indeed.
> Though PCI devices with wrong class should have their own quirks for my
> p.o.v.
> 
>>> (Of course, I agree this is regression and needs to be fixed ASAP)
>>
>> I don't know if it's easy to fix without reverting your patch.
> 
> As I explained earlier it's about pci_enable_device() called twice for
> the same device which basically calls pcibios_enable_irq() twice which
> might be a problem on some platforms. (At least I have such use case).
> Perhaps it's possible to workaround the issue on those platforms, though
> I didn't come up with the better solution that time.
> 
>> Thanks for the offer to accept this patch, but maybe we are able
>> to come up with another patch which simply hides those unsupported
>> devices (serial port and ATI graphics card device on the Diva card).

>> I posted a proposed patch here:
>> http://www.spinics.net/lists/linux-parisc/msg08187.html
> 
> Reading briefly that one I guess it's even better (now I realized you
> even do not have connectors of those devices outside).

It's now fixed for parisc by new PCI quirks which
disable the parisc serial AUX port: 
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=bcf3f1752a622f1372d3252d0fea8855d89812e7

Thanks,
Helge

^ permalink raw reply

* Re: jsm_tty: Deletion of a null pointer check in two functions?
From: SF Markus Elfring @ 2017-12-18 17:14 UTC (permalink / raw)
  To: Guilherme G. Piccoli, linux-serial
  Cc: Greg Kroah-Hartman, Joe Perches, Jiri Slaby, LKML,
	kernel-janitors
In-Reply-To: <533d608d-c502-824f-9c79-880e387f4d09@linux.vnet.ibm.com>

> So, what do you prefer? Send it yourself,

I became concerned that “my patch” would not get picked up because of
Greg's communication settings (for my initial messages when they do not get
resent by other contributors).


> or want me to send it with your sign-off too? (since was your idea).

I would prefer this variant because I assume that the chances for integration
are higher for the discussed small source code adjustment.
I guess that the tag “Suggested-by” would be sufficient in this case.

Regards,
Markus

^ permalink raw reply

* Re: jsm_tty: Deletion of a null pointer check in two functions?
From: Guilherme G. Piccoli @ 2017-12-18 14:36 UTC (permalink / raw)
  To: SF Markus Elfring
  Cc: linux-serial, Greg Kroah-Hartman, Joe Perches, Jiri Slaby, LKML,
	kernel-janitors
In-Reply-To: <817fcf72-cd9d-bf5b-ce83-ce2844e3e901@users.sourceforge.net>

On 12/16/2017 04:27 AM, SF Markus Elfring wrote:
>> Thanks for the fix.
> 
> Thanks for your positive feedback.
> 
> 
>> I was on vacation - but now seeing all the analysis made here,
> 
> I assume that special communication settings could trigger
> corresponding consequences for the discussed source code adjustment.
> 
> 
>> if "ch" can't be NULL then please go ahead and remove the check =)
> 
> Would you dare to convert this request into a concrete patch?

For me, it's OK if you send the patch or I can do it myself.
It's a minor patch...but it's correct the way I see it.

So, what do you prefer? Send it yourself, or want me to send
it with your sign-off too? (since was your idea).

Thanks,


Guilherme


> 
> Regards,
> Markus
> 


^ permalink raw reply

* Re: [PATCH v3 07/33] nds32: MMU initialization
From: Guo Ren @ 2017-12-18 12:22 UTC (permalink / raw)
  To: Greentime Hu
  Cc: Greentime, Linux Kernel Mailing List, Arnd Bergmann, linux-arch,
	Thomas Gleixner, Jason Cooper, Marc Zyngier, Rob Herring, netdev,
	Vincent Chen, DTML, Al Viro, David Howells, Will Deacon,
	Daniel Lezcano, linux-serial, Geert Uytterhoeven, Linus Walleij,
	Mark Rutland, Greg KH
In-Reply-To: <CAEbi=3dy+KGgftWOrbBpVPDZURiYVYwAyGWzd9z4T7RQYAk2FA@mail.gmail.com>

On Mon, Dec 18, 2017 at 07:21:30PM +0800, Greentime Hu wrote:
> Hi, Guo Ren:
> 
> 2017-12-18 17:08 GMT+08:00 Guo Ren <ren_guo@c-sky.com>:
> > Hi Greentime,
> >
> > On Fri, Dec 08, 2017 at 05:11:50PM +0800, Greentime Hu wrote:
> > [...]
> >>
> >> diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
> > [...]
> >> +void *kmap(struct page *page)
> >> +{
> >> +     unsigned long vaddr;
> >> +     might_sleep();
> >> +     if (!PageHighMem(page))
> >> +             return page_address(page);
> >> +     vaddr = (unsigned long)kmap_high(page);
> > Here should invalid the cpu_mmu_tlb's entry, Or invalid it in the
> > set_pte().
> >
> > eg:
> > vaddr0 = kmap(page0)
> > *vaddr0 = val0 //It will cause tlb-miss, and hard-refill to MMU-tlb
> > kunmap(page0)
> > vaddr1 = kmap(page1) // Mostly vaddr1 = vaddr0
> > val = vaddr1; //No tlb-miss and it will get page0's val not page1, because
> >                 last expired vaddr0's entry is left in CPU-MMU-tlb.
> >
> 
> Thanks.
> I will add __nds32__tlbop_inv(vaddr); to invalidate this mapping
> before retrun vaddr.

Sorry, perhaps I'm wrong. See
kmap->kmap_high->map_new_virtual->get_next_pkmap_nr(color).

Seems pkmap will return the vaddr by vaddr + 1 until
no_more_pkmaps(), and then flush_all_zero_pkmaps.
Just kmap_atomic need it, and you've done.

But I don't know why mips need flush_tlb_one in
arch/mips/mm/highmem.c:kmap(). VIPT? but kmap give the get_pkmap_color
for aliasing.

Best Regards
 Guo Ren

^ permalink raw reply

* Re: [PATCH v4 13/36] nds32: Device specific operations
From: Greentime Hu @ 2017-12-18 11:44 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Greentime, Linux Kernel Mailing List, linux-arch, Thomas Gleixner,
	Jason Cooper, Marc Zyngier, Rob Herring, Networking, Vincent Chen,
	DTML, Al Viro, David Howells, Will Deacon, Daniel Lezcano,
	linux-serial-u79uwXL29TY76Z2rM5mHXA, Geert Uytterhoeven,
	Linus Walleij, Mark Rutland, Greg KH, Guo Ren
In-Reply-To: <CAK8P3a0xQ4mYnkxjWTTEcvpJg6SfcA4WZKNkopa93_6Mz_YOGw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>

2017-12-18 19:26 GMT+08:00 Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>:
> On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu <green.hu-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
>
>> +#define __ASM_NDS32_IO_H
>> +
>> +extern void iounmap(void __iomem *addr);
>
> The prototype here should probably include 'volatile' to avoid warnings in an
> allmodconfig build.
>

Thanks. I will update it like this.
extern void iounmap(volatile void __iomem *addr);
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply

* Re: [PATCH RESEND] serdev: ttyport: do not used keyed wakeup in write_wakeup
From: Sebastian Reichel @ 2017-12-18 11:28 UTC (permalink / raw)
  To: Johan Hovold
  Cc: Rob Herring, Greg Kroah-Hartman, Jiri Slaby, linux-serial,
	linux-kernel
In-Reply-To: <20171218110019.21934-1-johan@kernel.org>

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

Hi,

On Mon, Dec 18, 2017 at 12:00:19PM +0100, Johan Hovold wrote:
> Serdev does not use the file abstraction and specifically there will
> never be anyone polling a file descriptor for POLLOUT events.
> 
> Just use plain wake_up_interruptible() in the write_wakeup callback and
> document why it's there.
> 
> Signed-off-by: Johan Hovold <johan@kernel.org>

Reviewed-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>

-- Sebastian

> ---
> 
> Here's a resend of the final patch from the series "[PATCH 0/8] serdev:
> receive_buf and locking fixes", which did not apply after the series was
> split over 4.15-rc and -next.
> 
> Johan
> 
> 
>  drivers/tty/serdev/serdev-ttyport.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/tty/serdev/serdev-ttyport.c b/drivers/tty/serdev/serdev-ttyport.c
> index c2629ab1bbcf..a5abb05be67d 100644
> --- a/drivers/tty/serdev/serdev-ttyport.c
> +++ b/drivers/tty/serdev/serdev-ttyport.c
> @@ -59,7 +59,8 @@ static void ttyport_write_wakeup(struct tty_port *port)
>  	    test_bit(SERPORT_ACTIVE, &serport->flags))
>  		serdev_controller_write_wakeup(ctrl);
>  
> -	wake_up_interruptible_poll(&tty->write_wait, POLLOUT);
> +	/* Wake up any tty_wait_until_sent() */
> +	wake_up_interruptible(&tty->write_wait);
>  
>  	tty_kref_put(tty);
>  }
> -- 
> 2.15.1
> 

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

^ permalink raw reply

* Re: [PATCH v4 13/36] nds32: Device specific operations
From: Arnd Bergmann @ 2017-12-18 11:26 UTC (permalink / raw)
  To: Greentime Hu
  Cc: Greentime, Linux Kernel Mailing List, linux-arch, Thomas Gleixner,
	Jason Cooper, Marc Zyngier, Rob Herring, Networking, Vincent Chen,
	DTML, Al Viro, David Howells, Will Deacon, Daniel Lezcano,
	linux-serial, Geert Uytterhoeven, Linus Walleij, Mark Rutland,
	Greg KH, ren_guo, Philip
In-Reply-To: <ec54d5ac8067e2ff542f69fc2967182922870b83.1513577007.git.green.hu@gmail.com>

On Mon, Dec 18, 2017 at 7:46 AM, Greentime Hu <green.hu@gmail.com> wrote:

> +#define __ASM_NDS32_IO_H
> +
> +extern void iounmap(void __iomem *addr);

The prototype here should probably include 'volatile' to avoid warnings in an
allmodconfig build.

      Arnd

^ permalink raw reply

* Re: [PATCH v3 07/33] nds32: MMU initialization
From: Greentime Hu @ 2017-12-18 11:21 UTC (permalink / raw)
  To: Guo Ren
  Cc: Greentime, Linux Kernel Mailing List, Arnd Bergmann, linux-arch,
	Thomas Gleixner, Jason Cooper, Marc Zyngier, Rob Herring, netdev,
	Vincent Chen, DTML, Al Viro, David Howells, Will Deacon,
	Daniel Lezcano, linux-serial-u79uwXL29TY76Z2rM5mHXA,
	Geert Uytterhoeven, Linus Walleij, Mark Rutland, Greg KH
In-Reply-To: <20171218090848.GA5823@gary-OptiPlex-3050>

Hi, Guo Ren:

2017-12-18 17:08 GMT+08:00 Guo Ren <ren_guo-Y+KPrCd2zL4AvxtiuMwx3w@public.gmane.org>:
> Hi Greentime,
>
> On Fri, Dec 08, 2017 at 05:11:50PM +0800, Greentime Hu wrote:
> [...]
>>
>> diff --git a/arch/nds32/mm/highmem.c b/arch/nds32/mm/highmem.c
> [...]
>> +void *kmap(struct page *page)
>> +{
>> +     unsigned long vaddr;
>> +     might_sleep();
>> +     if (!PageHighMem(page))
>> +             return page_address(page);
>> +     vaddr = (unsigned long)kmap_high(page);
> Here should invalid the cpu_mmu_tlb's entry, Or invalid it in the
> set_pte().
>
> eg:
> vaddr0 = kmap(page0)
> *vaddr0 = val0 //It will cause tlb-miss, and hard-refill to MMU-tlb
> kunmap(page0)
> vaddr1 = kmap(page1) // Mostly vaddr1 = vaddr0
> val = vaddr1; //No tlb-miss and it will get page0's val not page1, because
>                 last expired vaddr0's entry is left in CPU-MMU-tlb.
>

Thanks.
I will add __nds32__tlbop_inv(vaddr); to invalidate this mapping
before retrun vaddr.
--
To unsubscribe from this list: send the line "unsubscribe devicetree" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ 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