I am not very sure whether this is a real bug. In function moxa_new_dcdstate() (in file drivers/tty/moxa.c), function tty_hangup() may be called only when “C_CLOCAL(tty)” is true (at line 1363). But in many other places, function tty_hangup() is called only when “!C_CLOCAL(tty)” is true (e.g. codes of function rfcomm_dev_modem_status in file net/bluetooth/rfcomm/tty.c). The related codes are as following. moxa_new_dcdstate @@ drivers/tty/moxa.c:1362 1362 tty = tty_port_tty_get(&p->port); 1363 if (tty && C_CLOCAL(tty) && !dcd) 1364 tty_hangup(tty); 1365 tty_kref_put(tty); rfcomm_dev_modem_status @@ net/bluetooth/rfcomm/tty.c:625 625 if ((dev->modem_status & TIOCM_CD) && !(v24_sig & RFCOMM_V24_DV)) { 626 if (dev->tty && !C_CLOCAL(dev->tty)) 627 tty_hangup(dev->tty); 628 } Thanks RUC_Soft_Sec
Well spotted.. thats been lurking forever 8) Will get it fixed although I'm not sure anyone has moxa hardware these days!
A patch referencing this bug report has been merged in Linux v3.8-rc1: commit 4bd82136cdf04f3a8d50e20c1b76da750f75f2db Author: Alan Cox <alan@linux.intel.com> Date: Thu Nov 1 16:43:49 2012 +0000 moxa: dcd handling of CLOCAL is backwards