From: Johan Hovold <johan@kernel.org>
To: Tung Pham <Tung.Pham@silabs.com>
Cc: "gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>,
Pho Tran <Pho.Tran@silabs.com>,
Hung Nguyen <Hung.Nguyen@silabs.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>
Subject: Re: patch "USB: serial: cp210x: add support for GPIOs on CP2108" added to usb-next
Date: Thu, 1 Jul 2021 09:02:04 +0200 [thread overview]
Message-ID: <YN1obE99oebXaD24@hovoldconsulting.com> (raw)
In-Reply-To: <CO1PR11MB4882C876E69D61C52C42DAB981009@CO1PR11MB4882.namprd11.prod.outlook.com>
On Thu, Jul 01, 2021 at 04:58:09AM +0000, Tung Pham wrote:
> >Are you sure you're using the latest mainline kernel here, that is,
> >5.13 here? With recent kernel's you would not see -ENODEV ("No such
> >device") but rather -EINVAL ("Invalid argument"). What does "uname
> >-a" say?
>
> I use the kernel 5.8.0-59-generic, I think either result ("No such
> device") or ("Invalid argument") may be accepted in this case.
Yes, you should be able to apply this patch to older kernels without
many additional changes, but you should still mention which kernel
you're using since backporting may not always work as expected.
> >And which version of the patch are you applying? Are you sure it's
> >the latest?
>
> I apply patch V13 from last mail that you send.
Good.
> >> But when I test the branch of Mr Gregkh.
> >> https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git/tree/dr
> >> ivers/usb/serial/cp210x.c?h=usb-testing
> >> root@ubuntu:/sys/class/gpio# echo 496 > /sys/class/gpio/export
> >> root@ubuntu:/sys/class/gpio# echo 497 > /sys/class/gpio/export That
> >> mean it still use GPIO 0 and GPIO 1 as GPIO functions.
>
> >It does seem that way, but to be sure, do the
>
> > /sys/class/gpio/gpio496
> > /sys/class/gpio/gpio497
>
> >directories show up as well?
>
> Today I retest it and it seem everything is ok. May be previous test I
> have some loading driver problem. The result is as below:
>
> echo 496 > /sys/class/gpio/export
> -bash: echo: write error: Invalid argument
> echo 497 > /sys/class/gpio/export
> -bash: echo: write error: Invalid argument
> tung@ubuntu:~$ /sys/class/gpio/gpio496
> bash: /sys/class/gpio/gpio496: No such file or directory
Very odd.
Were you using the very same device in both tests? And did you try with
the older kernel before the new one? Perhaps the new settings had not
yet taken effect otherwise?
> >I just did a quick test using the code in the usb-next (testing)
> >branch and it seems to work as expected when hard-coding alternate
> >functions for some of >the pins in the driver.
> >
> >I did not actually reprogram the device so perhaps something is
> >broken with regards to reading the port configuration. But then you
> >should see the >problem if you apply the patch to an earlier kernel
> >as well.
> >
> >Can you apply the below patch on top of Greg's usb-next (or
> >usb-testing) branch and send me the logs from when connecting the
> >device?
>
> The log written is:
> [ 3599.781531] cp210x 2-2.1:1.0: cp2108_gpio_init - 03 00 00 00
Thanks for confirming. So everything appears to work as expected, and
you should have seen the expected -EINVAL unless the device actually did
return all-zero here for some reason.
Johan
next prev parent reply other threads:[~2021-07-01 7:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1624532158188214@kroah.com>
[not found] ` <PH0PR11MB4888B9D24A5F90E8AA02B28B81019@PH0PR11MB4888.namprd11.prod.outlook.com>
2021-06-30 10:05 ` patch "USB: serial: cp210x: add support for GPIOs on CP2108" added to usb-next Johan Hovold
2021-07-01 4:58 ` Tung Pham
2021-07-01 7:02 ` Johan Hovold [this message]
2021-07-01 7:46 ` Tung Pham
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YN1obE99oebXaD24@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=Hung.Nguyen@silabs.com \
--cc=Pho.Tran@silabs.com \
--cc=Tung.Pham@silabs.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-usb@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox