gpio_to_irq 이용하서 irq 생성 후 free_irq로 해제시 irq 전체가 작동되지 않을 때가 있나요?

remnant2000k의 이미지

안녕하세요.

GPIO 핀을 GPIO를 사용하다보니 이상한점이 하나가 있어서 문의 남겨보아요.
임베디드용으로 NUC970 칩을 사용해서 Linux 3.x 에서 작업하고 있습니다.

>>> 의심스러운 내용 드라이버를 만드는데 gpio_to_irq 이용해서 얻은 irq 번호로 아래와 같이 등록을 해놓고

==================================
241 irq_no_org = gpio_to_irq(BTN_PIN); //Pin H1
242
243 if( request_irq(irq_no_org, (void*)keyInterrupt_func, IRQF_DISABLED|IRQF_TRIGGER_FALLING,DEV_NAME_ORG,NULL))
244 {
245 printk("%s Faild to request intertup_ ORG\n", __FILE__);
246 return -ENOENT;
247 }
=================================

>>> 드라이버가 해제되는 시점에 free_irq() 호출하면 터치(TSC2007) 인터럽트 까지 동작되지 않네요.
============================
276 free_irq( irq_no_org ,NULL);
============================

알기로는 GPIO 의 Interrupt 소스원은 한 핀이로 알고 있습니다. 그래서 추측하기로는 free_irq 했을 때 전체적으로 GPIO Interrupt가 disable 이 되는 것은 아닌가 싶어서요.

다른 분들은 이런 경험이 없으신가요?

감사합니다.

furmuwon의 이미지

의심하는 상황을 해소하기 위한 확인 방법
사용하는 칩의 데이터시트에서 GPIO Register확인및 리류하여
콘솔에서 바로 gpio register 덤프 하여
터치 GPIO 펑션이 인터럽트가 아닌 인풋 아웃풋이 되는가 확인해 보시면 됩니다.

의심한 상황이 아니라면.. ㅎㅎㅎ

cat /proc/interrupt 해서 터치 및 버튼 인터럽트 번호 확인 하고
free하면 혹시 같이 없어지는지 확인 하시는 방법..

정말 급하면 free_irq 하지 말고 사용하는 방법.

remnant2000k의 이미지

답변 감사합니다. 그런데 별도로 생성되는 것 같은데요.

모듈로 insmod 모듈로 추가하면 481로 btn_int 나타납니다.
#cat /proc/interrupt
54: 6 - nuc970-i2c1
460: 0 GPIO-IRQ tsc2007
481: 0 GPIO-IRQ btn_int

그리고 rmmod 해서 모듈을 해제 하면 사라집니다. 그런데 터치는 남아 있는데도 인터럽터는 되지 않습니다.

하면 아래와 같이 460으로 나타나고
...
54: 6 - nuc970-i2c1
55: 7368 -
460: 0 GPIO-IRQ tsc2007

결국 free_irq 함수가 하나소스원인 gpio interrupt 를 disable 시키는 것은 아닌지 추측해봅니다.
그렇다면, gpio_to_irq()에서 얻은 irq 번호로 request_irq() 하는 것이 의미가 없어지는 아닌지 의문을 남겨봅니다.

댓글 달기

Filtered HTML

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

BBCode

  • 텍스트에 BBCode 태그를 사용할 수 있습니다. URL은 자동으로 링크 됩니다.
  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param>
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.

Textile

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • You can use Textile markup to format text.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Markdown

  • 다음 태그를 이용하여 소스 코드 구문 강조를 할 수 있습니다: <code>, <blockcode>, <apache>, <applescript>, <autoconf>, <awk>, <bash>, <c>, <cpp>, <css>, <diff>, <drupal5>, <drupal6>, <gdb>, <html>, <html5>, <java>, <javascript>, <ldif>, <lua>, <make>, <mysql>, <perl>, <perl6>, <php>, <pgsql>, <proftpd>, <python>, <reg>, <spec>, <ruby>. 지원하는 태그 형식: <foo>, [foo].
  • Quick Tips:
    • Two or more spaces at a line's end = Line break
    • Double returns = Paragraph
    • *Single asterisks* or _single underscores_ = Emphasis
    • **Double** or __double__ = Strong
    • This is [a link](http://the.link.example.com "The optional title text")
    For complete details on the Markdown syntax, see the Markdown documentation and Markdown Extra documentation for tables, footnotes, and more.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 사용할 수 있는 HTML 태그: <p><div><span><br><a><em><strong><del><ins><b><i><u><s><pre><code><cite><blockquote><ul><ol><li><dl><dt><dd><table><tr><td><th><thead><tbody><h1><h2><h3><h4><h5><h6><img><embed><object><param><hr>

Plain text

  • HTML 태그를 사용할 수 없습니다.
  • web 주소와/이메일 주소를 클릭할 수 있는 링크로 자동으로 바꿉니다.
  • 줄과 단락은 자동으로 분리됩니다.
댓글 첨부 파일
이 댓글에 이미지나 파일을 업로드 합니다.
파일 크기는 8 MB보다 작아야 합니다.
허용할 파일 형식: txt pdf doc xls gif jpg jpeg mp3 png rar zip.
CAPTCHA
이것은 자동으로 스팸을 올리는 것을 막기 위해서 제공됩니다.