Re: [PATCH v4 1/2] tty: serial: qcom_geni_serial: IRQ cleanup

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 11/6/2019 10:03 PM, Stephen Boyd wrote:
Thanks for reviewing.
Quoting Greg KH (2019-11-06 04:16:00)
On Tue, Nov 05, 2019 at 05:00:12PM -0800, Stephen Boyd wrote:
Quoting Greg KH (2019-11-05 09:17:05)
On Tue, Nov 05, 2019 at 03:27:15PM +0530, Akash Asthana wrote:
@@ -1307,7 +1307,21 @@ static int qcom_geni_serial_probe(struct platform_device *pdev)
       port->handle_rx = console ? handle_rx_console : handle_rx_uart;
       if (!console)
               device_create_file(uport->dev, &dev_attr_loopback);
-     return uart_add_one_port(drv, uport);
+
+     ret = uart_add_one_port(drv, uport);
+     if (ret)
+             return ret;
What is going to remove the sysfs file you just created above (in a racy
way, it's broken and needs to be fixed, but that's a different issue
here...)?


+
+     irq_set_status_flags(uport->irq, IRQ_NOAUTOEN);
+     ret = devm_request_irq(uport->dev, uport->irq, qcom_geni_serial_isr,
+                     IRQF_TRIGGER_HIGH, port->name, uport);
+     if (ret) {
+             dev_err(uport->dev, "Failed to get IRQ ret %d\n", ret);
+             uart_remove_one_port(drv, uport);
+             return ret;
Does this remove the sysfs file?

The loopback file isn't documented. It isn't removed when the driver is
removed either. Can we just remove the whole thing? It would be nicer if
that sort of thing was supported in the tty layer somehow. Is it?
I don't know what that file does, so yes, please delete it :)

This sysfs file was exposed to user to configure hardware to run in loopback mode (sorting TX and RX lines).

We use this mode to sanity test TX and RX path of the driver after making any code changes.

But we can remove this sysfs file and use TIOCM_LOOP to set HW in loopback mode as suggested by stephen.

And as for support in the tty layer itself, if you figure out what it
does, sure, we can add support if needed.

I think it may be supported in the tty layer with TIOCM_LOOP already.
Akash, can you confirm?

Yeah, its already supported in tty layer. We can call TIOCMSET ioctl from user space test application with TIOCM_LOOP argument to configure our HW in loopback mode.

I will remove all the code related to loopback sysfs.

Thanks for this suggestion.

--
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,\na Linux Foundation Collaborative Project




[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux PPP]     [Linux FS]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Linmodem]     [Device Mapper]     [Linux Kernel for ARM]

  Powered by Linux